I hit a snag this mroning trying to work on a site that accesses a remote third party SQL Server. I was trying to debug a the code to track down an error. To my surprise I kept throwing a different exception and at a different location in the code when I debuged.
EXECUTE permission denied on object 'sp_sdidebug', database 'master', owner 'dbo'.
I quickly determined that this must be due to the fact that I obviously do not own the stored procedure I am trying to execute and for some reason Visual Studio is trying to step into the SQL Code. But I knew I did not specify this option when I defined the debug options for the web site. Now, remember how I mentioned that I like to attach to an existing process to debug my web sites? That was the culprit.
When you attach to an existing process, you are by default debugging into the SQL code. This has to be selected by itself by clicking the 'Select' button in the middle of the dialog. You only need to have the 'Managed' option checked. Too bad this was not real obvious, but now you know!