When debugging web sites that I’m working on, I tend to use Attach to Process rather than F5 to start debugging (since the site’s already on in Firefox). However, occasionally when doing so, I’ll get the following error:
EXECUTE permission denied on object ‘sp_sdidebug’, database ‘master’, owner ‘dbo’.
I know this is caused by attaching the debugger for T-SQL, rather than just managed code (see this blog post for further explanation on that issue).
I’m hoping that it’s possible to set somewhere to avoid attaching to T-SQL in the first place, rather than having to remember to go reset that setting each time I attach.
So, here’s the real question: Does anyone know how I can change the default behavior of Visual Studio 2008, so that when attaching to a process through the debug menu, it does not automatically attach to T-SQL, but only to managed code? That is, how can Studio be set to remember not to attach to anything other than managed code?
FYI, if there are project-specific settings, I’m using a C# Web Application project.
You can change the debugging engines used to attach to a process by clicking on the ‘select…’ button on the ‘attach to:’ line in the attach dialog.
Choose the ‘Debug these code types’ option instead of the automatic one, and make sure the T-SQL option is cleared.
I don’t know how to set this as a default, hopefully Visual Studio will just remember it.