Search code examples
.netvisual-studiovisual-studio-2010projects-and-solutions

Debugging Multiple Solutions in VS2010


I have two separate solutions, SolutionA and SolutionB. SolutionA references the output from SolutionB as follows:

SolutionA
    ProjectA1
        References: ProjectB1.dll, ProjectB2.dll
    ProjectA2

SolutionB
    ProjectB1
    ProjectB2

What I'd like to do is to run SolutionA to debug the program, but then to attach a second IDE to debug SolutionB as well (to step through ProjectA1 into ProjectB1 for example).

So far, the only way I've managed to do this is to add ProjectB1 into SolutionA - which forces you to check out the solution in TFS, and doesn't seem to be recognised as the same project for debugging purposes. Is there a way to do this?


Solution

  • We have this problem frequently with our larger projects that include exported libraries. The approach you are taking is the correct one and should work.

    Starting with the source control problem: I have seen problems with TFS when doing this, because the projects do not share a common root folder -- TFS doesn't like when a project file is not in a child folder of the solution file's location. It may try to strip the source control bindings from Project B1. I have found that having separate workspaces, where Project B1 is not in the current workspace for solution A, helps a lot here. (Just be careful not to check in your solution with Project B1 included, or other people getting the solution may get wierd errors.)

    As far as not being considered the same project for debugging purposes, make sure you are referencing the correct configuration/architecture files, that they were build with debugging on, and that the pdb files are available. As long as the source files are in the same folder locations that they were when the dll was built, VS should find them. You don't even need the project to be in the solution for this to work, VS will find the source files as long as they are available. Adding the projects to the solution gives you the extra navigation, intellisense, etc. though, so I'd definitely go that route.

    Worst case, try changing the Project A1 reference to be a project-level reference temporarily. Again, don't check your solution in this way but its a quick way to get the debugging process to work correctly.