Trey Gourley
Trey Gourley

Reputation: 401

Visual Studio 2017 Debug Multiple Instances of the Same Project

I have created a single command line application that handles different jobs per a command line argument. For instance, the "-w" starts a web project and "-c" runs a simple command line process.

Sometimes these two projects have to speak with each other. For instance, I start one instance with "-w" and an API web application launches. I start a second instance with "-c" and a command line application connects via API and processes some returned data.

I understand that I can debug multiple different projects at the same time, but is there a way to debug multiple instances of the SAME project in Visual Studio?

Upvotes: 1

Views: 4730

Answers (2)

StPiere
StPiere

Reputation: 4263

If you want to pass different startup arguments to each instance, than you can do following:

For each instance you want to run:

  1. Add New Empty Project to the same Solution

  2. Under Project Properties -> Debugging specify

    • Command -> for example absolute path to the project .exe
    • Command Arguments
    • eventually other options like working dir , etc.
  3. Under Solution Properties choose Multiple startup projects and select projects you want to Debug at the same time

Now if you hit F5 you can debug all projects you want eventually some multiple instances with specific command line arguments for each one.

Upvotes: 1

MikeH
MikeH

Reputation: 4395

Yes:

  1. Debug your program normally to get the first instance
  2. Right click on your project in Solution Explorer and select Debug -> Start New Instance

You can also launch other programs in your solution as well.

Upvotes: 4

Related Questions