Friday, June 6, 2008

Visual Studio Debugging with Siteminder

I've seen a few sites mentioning techniques for debugging within a Siteminder world.

This may be a little out dated since it uses Visual Studio 2003, but I'm pretty sure the technique is the same.

Without further ado, here's the steps to do debugging:

  1. Make sure Visual Studio is not running. It's not mandatory, but it makes it an easier approach.
  2. Disable Siteminder. This is usually done via config file called WebAgent.conf and is generally located in C:\Program Files\netegrity\webagent\bin\IIS\. Look for a line that looks like EnableWebAgent="YES". Change "YES" to "NO". Note: Case is VERY important!
  3. Restart IIS. Normally, this is done through the IIS management console, but a reboot will also work. However, that approach won't work later on.
  4. Start your Visual Studio instance and your Siteminder protected project.
  5. Next, after the project has fully loaded, change the "NO" back to "YES" and restart IIS. (See why rebooting doesn't work?)
  6. Now, debug using "Attach to process" and attach to the ASP.NET worker process for your Windows version.

This is a rather simplistic approach, but it works very effectively. It's a pain, but once you get used to it, it becomes second nature. One of these days, I'd like to write a script that automates this, but for now I'll settle for the extra manual steps.

Happy coding!


In VS 2008, most of these steps are not needed. In particular, steps 1 through 5 are not needed, You just need to make sure that Siteminder is enabled and you attach to the ASP.NET worker process running through IIS. This will not work in the "built in" web server in VS 2008.

Good luck!