title: rebuilding solution causes Could not load file or assembly on Razor 1.0.0.0
body: <p>In my MVC3 solution, I have made some changes and when I go to debug after a rebuild, I get the error: </p>
  
  <pre><code>Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
  </code></pre>
  
  <p>Doing a recursive GET fixes this, until I rebuild again, to see my changes, then the solution breaks with the same error. I haven't changed any of the web.config files and it is only c# code that is checked out. </p>
  
  <p>If the assembly was not correct, then the recursive GET would still break the solution, surely? I'm not sure whats going wrong</p>
  
  <p>Stack trace:</p>
  
  <pre><code>[FileNotFoundException: Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
     System.Web.Mvc.PreApplicationStartCode.Start() +0
  
  [InvalidOperationException: The pre-application start initialization method Start on type System.Web.Mvc.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..]
     System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +556
     System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132
     System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean&amp; isRefAssemblyLoaded) +102
     System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
     System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516
  
  [HttpException (0x80004005): The pre-application start initialization method Start on type System.Web.Mvc.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..]
     System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9885060
     System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
     System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
  </code></pre>