title: Pre-jit-compiling MVC Web Application
body: <p>When using our MVC Web Application after it is updated, it takes several minutes to load the homepage for de first time. After the first load it loads pretty fast. Probably the MSIL code is compiled to Native Machine code and is cached. (Correct me if i'm wrong). This occures for every page.</p>
  
  <p>Everytime a new version is copied over to the server it is very slow.
  To solve this problem i was trying to get it pre-jit-compiled with ngen so we could save lots time for our users.
  However when executing "ngen install mydll.dll" for every dll in it's project bin folder, it gives me several errors. This is the command </p>
  
  <pre><code>cd "C:\Windows\Microsoft.NET\Framework64\v4.0.30319"
  for %%i in (C:\inetpub\wwwroot\myproject\bin\*.dll) do ngen install "%%i"
  </code></pre>
  
  <p>The first errors are:</p>
  
  <pre><code>Failed to load dependency System.Web.Mvc of assembly DotNetOpenAuth.Core, 
  Version=4.3.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246 because of the following error : The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  Failed to load dependency log4net of assembly DotNetOpenAuth.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246 because of the following error : The system cannot find the file specified. (Exception from  HRESULT: 0x80070002)
  </code></pre>
  
  <p>The project just debugs and builds fine. What is the correct way to achieve this?</p>