2

I would like to debug a same C# console project from two different instances of Visual Studio to increase my productivity, as the edit-and-continue mode is not always enough, to say the least.

I have no problem opening the solution twice, and debugging different projects concurrently, but when I try debugging the same project twice, it expectedly fails as it cannot replace the executables in the bin folders.

The possibility to debug twice from the same instance of the IDE as explained here is very welcome, but not good enough for me as I want to be able to completely edit my code when needed.

Is there any simple way to achieve this? Thanks!

0

2 Answers 2

2

Instead of clicking Debug or hitting F5, open a command prompt and start the number of instances you want from there. Now start as few or as many Visual Studio instances you want and go to the debug -> Attach... window.

In the Attach to process window, find the instance youw ant to debug and choose attach. This will allow you to attach to as many instances of your applciation as you'd want.

Attach to process window

Now, if you want to be able to edit these application son the fly and spin up new instances, that isn't possible because, as you've found out, the executable will eb in use. Short of creating multuiple copies of your output directory and always starting a copy, never the original, you have no way to achieve that.

Sign up to request clarification or add additional context in comments.

Comments

2

Just as a note for whoever stumbles upon this page, as it's ranked very high on Google:

If you want to debug two instances of the same program in Visual Studio, this is as simple as opening up two instances of visual studio and pressing f5 in each instance. This works remarkably well, although you want to wait until one program is up and running before you start the second - otherwise you may get conflicts in your bin folder (which is what it seems OP didn't do.)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.