title: Adding a simple TagHelper causes this error: "RenderBody has not been called for the page "
body: <p><a href="https://github.com/ciaran036/coresample" rel="nofollow noreferrer">Code available here</a></p>
  
  <p>In an ASP.NET Core 3.0 web application, I have added the following simple tag helper: </p>
  
  <pre><code>[HtmlTargetElement("submit-button")]
  public class SubmitButtonTagHelper : TagHelper
  {
      public string Title { get; set; } = "Submit";
      public string Classes { get; set; }
      public string Id { get; set; }
  
      public override void Process(TagHelperContext context, TagHelperOutput output)
      {
          output.Content.SetHtmlContent(
              $@"&lt;span class=""btn btn-primary {Classes}"" id=""{Id}""&gt;{Title}&lt;/span&gt;");
      }
  }
  </code></pre>
  
  <p>Which I intend to use like this: </p>
  
  <pre><code>&lt;submit-button&gt;&lt;/submit-button&gt;
  </code></pre>
  
  <p>However, the act of adding the SubmitButtonTagHelper without even attempting to use it results in the following runtime exception: </p>
  
  <blockquote>
    <p>InvalidOperationException: RenderBody has not been called for the page
    at '/Views/Shared/_Layout.cshtml'. To ignore call IgnoreBody().</p>
  </blockquote>
  
  <p>I have imported the tag helpers by adding this line to the Pages/_ViewImports.cshtml file: </p>
  
  <pre><code>@addTagHelper *, Web
  </code></pre>
  
  <p>My _Layout.cshtml page looks like this: </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;&lt;vc:product-name&gt;&lt;/vc:product-name&gt; @ViewData["Title"]&lt;/title&gt;
  
      @RenderSection("Styles", required: false)
  
      &lt;partial name="_FrameworkStyles" /&gt;
  &lt;/head&gt;
  &lt;body class="top-navigation"&gt;
  
      &lt;div id="wrapper"&gt;
          &lt;div id="page-wrapper" class="gray-bg"&gt;
              &lt;div class=""&gt;
                  &lt;vc:Navigation&gt;&lt;/vc:Navigation&gt;
  
                  @RenderBody()
  
                  &lt;div class="footer"&gt;&lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  
      &lt;partial name="_FrameworkScripts" /&gt;
  
      @RenderSection("Scripts", required: false)
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>How am I going wrong here? On debugging, I can see that the a breakpoint is being hit in the SubmitButtonTagHelper but yet I haven't referenced it anywhere? It was my understanding that the [HtmlTargetElement] attribute would mean it would only apply where the element tag was "submit-button". Is that not correct? </p>
  
  <p>I have one other tag helper in my project and I also noticed that the breakpoint in that class is also being hit in places where I haven't referenced it. </p>
  
  <p>I'm surely doing something silly, but what? </p>