Home > Mobile >  How do I debug a referenced solution in Visual Studio?
How do I debug a referenced solution in Visual Studio?

Time:11-30

I have two solutions in Visual Studio. Solution A is my website and Solution B is just a reference in Solution A. However a function from Solution B is throwing an error when I call it in Solution A. However since it is complied code I can't actually step through the function.

My question, since I have access to Solution B in Visual Studio, how do I connect the two solutions so I can step through and see what is happening?

CodePudding user response:

either by logging or if you can add the project into solution A.

or if it an API(REST or Services) just run both solutions same time and refer the local URL to your Application

you can do this by following the below Article from MSDN

https://learn.microsoft.com/en-us/visualstudio/ide/managing-references-in-a-project?view=vs-2022

CodePudding user response:

Think of a Solution in Visual Studio as a collection of Projects, along with build instructions. Typically something like Solution B that provides a library on which other apps depend will include a Project in the Solution that is a small app for testing the Project assembly you actually want.

So debugging a problem with a Solution B assembly from Solution A involves adding logging to Solution A, so you can capture what kind of inputs you are providing to the Solution B assembly. Then you can load Solution B and use those inputs with the testing Project, so you can step through and debug as needed.

Alternatively, you can copy just the Project(s) you care about in Solution B and make it part of Solution A. Since the solution file itself is just a text file, this can be done with creative use of source control in such a way that the Project(s) in question only needs to live in source control once, and both Solutions can grab it and commit to it as needed.

  • Related