A rendering has been recursively embedded within itself

1) installed a fresh instance of sitecore 8.2 update 5

2) Created a Layout 

3) Created a Placeholder 

4) Created a Controller rendering which displays a list of github public projects 

5) associated an item with the newly created layout , placeholder and controller rendering appropriately 

 

On publish i receive the error on the layout file 

 

A rendering has been recursively embedded within itself. Embedding trail: MainGitListing-Controller:  PackageDeployer.Controllers.HomeController, PackageDeployer. Action: Index [MainGitListing-Controller:  PackageDeployer.Controllers.HomeController, PackageDeployer. Action: Index- {2b3265b3-5606-4a0a-872b-ec360cf93aff}] --> MainGitListing-Controller:  PackageDeployer.Controllers.HomeController, PackageDeployer. Action: Index [MainGitListing-Controller:  PackageDeployer.Controllers.HomeController, PackageDeployer. Action: Index- {2b3265b3-5606-4a0a-872b-ec360cf93aff}]

Description: An unhandled exception occurred. 

Exception Details: Sitecore.Mvc.Exceptions.CyclicRenderingException: A rendering has been recursively embedded within itself. Embedding trail: MainGitListing-Controller:  PackageDeployer.Controllers.HomeController, PackageDeployer. Action: Index [MainGitListing-Controller:  PackageDeployer.Controllers.HomeController, PackageDeployer. Action: Index- {2b3265b3-5606-4a0a-872b-ec360cf93aff}] --> MainGitListing-Controller:  PackageDeployer.Controllers.HomeController, PackageDeployer. Action: Index [MainGitListing-Controller:  PackageDeployer.Controllers.HomeController, PackageDeployer. Action: Index- {2b3265b3-5606-4a0a-872b-ec360cf93aff}]

Source Error: 

Line 14: <body>
Line 15:     <div class="container body-content">
Line 16:         @Html.Sitecore().Placeholder("MainGitListing")
Line 17:         <hr />
Line 18:         <footer>

 

 

Stack Trace: 

[CyclicRenderingException: A rendering has been recursively embedded within itself. Embedding trail: MainGitListing-Controller:  PackageDeployer.Controllers.HomeController, PackageDeployer. Action: Index [MainGitListing-Controller:  PackageDeployer.Controllers.HomeController, PackageDeployer. Action: Index- {2b3265b3-5606-4a0a-872b-ec360cf93aff}] --> MainGitListing-Controller:  PackageDeployer.Controllers.HomeController, PackageDeployer. Action: Index [MainGitListing-Controller:  PackageDeployer.Controllers.HomeController, PackageDeployer. Action: Index- {2b3265b3-5606-4a0a-872b-ec360cf93aff}]]
   Sitecore.Mvc.Pipelines.Response.RenderPlaceholder.PerformRendering.CreateCyclePreventer(String placeholderName, Rendering rendering) +598
   Sitecore.Mvc.Pipelines.Response.RenderPlaceholder.PerformRendering.Render(String placeholderName, TextWriter writer, RenderPlaceholderArgs args) +155
   (Object , Object[] ) +74
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +196
   Sitecore.Mvc.Helpers.SitecoreHelper.Placeholder(String placeholderName) +259
   ASP._Page_Views_Shared__Layout_cshtml.Execute() in d:\Sitecore_Instance_Root\inetpub\wwwroot\PackageDeploy\Website\Views\Shared\_Layout.cshtml:16
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +253
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   System.Web.WebPages.<>c__DisplayClass3.<RenderPageCore>b__2(TextWriter writer) +311
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +108
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +89
   System.Web.WebPages.WebPageBase.PopContext() +310
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +90
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +710

Controller code :

public class HomeController : Controller
{
         public ActionResult Index()
            {
                     var lnksList = new List<GitLinks>();
                     var repos = retrieveGitHubRepos();
                     foreach (var repo in repos)
                      {
                             lnksList.Add(new GitLinks() {
                             Text = repo.Name ,
                             Link = repo.Url 

                              });
                                
                       }

                     return View("Index",lnksList);
              }

}