Thursday, January 31, 2013

Visual Studio: Multiple Startup Projects

I’ve been using Visual Studio for over 10 years, but still keep on learning new tricks. That’s because I learn things very slowly dear reader! Today’s ‘wow, I didn’t know you could do that moment’, was finding out that it’s possible to launch multiple startup projects when one hits F5 – or Control-F5 in this case.

My scenario is that I’m writing a little spike for a distributed application. Each of my services is implemented as a console app. During development, I want to run integration tests where the services all talk to each other, so before running the tests I want to run all the services. Now I’m used to right-clicking on a project and choosing ‘Set as startup project’, but you can’t select multiple projects this way and it’s very tedious to launch multiple projects by going to each one in turn, setting it as the startup project, and then hitting ctrl-F5. What I didn’t know is that you can right click on the Solution node, select ‘Set Startup Projects’ and you get this dialogue:


You can then select multiple startup projects and choose any number of them to ‘Start without debugging’.

Now I can hit ctrl-F5 and all my little services start up. Wonderful.


Harry McIntyre said...

Out of interest, how do you deploy them? Do you install them as services using NSSM or similar?

Mike Hadlow said...

Harry, thanks for pointing me at NSSM, it looks like a very interesting project. I was a big fan of MassTransit, but now I like the idea of the service hosting not being coupled to the program.

This project is simply a spike for a few ideas and not intended for production (hey, but that's what they always say isn't it).

Rutland Gizz said...

Thanks dude.