views:

753

answers:

1

I have a C# class library (which is an AutoCAD .net application) and a console application.

Somewhere in the class library, it starts the console application using Process.Start()

I have both of these projects with the same solution, I have set the class library as the startup project (to launch AutoCAD). I can debug the class library, but not the console application.

How can I debug the console application given this configuration?

+2  A: 

You need to use the Debug->Attach To Process option in Visual Studio.

sipwiz
Unfortunately this doesn't work for me because AutoCAD, which the class library code is running in already has the debugger attached, and I would have to somehow pause the console application in order to be able to attach the debugger to it. The only workaround I know of is to put Debugger.Break()
jumpinjackie
You don't need to pause the application to attach a debugger. If another debugger is already attached, you can still attach WinDbg in non-invasive mode and look at the process, but not control it.
Brian Rasmussen