Typically, when debugging in Visual Studio, the selected StartUp project will be executed in debug mode. In your case, you need to run and debug both the web API project and the WinForms project. You can do this by right-clicking in the solution explorer and selecting Install StartUp Projects . A dialog box opens in which you can select Multiple launch projects , and then choose which projects to run when debugging a solution.

Another option is to have one StartUp project (a web API project, since it is a requirement to run another project). Then you can right-click the WinForms project in the solution explorer and select Debug → Start New Instance . You can do this several times to debug multiple instances of the same project.
Obviously, you can always attach a debugger to any running process, and if your web API is deployed using IIS, it will already be running. Using the procedure described above, Visual Studio joins the correct workflow.
Martin liversage
source share