title: Renaming a ViewModel in ASP.NET MVC causing a compilation error. How to fix?
body: <p>I renamed one of my ViewModels. Upon doing so, VS Express 2013 for Web asked me if I want it to change the name throughout my project and of course I said yes...</p>
  
  <p>Well, now when I visit the page that uses that particular ViewModel I am given the following compilation error:</p>
  
  <blockquote>
    <p><strong>Compiler Error Message:</strong> CS0234: The type or namespace name
    'OldNameViewModel' does not exist in the namespace
    'MyProject.ViewModels' (are you missing an assembly reference?)</p>
  </blockquote>
  
  <p>It shows me the following lines of code...</p>
  
  <pre><code>Line 28:     
  Line 29:     
  Line 30:     public class _Page_Views_Inventory_Create_cshtml : System.Web.Mvc.WebViewPage&lt;MyProject.ViewModels.OldNameViewModel&gt; {
  Line 31:         
  Line 32: #line hidden
  </code></pre>
  
  <p>...and it gives me a path to the file where this code is located:</p>
  
  <blockquote>
    <p><strong>Source File:</strong> c:\Users\Jason\AppData\Local\Temp\Temporary ASP.NET
    Files\root\d4024d39\1941e695\App_Web_create.cshtml.7f862902.aox9w9wr.0.cs</p>
  </blockquote>
  
  <p>I went there and changed the <code>&lt;MyProject.ViewModels.OldNameViewModel&gt;</code> bit to <code>&lt;MyProject.ViewModels.NewNameViewModel&gt;</code> and saved...</p>
  
  <p>I refreshed the page, same problem. I rebuilt, same problem. I deleted the entire "Temporary ASP.NET Files" directory, same problem. I deleted the directory, closed IIS Express, closed VS, and then reopened, rebuilt, etc.—same problem: it keeps replacing the file with a new file using the <code>OldNameViewModel</code>.</p>
  
  <p>Is this normal or has something funky happened? Either way, how do I fix this?</p>
  
  <p>Thanks!</p>