问题描述
无论何时执行此命令,它都会引发错误MSB3073,代码为9009
Whenever I execute this command it throws error MSB3073 with code 9009
$(WixPath)heat dir $(Publish) -dr INSTALLFOLDER -ke -srd -cg DatoCheckerWebComponents -var var.publishDir -gg -out $(WebSiteContentCode)
整个构建文件在这里:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebSiteSource>..\DatoCheckerMvc\</WebSiteSource>
<SetupF>..\Setup\</SetupF>
<PublishF>publish\</PublishF>
<Publish>$(SetupF)$(PublishF)</Publish>
<WebSiteContentCode>WebSiteContent.wxs</WebSiteContentCode>
</PropertyGroup>
<!-- Defining group of temporary files which is the content of the web site. -->
<ItemGroup>
<WebSiteContent Include="$(WebSiteContentCode)" />
</ItemGroup>
<!-- The list of WIX input files -->
<ItemGroup>
<WixCode Include="Product.wxs" />
<WixCode Include="$(WebSiteContentCode)" />
</ItemGroup>
<Target Name="Build">
<!-- Compile whole solution in release mode -->
<MSBuild
Projects="..\DatoCheckerMvc.sln"
Targets="ReBuild"
Properties="Configuration=Release" />
</Target>
<Target Name="PublishWebsite">
<!-- Remove complete publish folder in order to be sure that evrything will be newly compiled -->
<Message Text="Removing publish directory: $(SetupF)"/>
<RemoveDir Directories="$(SetupF)" ContinueOnError="false" />
<Message Text="Start to publish website" Importance="high" />
<MSBuild
Projects="..\\DatoCheckerMvc\DatoCheckerMvc.csproj"
Targets="ResolveReferences;_CopyWebApplication"
Properties="OutDir=$(Publish)bin\;WebProjectOutputDir= $(Publish);Configuration=Release" />
</Target>
<Target Name="Harvest">
<!-- Harvest all content of published result -->
<Exec Command='$(WixPath)heat dir $(Publish) -dr INSTALLFOLDER -ke -srd -cg DatoCheckerWebComponents -var var.publishDir -gg -out $(WebSiteContentCode)'
ContinueOnError="false"
WorkingDirectory="." />
</Target>
</Project>
我用来调用此构建的命令是:
The command I use to call this build is:
msbuild /t:Build;PublisWebsite;Harvest setup.build
我该怎么办?
推荐答案
从cmd退出代码9009基本上意味着未找到命令".换句话说,$(WixPath)heat
并不指向可执行文件,这可能是因为我在所示代码中的任何地方都没有看到WixPath属性.一种快速的调试方法是使用Message
任务,该任务的参数与Exec
相同,因此您可以确切地看到正在尝试执行的内容.
Exit code 9009 from cmd basically means 'command not found'. In other words $(WixPath)heat
doesn't point to something executable, which is possible cause I don't see a property WixPath anywhere in the code shown. A quick way to debug this is use a Message
task with the same argumenst as for Exec
so you can see exactly what is trying to execute.
<Message Text='$(WixPath)heat dir $(Publish) -dr INSTALLFOLDER ....'/>
将输出粘贴到命令行上,运行并检查其是否执行.
The paste the output on the command line, run it and check if it executes.
这篇关于MSB3073“命令"已退出,代码为9009的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!