Running two projects at once in Visual Studio
Asked Answered
L

2

379

I created a solution in Visual C# 2010 Express that contains two projects: one is the client, the other is the server. I would like to debug both at the same time, but I can only seem to run one of the projects during debugging.

Is there a way to run both at once?

Liturgy answered 3/10, 2010 at 13:54 Comment(0)
M
663

Go to Solution properties → Common PropertiesStartup Project and select Multiple startup projects.

Solution properties dialog

Moorehead answered 3/10, 2010 at 14:1 Comment(5)
BTW. Projects can also be started for debugging from Solution Explorer. In Solution Explorer right click on the project, then Debug-> Start new Instance. So with one instance of VS one can debug loads of instances at once.Moorehead
@Moorehead - In the express editions. "In Solution Explorer right click on the project, then Debug-> Start new Instance.", doesn't work, but your original answer does. FWIWWalliw
Works in VS 2015 CE as well.Searching
Can't get this to work for web projects in VS 2015 update 2 & 3Charlean
the mentioned menu is seen for MVC or even DLL projects but not for web site projects.Ochlophobia
E
150

Max has the best solution for when you always want to start both projects, but you can also right click a project and choose menu DebugStart New Instance.

This is an option when you only occasionally need to start the second project or when you need to delay the start of the second project (maybe the server needs to get up and running before the client tries to connect, or something).

Earthshaker answered 5/10, 2010 at 20:2 Comment(1)
As Kevin said using Debug > Start New Instance. can be helpful for to start project at demand, but an other interesting use is to start 2 (or more) instances of the same project. can debug 1 server and 2 clients by example.Aloise

© 2022 - 2024 — McMap. All rights reserved.