Pre-compiling ASP.NET solution causes error in integrated mode on IIS7
===

We have a site that we are trying to move to IIS7 on Windows Server 2008 R2 that was previously hosted on IIS6 on Windows Server 2003.

The problem (to me at least) is really strange.  

If I precompile the site using our website deployment build scripts (which produces COMPILED files in the BIN directory) and place it on the server with “Managed Pipeline Mode” set to “Integrated” we get the following error:

> Could not load file or assembly 'log4net, Version=1.2.10.0,
> Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its
> dependencies. Access is denied.

If I change “Managed Pipeline Mode” to “Classic” – it works.  I'd prefer not to leave it running in Classic mode.

If I leave “Managed Pipeline Mode” set to “Integrated” and just copy the Web solution directly onto the server without running it through our build scripts to get it into a precompiled state – it works in Integrated mode.  

***What could precompiling the solution possible doing to it that would cause the Access is denied error for log4net only in Integrated mode?***
