title: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Elmah.MVC issue
body: <p>Locally - my MVC 4, asp.net, c# app runs fine on IIS 8 / Windows 8.</p>
  
  <p>When deployed to Windows Server 2008, I get this error:</p>
  
  <pre><code>Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>[FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
     Elmah.Mvc.Bootstrap.Initialize() +0
  
  [InvalidOperationException: The pre-application start initialization method Initialize on type Elmah.Mvc.Bootstrap threw an exception with the following error message: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).]
     System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +12881963
     System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +12881672
     System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +240
     System.Web.Compilation.BuildManager.ExecutePreAppStart() +152
     System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1151
  
  [HttpException (0x80004005): The pre-application start initialization method Initialize on type Elmah.Mvc.Bootstrap threw an exception with the following error message: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).]
     System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881108
     System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
     System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722297
  </code></pre>
  
  <p>This happens if I select 'Only files needed to run this application' from the 'Items to deploy' drop down in project properties/package/publish web.</p>
  
  <p>If I select 'all files in this project' it works fine.</p>
  
  <p>I guess Elmah is reliant on an older version of MVC or something - how can I fix this without having to upload all the files?</p>
  
  <p>Whats the best way to problem solve situations like this?</p>
  
  <p>Thanks.</p>