当我创建 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 配置相邻的位置,那么您会发现您的项目可以为这两个平台正确构建。
https://stackoverflow.com/questions/5931317/