简体   繁体   中英

Build both 32 and 64 bit at the same time using Visual Studio

I have an application that works really well in 64 bit architectures, but not quite so well in 32 bit architectures. However, we want to be able to support both architectures.

I am aware of the "Any CPU" option, but we actually want two versions of the software that are explicitly 32 or 64 bit.

I can set the properties to 32 bit, build it, copy the files out of the bin/debug folder and then repeat with 64 bit, but this is a real bore every time we build the application and have to send out both versions to QA.

Is there a way that we can get Visual Studio to automatically build both 32 and 64 bit into two separate folders?

You can use the BuildBatch Build option of Visual Studio:

在此处输入图片说明

You can create two independent solution configurations, say x86 and x64, and set different output path and platform target for each configuration.

So you will need to select the first configuration, build the solution, select the second, and build again.

Or you can use batch build with both configurations checked.

It's not exactly "at the same time", but you can simply create separate 32-bit and 64-bit solution configurations, and build the solution in both configurations, either from Visual Studio or from the command prompt (with msbuild /p:Configuration=<config name> ). The generated executables will be placed in a configuration-specific directory, so the second build won't overwrite the first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM