views:

716

answers:

1

First a little background on what I am trying to achieve.

I have a client application that is utilizing REST services served by ArcGIS Server and IIS 7. I want to be able to modify the response (remove or add parameters) before the response is sent to the client. Therefore, I am developing a custom HttpModule using Visual Studio 2010 and .NET 3.5 to intercept and modify the response.

However, I am having difficulty debugging my custom HttpModule. I can attach to the IIS process using Visual Studio 2010 when it is run as Administrator, however, executing the web 3rd party web application does not cause any of my breakpoints to be hit. I can confirm that my module is running as it is able to write the contents to a file on disk.

Things to note,

  1. The 3rd party web application is running in a virtual directory (e.g., arcgis/rest/) under the default website in IIS 7. It is running under its own application pool which is configured for .NET 2.0 rather than 4.0.
  2. The custom module is installed in the web applications bin folder and has been configured using the web.config file rather than the IIS 7 module management.

To summarize: How can I debug a custom HttpModule I developed for a 3rd party web application using Visual Studio 2010?

A: 

A few things to check:

  • Make sure you have the right process. ASP.NET can decide to spawn multiple worker processes, especially if the process identity is different bettween apppools, etc.

  • Make sure the debug="true" is set in the compilation element in the web.config for the web application where the module is registered

  • Make sure the module is being compiled in Debug mode (ie: debug symbols are being generated).

The calling application should be irrelevant. You should be able to test this by just using a web browser to make a request to the virdir where the module is registered.

David
I confirmed that I'm attaching to the correct process using windows task manager and that the application is compiled in Debug mode. As suggested I modified the web.config file so that debug="true".When I attach to the process Visual Studio warns me that debug symbols are not being loaded via the breakpoints. But, this seems to be the case only when I attach via the Debug option with windows task manager. If I attach using Visual Studio there is no such warning.I am testing this by using a web browser and making a request to the virtual directory where the module is registered.
Ryan Taylor
The only other thing I can think of is that they configuration that registers the module is incomplete and it is never being loaded into the worker process, thus no symbols and obviously the module isn't processing the requests at all.
David