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

Tuesday, December 16, 2008

Visual Studio Tips: Task List Comments

I don't know about a lot of you but when I code sometimes I will leave this on a page to come back and do later, or I have some hack that I am using temporarily that I am going to need to come back and change. I am a bit scatter brained and sometimes I forget to come back and fix these.

That is why when I'm working through these I leave myself notes, in the Visual Studio task list. You can manually type things in there or you get things in there directly from your code comments by using comment tokens.

There are a few built in (TODO, HACK, and UNDONE) that I use all the time, but you can add your own, or just use the built in ones by just adding the prefix in front of your comment. ex:

'TODO: find more elegant solution
'HACK: hardcoded

These will show up for you to come back to in your task list so you don't have to go searching around double click the task and away you go. A big time saver.

Labels:

posted by Tom Becker at | 0 Comments