There are some ways to do this. But the easiest would be:
- Start Solution B
- Go to Solution A
- Go to Debug->Attach to Process...
- Choose the executable you're running (from Solution B, of course. You may have to check "Show processes from all users")
You need to link your Solution A to Solution B's debuggable version for this to work. Usually it's in the bin\Debug
subdirectory of your project. In that case, your Breakpoint should be hit as soon as it's reached.
Another way would be:
- Open Solution A's properties.
- Go to Debug
- Under "Start Action" choose "Start external program:"
- Browse to Solution B's executable
Run Solution A.
Yet another way would be to insert into your class library the sentence Debugger.Break();
(which requires using System.Diagnostics;
). Be careful to not release the debug version, though! As soon as it's reached, the System should throw up a dialog box asking if you'd like to debug the process. This process depends on the correct installation of all components as well...