title: How to fix 'The type name does not exist' error in C# while having the correct namespace and the directory
body: <p>I'm having an issue trying to build a Project because of the same error result. This error states:</p>
  
  <pre><code>The type 'Shared' (my guess the folder) does not exist in the type 'MyNameSpace'.
  </code></pre>
  
  <p><a href="https://ibb.co/fDZ0Pyb" rel="nofollow noreferrer">https://ibb.co/fDZ0Pyb</a> - Image of the IDE with error code and the project structure. This image alternative is due to my low rep not letting me post images.</p>
  
  <p>I've tried searching for an answer to solve this issue. All the methods that I tried (for example: excluding the folder and then adding it back, deleting de .vs folder and others) were unsuccessful.</p>
  
  <p>In Blazor the _Imports.razor file has all the files used in the App. In this file, I'm adding the following using statements.</p>
  
  <pre><code>@using NeighborHub
  @using NeighborHub.Shared
  @using NeighborHub.Data
  </code></pre>
  
  <p>I assume that because the folder exists this error should not be popping. If I'm missing anything please help. If this could be recognized as a bug how can I solve this issue or should I open a new issue on github.</p>
  
  <p>POST EDIT
  <a href="https://ibb.co/sqGyw23" rel="nofollow noreferrer">https://ibb.co/sqGyw23</a> - This image adds more details about the IDE and the error.</p>
  
  <p>Adding to this I'm using .NET Core 3.0 preview 9 which came out not long ago.</p>
  
  <p>The razor page which results in the error is the following:</p>
  
  <pre><code>@page "/househubform"
  @page "/househubform/{EditId:int}"
  
  @using NeighborHub.Data
  
  @inject Data.ApplicationDbContext db
  @inject NavigationManager UriHelper
  
  @attribute [Authorize(Roles = "admin")]
  
  &lt;div class="card"&gt;
      &lt;h3 class="card-header text-center"&gt;Add a New HouseHub&lt;/h3&gt;
      //Some Html code
  
  @*--- Code Below ---*@
  @code {
      //Variables used to fill the form
      Data.HouseHub houseHub = new Data.HouseHub();
      private string varSurname { get; set; } = null;
      private string varHouseNumber { get; set; } = null;
      private int varHouseholdSize { get; set; } = 0;
      private int FKId { get; set; } = 0;
  
      //Drowdown list
      private List&lt;Data.NeighborHub&gt; NeighborHub = new List&lt;Data.NeighborHub&gt;();
  
      //Error Msg
      public string Errmsg { get; set; }
  
      //Parameters
      [Parameter]
      public int EditId { get; set; } = 0;
  
      //On change select list update
      private void SelectListUpdate(ChangeEventArgs Event)
      {
          FKId = Int32.Parse(Event.Value.ToString());
      }
  
      //Submit form to database
      private async Task SubmitForm()
      {
          //Submit logic and validation
      }
  
      //Edit form to database
      private async Task EditForm()
      {
          //Edit logic and validation
      }
  
      //Initializing logic using Async Task
      protected override async Task OnInitializedAsync()
      {
          //If EditId is passed it will start filling the entity to edit
          if (EditId != 0)
          {
              houseHub = await db.DbHouseHubs.FindAsync(EditId);
              //The following will occur only if the entity is found
              if (houseHub != null)
              {
                  varSurname = houseHub.Surname;
                  varHouseNumber = houseHub.HouseNumber;
                  varHouseholdSize = houseHub.HouseholdSize;
                  FKId = houseHub.NeighborhubId;
                  NeighborHub = db.DbNeighborHubs.ToList();
              }
              //If the entity is not found it will set an error
              else
              {
                  Errmsg = "Could not find the entity. Add a new entry or cancel.";
                  EditId = 0;
                  NeighborHub = db.DbNeighborHubs.ToList();
              }
          }
          //If set to 0 this will create a new entry
          else
          {
              NeighborHub = db.DbNeighborHubs.ToList();
          }
      }
  }
  </code></pre>