views:

650

answers:

4

I have a source base that, depending on defined flags at build time, creates two different apps. I can build both of these apps using a Makefile by specifying two different targets, one that compiles with a flag and one that compiles without, and having an aggregate target that builds both.

How do I do the equivalent thing from Visual C# Express on Windows?

+2  A: 

Create one solution with two project files in the same folder. Set two different configurations in your solution, one of them building one of the projects, the other one building the other project.

Alternatively, you can have one project which always builds to intermediate binary and then have a postbuild step that copies it to the final binary depending on the flag.

Franci Penov
One solution with two project files isn't perfect, but it's darn near close.
Jim Puls
A: 

Release vs Debug? You can create your own custom configurations as well. But building a completely different app based on the configuration seems like a bad idea.

Normal visual studio can have multiple projects in one solution, and I think there's a way to shoe-horn this into Express edition (perhaps by opening a solution created elsewhere).

Really,though, you may have to settle for keeping two instances of Visual Studio open at at a time. You can always set one of them to build right into the /bin/Release/ folder of the other project if you want.

Joel Coehoorn
I don't want to build different apps in different configurations, I want to build two apps in Release and two in Debug.
Jim Puls
A: 

I don't know exactly about Express versions, but in Visual Studio there is a menu item Build->Batch Build to build all configurations at once.


I don't find visual studio easy to work with when I have complex build output scenario's. What I typically do in these situations is use NAnt with a continuous integration tool like CruiseControl.Net. You can also build the project outputs locally with the same NAnt script.

A NAnt script is essentially an Xml build file with heaps more functionality.

Robert Paulson
A: 

how to run a build project from other project in C#