MSB3073 'command' exited with code 9009

匿名 (未验证) 提交于 2019-12-03 02:18:01

问题:

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) 

The entire build file is here:

<?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 

What am I supposed to do?

回答1:

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.



回答2:

I changed the command like below as I use VS2010 with Wix 3.8 and it worked.

Command='"$(WiX)bin\heat.exe" dir $(Publish) -dr INSTALLFOLDER -ke -srd -cg DatoCheckerWebComponents -var var.publishDir -gg -out $(WebSiteContentCode)' 

The problem for me is the heat.exe cannot be found with the following directory.



回答3:

Maybe you have spaces in WixPath? Try adding quotations:

<Exec Command='&quot;$(WixPath)heat&quot; ...'     ContinueOnError="false"     WorkingDirectory="." /> 


回答4:

Run with /v:diag /fl to up the verbosity and log to msbuild.log file, find the Exec trace and confirm that command completes successfully with all the parameters evaluated by running it manually. All the accumulated values (system & user env vars, cli overrides, parameter groups, etc) will be traced at the beginning of the dump (but not logged to file), the end would look something like below.

<Exec Command="$(SystemRoot)\foo bar" />

Using "Exec" task from assembly "Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Task "Exec"   Task Parameter:Command=C:\Windows\foo bar   C:\Windows\foo bar   'C:\Windows\foo' is not recognized as an internal or external command,   operable program or batch file. C:\Users\Ilya.Kozhevnikov\Dropbox\foo.build(3,3): error MSB3073: The command "C:\Windows\foo bar" exited with code 9009. 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!