Having a very odd issue with a large asp.net 4 application. IIS will sometimes load modules not from the shadow copy location but instead the bin directory where the dlls are originally sourced from.
Does anyone know how the IIS module loading works and whether this is normal behaviour or a bug?
Problems this is causing us
- In dev; the respective dlls get locked in the bin folder meaning that msbuild cannot replace it on build.
- this is causing us a particularly nasty (and difficult to find) issue (which we are working around with a hack) where we get TypeMismatchException in nhibernate queryovers
Notes
- ASP.NET 4 application running on Win7 & WinServer2008R2, IIS 7.5, multiple projects using MVC3, MVC4, WebForms, WebApi
- Module information sourced by attaching VS debugger and inspecting loaded modules
- If I IISRESET and clear the temp asp.net files folder then spool up the application then the dlls are all copied to the shadow copy location and are then loaded from there. If I then IISRESET again and spool up the application the modules are loaded from the bin location instead of the shadow copy location
- This only affects project dependencies of the web project the entry point is always loaded from the shadow copy location. IE Proj.Web will load from shadow copy location, a project dependency of that Proj.BusinessLogic & Proj.DataAccess will load from the bin folder, external dependencies (automapper, glimpse, etc) will load from the shadow copy location.
- We are not overriding any app pool or app domain configuration in either code, web.config or IIS config (default settings).
- Can't find anywhere that module loading or app startup is verbosely logged to.