![](/img/trans.png)
[英]Unable to compile vdproj with devenv - 'targeting 'x64' is not compatible with the project's target platform 'x86''
[英]WiX x64 platform target
当我创建一个WiX项目并尝试在平台设置为“x64”的情况下构建它时,我在构建输出中收到如下错误:
------ Build started: Project: MyProject, Configuration: Release x64 ------
C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\wix2010.targets(444,7): error : The OutputPath property is not set for this project. Please check to make sure that you have specified a valid Configuration/Platform combination. Configuration='Release' Platform='x64'
Done building project "MyProject.wixproj" -- FAILED.
------ Build started: Project: MyProject, Configuration: Debug x64 ------
C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\wix2010.targets(444,7): error : The OutputPath property is not set for this project. Please check to make sure that you have specified a valid Configuration/Platform combination. Configuration='Debug' Platform='x64'
Done building project "MyProject.wixproj" -- FAILED.
它声称没有为项目设置输出路径,但当然有。 输出路径设置为bin\\x64\\Debug\\
用于调试配置, bin\\x64\\Release\\
用于发布配置。 那么错误是什么?
此外,错误不会显示在“错误”窗口中。 现在,我知道责怪编译器是一个新手错误,但我开始怀疑......这是一个构建工具错误,还是我错过了一些愚蠢的东西?
如果您在文本编辑器中打开 .wixproj 文件,您将看到您的 x64 配置项位于文件底部(在标准 WiX 构建目标的导入下方),而您的 x86 配置位于顶部(在导入上方) )。 如果您将 x64 配置的 XML 转换为与 x86 配置相邻,那么您会发现您的项目可以为两个平台正确构建。
我遇到过同样的问题。 但是,就我而言,wixproj 文件格式不正确,但是
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
完全失踪了。 刚刚复制了 x86 配置,保存,一切都很好。
首先确保您使用的是最新版本的 WiX 工具集(v3.5 或当前的 v3.6 drop)。 如果这仍然在那里重现,那听起来像是一个错误。 请在此处提交:http ://sourceforge.net/tracker/?group_id=105970&atid=642714
警告:WiX 可以在不同的 <PropertyGroup> 中插入多个 this 实例:
<DefineConstants>Foo=Bar</DefineConstants>
<DefineConstants>Foo=</DefineConstants>
从而覆盖您想要的设置。 您需要手动仔细编辑 .WIXPROJ 文件并注意重复项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.