I'm new to IIS and ASP.NET so please excuse that in advance.

We have an ASP.NET application that references a Managed C++/CLI DLL that has various unmanaged C++ dependencies. The Managed DLL is deployed to the application's bin folder, and the unmanaged DLLs live in a subfolder of bin/.

When I do a full iisreset (or reboot the server), I get an ASP.NET warning of an unhandled exception in the event log. From there, I get the exact same exception whenever I run the code which requires the Managed DLL.

However...the problem vanishes as soon as I touch anything in the bin/ folder. From then on, the code that uses the Managed DLL works perfectly. Until the next IIS reset.

Any thoughts or pointers are appreciated. Obviously I'm looking for



For posterity, I work with Ryan, and this was resolved.

We narrowed down the issue by realizing that touching files within the Application Site directory ("served" directory) triggers an Application Restart. We found a Global.asax.cs file that listens to the Application_Start ASP.NET lifecycle event, and there was an error within that listener. Source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.