Visual Studio 2005 Debug by attaching to process on Win 2003 Server

Here is how to debug by Attaching to a process… in Visual Studio 2005 on Windows Server 2003.

First go to Debug >  Attach to Process..

Then the process that you need to attach to is w3wp.exe.  I was used to attaching to the aspnet_wp.exe process, but that isn’t the case on Windows Server 2003.

One thing I noticed is when I simply did this when ever there was a connection being made to the database I would encounter a  

EXECUTE permission denied on object ‘sp_sdidebug’, database ‘master’, owner ‘dbo’.

exception.   To get around this I had to make sure when in the “Attach to Process” dialog that the Attach to: attribute is “Managed”.  You can change this by clicking on the Select button next to it and choosing it.

I can now finally attach to a process when debugging on Windows 2003. 

 

Leave a Reply

*