I am working on a web application (ASP.NET 3.5/C#) based on a legacy application over which we have implemented our code. The application is hosted on a Virtual Machine where MS Server 2003 with IIS 6 is installed.
Randomly some exceptions occur, like:”Loading this assembly would produce a different grant” without giving us much information on where/why does it happen in the application.
For this reason we want to track the web application in order to get as much information as possible about its behaviour.
We have just started using “NLog” to track the users activity and the Requests/Responsed in a log file. However can anyone suggest some further application in order to get more information?
Since part of the code is not accessible due to the legacy application, a solution that would avoid direct interaction with the code (as example the need to instantiate the application in the code itself) would be preferrable.
You can try using adplus on the application pool process and generate dump whenever application throws exception. For instance executing following command:
will produce memory dumps of IIS and all MTS/COM+ packages currently running. By default it creates mini dumps on first chance exceptions (so those that might have been handled) and full dumps on second change exception (unhandled ones). If you are interested only in one particular pool you may use its PID (here is info how to get it) and run:
After getting a dump you may load it into Visual Studio and try to debug your app (remember to configure your symbols path correctly)