How to debug the method that I set using the assembly attribute PreApplicationStartMethodAttribute while working in IIS 7.5?

I declared PreApplicationStartMethodAttribute at assembly level as follows:

 [assembly: PreApplicationStartMethod(typeof(MyApp.Global), "InitializeApplication")] 

See this explanation for more details.

Here's the InitializeApplication declaration:

 public class Global : HttpApplication { public static void InitializeApplication() { // Initialization code goes here... } } 

I am running my application on a local instance of IIS 7.5 and I want to debug my InitializeApplication method. I set a breakpoint on it, but it didn’t hit.

I believe that the code is executed when the application pool starts, as far as I know, until the moment I hit F5 in Visual Studio.

I tried connecting the debugger to any IIS related process that I could find, but to no avail.

I also understand that I can debug using Cassini, but I need to fix an IIS related issue.

So the question is: how can I debug the PreApplicationStartMethodAttribute method specified?

+4
source share
1 answer

Try using IIS Express locally, it might be easier to connect a debugger to it.

+3
source

All Articles