title: MVC: An unhandled exception of type 'System.StackOverflowException' occurred in System.Core.dll
body: <p>This is my main layout of the application</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;title&gt;@ViewBag.Title - My ASP.NET Application&lt;/title&gt;
      @Styles.Render("~/Content/css")
      @Scripts.Render("~/bundles/modernizr")
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="banner"&gt;
          &lt;div class="container"&gt;
              &lt;div class="navbar-header"&gt;
                  &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                  &lt;/button&gt;
                  @Html.ActionLink("Date Picker", "Index", "Home", null, new { @class = "navbar-brand" })
              &lt;/div&gt;
              &lt;div class="navbar-collapse collapse"&gt;
                  &lt;ul class="nav navbar-nav"&gt;
                      &lt;li&gt;@Html.ActionLink("Home", "Index", "Home")&lt;/li&gt;
                      &lt;li&gt;@Html.ActionLink("About", "About", "Home")&lt;/li&gt;
                      &lt;li&gt;@Html.ActionLink("Contact", "Contact", "Home")&lt;/li&gt;
                  &lt;/ul&gt;
                  @Html.Partial("_LoginPartial")
  
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      @if (User.Identity.IsAuthenticated)
      {
          &lt;div class="row"&gt;
              &lt;div class="col-md-3"&gt;
                  &lt;div class="bs-sidebar hidden-print affix" role="complementary"&gt;
                      &lt;ul class="nav bs-sidenav"&gt;                       
                          &lt;li class="active"&gt;
                              @Html.ActionLink("Address Book","Index","AddressBook")
                              &lt;ul class="nav"&gt;                              
                                  &lt;li&gt;
                                      @Html.ActionLink("Add Contact", "AddPerson", "AddressBook")
                                  &lt;/li&gt;                               
                              &lt;/ul&gt;
                          &lt;/li&gt;
                          &lt;li&gt;
                              @Html.ActionLink("App", "Create", "Appointment")                           
                          &lt;/li&gt;
                          &lt;li&gt;
                              @Html.ActionLink("myconn", "Index", "Connection")//error when I click this link.                     
                          &lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;      
      }
      &lt;div class="container body-content"&gt;
          @RenderBody()
          &lt;hr /&gt;
          &lt;footer&gt;
              &lt;p&gt;&amp;copy; @DateTime.Now.Year - MyApp&lt;/p&gt;
          &lt;/footer&gt;
      &lt;/div&gt;
  
      @Scripts.Render("~/bundles/jquery")
      @Scripts.Render("~/bundles/bootstrap")
      @RenderSection("scripts", required: false)
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I get the sidebar when the user is logged in, all the links work in sidebar except </p>
  
  <pre><code>@Html.ActionLink("myconn", "Action", "Controller")   
  </code></pre>
  
  <p>When I click the link called SuperOffice browser link changes to <code>http://localhost:14834/Connection</code>
  but I get error: in visual studio saying</p>
  
  <pre><code>An unhandled exception of type 'System.StackOverflowException' occurred in System.Core.dll
  </code></pre>
  
  <p>Here is my controller code</p>
  
  <pre><code>[Authorize]
  public class Controller : Controller
  {
      private readonly IConnectionRepository _connectionRepository;
  
      public ConnectionController(IConnectionRepository connectionRepository)
      {
          _connectionRepository = connectionRepository;
      }
  }
  </code></pre>
  
  <p>When I put breakpoint in Index method of Connection controller, and click the SuperOffice link, I don't even get to that method.
  Any idea what is happening? 
  I find it strange that all the link are working and I get forwarded to controller and all thing works perfect except that one.</p>