Reputation: 981
I have been trying to debug a class library in a Solution A with a MVC project in Solution B. I run Solution B, set a breakpoint in Solution A, but the debugger never gets into Solution A.
I have already tried with this answer and this answer with no success.
How can I debug multiple Solutions in VS2012?
Thanks!
Upvotes: 0
Views: 5455
Reputation: 5568
There are some ways to do this. But the easiest would be:
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:
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...
Upvotes: 1
Reputation: 1474
Make a Solution C which contains both the class library from Solution A as well as the MVC project in Solution B. This will not require any changes or copies to the class library project or MVC project. In fact, you can keep those where they are, and simply add the existing projects to the new Solution C.
Upvotes: 0