title: The type or namespace name 'X' does not exist in the namespace 'Y' - in VS generated code
body: <p>This is the weirdest error I have ever encountered.</p>
  
  <p>This MVC web project was working fine until today. It hasn't been worked on by anyone in a couple of weeks.</p>
  
  <p>Even though NOTHING has changed, simply running it now results in:</p>
  
  <blockquote>
    <p>The type or namespace name 'ColourboxViewModel' does not exist in the namespace 'CMSModels.ViewModels'</p>
  </blockquote>
  
  <p>(x5)</p>
  
  <blockquote>
    <p>The type or namespace name 'Colourbox' does not exist in the namespace 'CMSModels' (are you missing an assembly reference?)</p>
  </blockquote>
  
  <p>(x1)</p>
  
  <p>There is a reference to CMSModels in the project. Removing this reference gives me about 200 extra errors for each other class in the namespace, so I know it is working, but not for these two errors.</p>
  
  <p>This is the line of generated code which the error points to:</p>
  
  <pre><code>public class views_colorbox_index_aspx : System.Web.Mvc.ViewPage&lt;IEnumerable&lt;CMSModels.Colourbox&gt;&gt;, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {
  ...
  public class views_colorbox_content_ascx : System.Web.Mvc.ViewUserControl&lt;CMSModels.ViewModels.ColourboxViewModel&gt; {
  </code></pre>
  
  <p>Intellisense is picking up the location of both CMSModels.ColourBox and CMSModels.ViewModels.ColourboxViewModel.</p>
  
  <p>I am completely stumped. Any help greatly appreciated as I am completely at a loss.</p>
  
  <hr>
  
  <p>OK I have found the issue - but not the solution. </p>
  
  <p>The class is defined as </p>
  
  <pre><code>public class ColourBoxViewModel
  </code></pre>
  
  <p>yet the generated code is looking for a class of 'ColourboxViewModel'. Note the lowercase B. Where does the auto-gen code get the names of classes from? Search in project reveals no mentions of it with a lowercase b. </p>
  
  <p>The issue is the same for the ColourBox class.</p>
  
  <hr>
  
  <p>Problem solved - and @František Žiačik you were correct. There was a folder which had been excluded from the project (which is why searching in entire project and within the views in visual studio found nothing) which contained the incorrectly typed inherit statement. The excluded folder was called ColorBox when originally created by outsourcers. This had been copied and renamed as ColourBox by another dev on the team who decided to, and I quote, 'spell everything correctly'. Said dev is now only allowed to code using a Speak n' Spell.</p>