简体   繁体   English

使用Visual Studio同时生成32位和64位

[英]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. 我有一个在64位体系结构中确实能很好运行的应用程序,但在32位体系结构中却不是很好。 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. 我知道“任何CPU”选项,但是我们实际上希望软件的两个版本分别是32位或64位。

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. 我可以将属性设置为32位,进行构建,然后将文件从bin / debug文件夹中复制出来,然后以64位进行重复,但是每次构建应用程序并将这两个版本都发送给质量检查人员时,这确实很无聊。

Is there a way that we can get Visual Studio to automatically build both 32 and 64 bit into two separate folders? 有没有一种方法可以使Visual Studio自动将32位和64位生成到两个单独的文件夹中?

You can use the BuildBatch Build option of Visual Studio: 您可以使用Visual Studio的BuildBatch Build选项:

在此处输入图片说明

You can create two independent solution configurations, say x86 and x64, and set different output path and platform target for each configuration. 您可以创建两个独立的解决方案配置,例如x86和x64,并为每个配置设置不同的输出路径和平台目标。

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> ). 这并非完全 “同时”,但您可以简单地创建单独的32位和64位解决方案配置,并通过Visual Studio或命令提示符(使用msbuild /p:Configuration=<config name>在两种配置中构建解决方案。 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. 生成的可执行文件将放置在特定于配置的目​​录中,因此第二个版本不会覆盖第一个版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2010/2012:32位还是64位? - Visual Studio 2010/2012: 32 or 64 bit? 使用单个Visual Studio解决方案同时为C ++ / CLI项目构建x86和x64 - Use a single Visual Studio solution to build both x86 and x64 at the same time for C++/CLI project Visual C#Express:在64位上构建,在32位上部署? - Visual C# Express : Build on 64 bit, deploy on 32 bit? 使用Visual Studio运行引用32位dll的64位程序-C# - Running a 64bit program referencing a 32bit dll using visual studio - C# Visual Studio 2017在64位系统上以32位编译吗? - Visual Studio 2017 compiles in 32bit on 64 bit system? 为什么在32位和64位OS上为任何CPU生成Visual Studio都会产生不同的浮点结果? - Why does Visual Studio build for Any CPU gives different floating point results on 32bit and 64bit OS? 从同一个项目编译32位和64位? - Compile both 32 and 64 bit from the same projects? 同时编译32位和64位项目 - Compile 32bit and 64bit projects at the same time 在64位和32位安装程序(高级安装程序)上的Visual Studio Crystal Reports - Visual Studio Crystal Reports on 64 and 32 bit installer (advance installer) ODAC 64位+ Visual Studio 2010 + ODAC 32位(在VM中) - ODAC 64bit + Visual Studio 2010 + ODAC 32bit(In VM)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM