Home


.Net, SQL and softball. Musings of a software developer with a softball problem

Tuesday, May 19, 2009

Unable to attach debugger process in Visual Studio

Today I had to debug a web service that was running locally and in the same solution where the project that I am working on. Before I seem to remember just automatically stepping into the web service while debugging, but that was in Visual Studio 2005, so it could be different with 2003. So in order to do this you need to attach the worker process to the debugger so it can load all the symbols and whatnot, so it will catch at breakpoints and you can step through line by line

So to attach a new process for the debugger to what you go to Debug -> Processes and then choose from the list and click attach. In my case this was the .Net worker process aspnet_wp.exe. This did not work for me right off, and it seems that many other people are having the same problem. I kept getting that wonderfully generic MS message that says "Unable to attach process" and that was it, no other help. In this case it can be just a simple oversight.

There is a worker process for each version of .Net that you have running. I was careless when I set up the web service in IIS and I had it running under the 2.0 worker process instead of 1.1, which is fine in general since everything is backwards compatible, but in order to debug you need to make sure you have everything matching up and choosing the right worker process for your app.

Labels:

posted by Tom Becker at

2 Comments:

Blogger Raman said...

Hi Tom,

I just inherited a VS2003/1.1/WSE2.0 application and need to enhance it. I ran into teh same problem you described. However, your solution didn't get me very far.

I now get an exception whenever the service is called.

Message:

Unrecognized attribute 'type'

Offending line:

sectionGroup name="system.web.extensions"; type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"

When I look at the web.config file, I don't even see the offending line. Furthermore, it is a 3.5 framework type.

I was wondering whether you ran into this problem and had a fix for it.

My machine has VS2003, 2005, 2008 on it.

TIA for your help.

July 29, 2009 5:06 PM

 
Blogger Tom Becker said...

Raman,

While I didn't run into your problem attaching a debugger to a process I have run into this problem before.

As you mentioned this is a 3.5 type, so it won't run as a 1.1 App. Have you checked your project references to make sure you have the right version in there? Check your bin directory.

Also look in your GAC to make sure you have all of the versions of the System.Web.Extensions in there.

Are you using any third party tools or? Sometimes the external tool will try and bring in extra dlls.

~tom

July 30, 2009 10:11 AM

 

Post a Comment

<< Home