gpt4 book ai didi

visual-studio - NAnt 中的 msbuild 任务不会在 Prebuild 中编译 WiX 项目

转载 作者:行者123 更新时间:2023-12-05 09:23:27 29 4
gpt4 key购买 nike

此 WiX 安装项目在 Visual Studio 中编译没有问题。

但是,使用 msbuild 任务在 NAnt 中运行它会显示以下错误。

Heat Prebuild 事件:

"$(SolutionDir)\App_Tools\WiX Toolset v3.8\bin\heat.exe" dir "$(SolutionDir)\App_Shell \bin\$(ConfigurationName)" -dr "AppDirectory" -cg "AppComponentGroup" -t   "$(ProjectDir)Filter.xslt" -gg -g1 -sf -srd -sreg -var "var.AppAppPath" -out   "$(ProjectDir)\App_HarvestedHeatFile.wxs"  

msbuild 任务:

<msbuild project="App_Installers\App.Setup\App.Setup.wixproj">
<property name="Configuration" value="Release"/>
<property name="target" value="Rebuild"/>
<property name="verbosity" value="Normal"/>
</msbuild>

错误消息预构建:

  [msbuild] Build started 03.02.2014 15:38:35.
[msbuild] Project "E:\Projects\Company\App\Development\trunk\src\App_Inst
allers\App.Setup\App.Setup.wixproj" on node 1 (default targets).
[msbuild] AssignCultures:
[msbuild] Culture: en-US
[msbuild] Culture: de-DE
[msbuild] PreBuildEvent:
[msbuild] "*Undefined if not building a solution or within Visual Studio*\App_Tools\WiX Toolset v3.8\bin\heat.exe" dir "*Undefined if not building a soluti
on or within Visual Studio*\App_Shell\bin\Release" -dr "AppDirectory" -cg "AppComponentGroup" -t "E:\Projects\Company\App\Development\trunk\src\App_Inst
allers\App.Setup\Filter.xslt" -gg -g1 -sf -srd -sreg -var "var.AppAppPath" -ou
t "E:\Projects\Company\App\Development\trunk\src\App_Installers\App.Setup\
\App_HarvestedHeatFile.wxs"
[msbuild] The system cannot find the path specified.
[msbuild] C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\wix2010.targets(81
6,5): error MSB3073: The command ""*Undefined if not building a solution or with
in Visual Studio*\App_Tools\WiX Toolset v3.8\bin\heat.exe" dir "*Undefined if n
ot building a solution or within Visual Studio*\App_Shell\bin\Release" -dr "AppDirectory" -cg "AppComponentGroup" -t "E:\Projects\Company\App\Development
\trunk\src\App_Installers\App.Setup\Filter.xslt" -gg -g1 -sf -srd -sreg -var "
var.AppAppPath" -out "E:\Projects\Company\App\Development\trunk\src\App_In
stallers\App.Setup\\App_HarvestedHeatFile.wxs"" exited with code 3. [E:\Projec
ts\Company\App\Development\trunk\src\App_Installers\App.Setup\App.Setup.w
ixproj]
[msbuild] Done Building Project "E:\Projects\Company\App\Development\trunk
\src\App_Installers\App.Setup\App.Setup.wixproj" (default targets) -- FAILED.

[msbuild]
[msbuild] Build FAILED.
[msbuild]
[msbuild] "E:\Projects\Company\App\Development\trunk\src\App_Installers\R
oCo.Setup\App.Setup.wixproj" (default target) (1) ->
[msbuild] (PreBuildEvent target) ->
[msbuild] C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\wix2010.targets(
816,5): error MSB3073: The command ""*Undefined if not building a solution or wi
thin Visual Studio*\App_Tools\WiX Toolset v3.8\bin\heat.exe" dir "*Undefined if
not building a solution or within Visual Studio*\App_Shell\bin\Release" -dr "R
oCoDirectory" -cg "AppComponentGroup" -t "E:\Projects\Company\App\Developme
nt\trunk\src\App_Installers\App.Setup\Filter.xslt" -gg -g1 -sf -srd -sreg -var
"var.AppAppPath" -out "E:\Projects\Company\App\Development\trunk\src\App_
Installers\App.Setup\\App_HarvestedHeatFile.wxs"" exited with code 3. [E:\Proj
ects\Company\App\Development\trunk\src\App_Installers\App.Setup\App.Setup
.wixproj]
[msbuild]
[msbuild] 0 Warning(s)
[msbuild] 1 Error(s)
[msbuild]
[msbuild] Time Elapsed 00:00:00.10

BUILD FAILED

最佳答案

在您的情况下,问题出在 $(SolutionDir) 属性上,而不是您的预处理器。问题是属性 $(SolutionDir) 没有被定义,这就是错误的原因。 MSBuild 未定义 SolutionDir 属性,因此您需要手动指定它:

msbuild.exe /p:SolutionDir=

是否使用 VS 正确评估了预处理器变量 (AppAppPath)?我在想你需要做这样的事情来获得正确的值(value): http://www.ageektrapped.com/blog/setting-properties-for-wix-in-msbuild/

关于visual-studio - NAnt 中的 msbuild 任务不会在 Prebuild 中编译 WiX 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21530378/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com