title: ViewComponent fired but no output appears on page
body: <p>I've got a navbar at the top of my ASP.Net CORE site and I'm trying to create dynamic menu options. So far, I'm just trying to replace some of the options on the _layout page with a ViewComponent like I've done in a few other projects.</p>
  
  <pre><code>&lt;header&gt;
      &lt;nav class="navTop"&gt;
          &lt;a class="logo" asp-controller="Home" asp-action="Index"&gt;
              &lt;img src="~/Images/logo.svg" /&gt;
          &lt;/a&gt;
          @{ await Component.InvokeAsync("MainMenu"); }
          @{ await Html.RenderPartialAsync("_LoginPartial"); }
      &lt;/nav&gt;
  &lt;/header&gt;
  </code></pre>
  
  <p>I have my Component View in the folder</p>
  
  <pre><code>Views &gt; Shared &gt; Components &gt; MainMenu &gt; Default.cshtml
  </code></pre>
  
  <p>Which looks like this:</p>
  
  <pre><code>@model IEnumerable&lt;MyProject.Models.Home.MainMenuItem&gt;
  </code></pre>
  
  <p>@foreach (var item in Model)
  {
      
          @Html.ActionLink(item.DisplayText, item.Action, item.Controller)
      
  }</p>
  
  <p>And the ViewComponent InvokeAsync looks like:</p>
  
  <pre><code>    public async Task&lt;IViewComponentResult&gt; InvokeAsync()
      {
          var x = new DataAccess.Menus.Menu(_context).GetMainMenuItems(User.Identity.Name);
          return View(x);
      }
  </code></pre>
  
  <p>And the DataAccess method is simply returning a List of <code>MyProject.Models.Home.MainMenuItem</code> as expected, which has everything populated fine when I step through, but nothing is resulting on the page in the  in place of <code>@{ await Component.InvokeAsync("MainMenu"); }</code>!</p>
  
  <p>I've done this before in a few other projects and never had a problem - so I don't know why this could be going wrong. Any ideas?!</p>
  
  <p>It's getting to the view and I can even see it stepping through the <code>foreach</code> loop with the correct populated properties so why does nothing show up on the page?</p>