title: Razor class library and html helpers problem
body: <p>I create a small admin tool and I decided to convert it to a Razor class library so that I will be able to use it in other applications as well. I created the Razor Class Library project and I added all the razor pages that I had in my main project and I tried to test the new project. The problem was that the framework for some reason did not recognize the html helpers so I created a new clean project and try to find out what is wrong and the result was that the application did not fire the post action of the razor page and the asp-for property was not using properly the property value. I used the following code in order to test the Razor Class Library.</p>
  
  <p>Page1.cshtml.cs</p>
  
  <pre><code>public class Page1Model : PageModel
  {
      [BindProperty]
      public Input MyInput { get; set; }
  
      public class Input
      {
          public string Name { get; set; }
      }
      public void OnGet()
      {
  
      }
  
      public void OnPost()
      {
  
      }
  }
  </code></pre>
  
  <p>Page1.cshtml</p>
  
  <pre><code>@page
  @model WebApplication1.MyFeature.Pages.Page1Model
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta name="viewport" content="width=device-width" /&gt;
      &lt;title&gt;Page1&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form method="post"&gt;
          &lt;input asp-for="MyInput.Name" /&gt;&lt;br /&gt;
          &lt;input type="submit" /&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The generated html was the following</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;meta name="viewport" content="width=device-width" /&gt;
      &lt;title&gt;Page1&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form method="post"&gt;
          &lt;input asp-for="MyInput.Name" /&gt;&lt;br /&gt;
          &lt;input type="submit" /&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>As you can see the input for MyInput.Name appears as I typed it the Page1.cshtml file. The right output shoud be the following:</p>
  
  <pre><code>&lt;input type="text" id="MyInput_Name" name="MyInput.Name" value="" /&gt;&lt;br /&gt;
  </code></pre>
  
  <p>Do I have to do something in order to make the html helpers work and the OnPost action to be called when a post request occurs?</p>