title: Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral' or one of its dependencies. Access is denied
body: <p>Seems like there are already 100s of questions like these.. I have search through quite many of them and they don't seem to suggest anything that I haven't tried yet.</p>
  <p>I get the error:</p>
  <blockquote>
  <p>Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral,    PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied.</p>
  <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p>
  <p>Exception Details: System.IO.FileLoadException: Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied.</p>
  </blockquote>
  <pre><code>Source Error: 
  
  
  
  Line 44:         private static IKernel CreateKernel()
  Line 45:         {
  Line 46:             var kernel = new StandardKernel();
  Line 47:             try
  Line 48:             { 
  </code></pre>
  <p>The above code is present in my Ninject Initializer.</p>
  <p>I have given &quot;<strong>Everyone</strong>&quot; Permissions on:</p>
  <p>C:\Windows\Microsoft.NET\Framework\v4.0.30319</p>
  <p>C:\Windows\Microsoft.NET\Framework64\v4.0.30319</p>
  <p>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\ .NETFramework</p>
  <p>FusionLog Details:</p>
  <pre><code>Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
  Running under executable  C:\Program Files (x86)\IIS Express\iisexpress.exe
  --- A detailed error log follows. 
  
  === Pre-bind state information ===
  LOG: DisplayName = System.Web, Version=4.0.0.0, Culture=neutral,    PublicKeyToken=b03f5f7f11d50a3a
  (Fully-specified)
  LOG: Appbase = file:///F:/TFS/MMSChange/Main/SMRH.MMSChange/SMRH.MMSChange.Web/
  LOG: Initial PrivatePath = F:\TFS\MMSChange\Main\SMRH.MMSChange\SMRH.MMSChange.Web\bin
  Calling assembly : (Unknown).
  ===
  LOG: This bind starts in default load context.
  LOG: Found application configuration file     (F:\TFS\MMSChange\Main\SMRH.MMSChange\SMRH.MMSChange.Web\web.config).
  </code></pre>
  <p>I have also given everyone permissions on my code's folders. I have tried running ProcMon (which has helped me with the similar problems for different solutions before); but it does not create a single entry for system.web.dll.</p>
  <p>I have impersonation built in. I use separate accounts to access the database and that impersonation for the database account breaks this. Without impersonation the app runs fine. (But has no data because all the db calls fail)</p>
  <p>Funny thing is though, if I deploy the same code to my local machine and run it via an IIS Web Site: it works. But if I just debug it from my IDE it fails.</p>