views:

48

answers:

4

I have two VS 2008 solutions I'm working with. One is a web app calling components built in the other solution. Is it possible to somehow start a debugging session in the web solution and have it hit breakpoints in the second solution (cue laugh track)?

I'd prefer not to have to add the various component projects to the web solution in order to debug them, but that may well turn out to be the case. Thought I'd ask if there was another way just the same. Thanks.

+1  A: 

YES. Attach the other debugger to the process you want to debug.

Dani
Won't work - you'll get an error saying a debugger is already attached.
Philip Wallace
If it's the same process.
Dani
i just did it myself, you must run the start up solution without debugging and then attach the debugger with the dll solutions to that process.
sweeney
A: 

Not unless the two components are in the same process, no. There is one or zero debugged process per debugger, and exactly one attached debugger per debugged process.

Depending on what you intend, placing hard-code DebugBreak() in your code might allow you to trigger a second instance of the debugger. In this way your client code can trigger breakpoints in the back-end. Sometimes this method is more convenient than simply attaching the debugger to the server process and setting breakpoints via the IDE.

In any case, if you have two processes to debug, you must use two instances of the debugger, not one.

Heath Hunnicutt
Actually if they are not in the same process it's even easier.I debug many client - server apps in 2 IDES, jumping from one to another....
Dani
if you mean a service library - then it's trickier...
Dani
@Dani, not only does that not address the OP's question, but my answer already indicated that using two debugger instances is a possible alternative solution. But the OP seems to want to use one debugger instance, not two.
Heath Hunnicutt
But I'd like to check it. Interesting point...
Dani
Maybe I didn't get the question.. Doesn't he wants to use 2 debuggers ?
Dani
"I'd prefer not to have to add the various component projects to the web solution in order to debug them" -- I think he wants to debug both the server and client process in the same IDE.
Heath Hunnicutt
"There is one or zero debugged process per debugger" That's plain wrong. I'm debugging several processes (of a distributed application) at the same time on a daily base. Just keep attaching to other processes.
sbi
Hi guys,It doesn't especially matter to me if I use one or two debuggers (I wasn't clear in my post, so apologies for that.) I'd just like to do this, in the best way possible, if it can be done that is. It sounds like it can, so I'll dig in from here. Thanks to everyone for helping!
larryq
A: 

To augment what Dani mentioned, go to your Project's properties and click on Debug. From there you can start an external program (another VS instance). This will launch VS as part of the debug process.

Blake Blackwell
A: 

You can add one solution to another - maybe this will give you what you want but keep your two solutions isolated to a degree:

Did you know... You can add a solution to a solution - #153

Philip Wallace