如何强制的MSBuild编译为32位模式? [英] How do I force MSBuild to compile for 32-bit mode?

查看:838
本文介绍了如何强制的MSBuild编译为32位模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的MSBuild(通过恶性)编制了一堆的VB.NET 组件。因为这些组件依赖于COM互操作,我需要保证他们在32位模式下在64位操作系统的运行。我可以得到可执行组件通过改变在Visual Studio项目编译为32位,但是我真的希望能够迫使所有的可执行文件被编译到构建服务器上的32位模式。

I'm using MSBuild (via NAnt) to compile a bunch of VB.NET assemblies. Because these assemblies depend on COM Interop, I need to guarantee that they run in 32-bit mode on 64 bit OS's. I can get the executable assemblies to compile to 32-bit by changing the project in Visual Studio, but I'd really like to be able to force all of the executables to be compiled to 32 bit mode on the build server.

我已经尝试了一些命令行参数的MSBuild没有运气:

I've tried a number of command-line parameters to MSBuild with no luck:

  • / P:平台=的win32
  • / P:平台= 86
  • / P:的ProcessorArchitecture = 86

我是什么做错了吗?有一些参考编译VB项目时所使用的MSBuild的属性?

What am I doing wrong? Is there some reference to the properties that MSBuild uses when compiling VB projects?

推荐答案

如果该组件本身总是会为32位,为什么不设置添加到.vbproj文件?这将需要的MSBuild的方程。

If the assemblies themselves are always going to be 32 bit, why not add the setting to the .vbproj file? That will take MSBuild out of the equation.

只要把下面一行添加到初始的PropertyGroup在.vbproj文件

Just add the following line to the initial PropertyGroup in the .vbproj file

<PlatformTarget>x86</PlatformTarget>

这篇关于如何强制的MSBuild编译为32位模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆