5

I have two .NET Core 2.0 projects, both in the same solution. A Web API project and a Web ASP.NET MVC project. The ASP.NET MVC projects consumes the Web API project.

Is it possible to debug both projects in Visual Studio at the same time or do I need to run one from the command line using dotnet.exe and debug the other?

I would like to end up being able to debug both, place breakpoints in both and for Visual Studio to jump between projects while debugging.

NB: This is in Visual Studio 2017, not Visual Studio Code.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user3213045
  • 159
  • 1
  • 10
  • I've never actually tried this, but you can set multiple startup projects. I believe that's what it's for. – Ferruccio Oct 07 '17 at 10:31
  • I read that somewhere already but if I select a different project as startup it deselects my original. Also if I select two projects at the same time I don't have an option for setting as startup. – user3213045 Oct 07 '17 at 10:34
  • Right-click on the solution, not the project then click on "Select Startup Projects..." – Ferruccio Oct 07 '17 at 10:40
  • Got it, works now thanks. If you put that in as an answer I can accept. – user3213045 Oct 07 '17 at 10:59
  • 1
    Possible duplicate of [Running two projects at once in Visual Studio](https://stackoverflow.com/questions/3850019/running-two-projects-at-once-in-visual-studio) – CodeCaster Oct 07 '17 at 11:22

1 Answers1

12

In Visual Studio you can set multiple startup projects to run/debug two projects at once:

  1. Right click on the solution in the Solution Explorer and select Properties.
  2. Under Common Properties\Startup Project select Multiple startup projects and set the Action to be Start for the two projects that you want to debug.
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
bergmeister
  • 949
  • 2
  • 10
  • 16