One project with multiple build configurations in VS2010?

I have a C # windows application project. I want to create two .exe files, one of which runs as 64-bit on a 64-bit OS (targeting the Any processor platform), the other runs as a 32-bit version on a 64-bit OS (using x86 platform targeting )

Currently, I have to change the assembly configuration when I need a different configuration, and rename the compiled file to distinguish between 32 and 64.

Is there an easier way to manage multiple configurations?

+4
source share
2 answers

Create a 32-bit assembly and a 64-bit assembly. This will allow you to place them in different folders.

Right-click on the solution, select "Configuration Manager" In the Active Solution configuration, select "new", Call 32-bit assembly Select the 32-bit option in the CPU drop-down list.

Repeat and name it a 64-bit build.

Now, when you complete the assembly, it will go to C: \ Development \ ProjectName \ Bin \ 32-Bit Build \ programname.exe or similar for 64 bits

+3
source

You can use a batch file to create a project. The file will use MSBuild and pass the target platform as a parameter. The property attribute will look like this:

Properties="Configuration=Debug;Platform=Any CPU" Properties="Configuration=Debug;Platform=x86" 

Take a look at a few samples

MSBuild Task Configuration Property MSBuild: Platform Defining Issues for Child Buildings

For the MSBuild Tutorial, see MSBuild Tutorials

+1
source

All Articles