Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Msbuild MSB3073';命令';已退出,代码为9009_Msbuild_Wix_Command Prompt - Fatal编程技术网

Msbuild MSB3073';命令';已退出,代码为9009

Msbuild MSB3073';命令';已退出,代码为9009,msbuild,wix,command-prompt,Msbuild,Wix,Command Prompt,每当我执行此命令时,它都会抛出错误MSB3073,代码为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 ToolsVersi

每当我执行此命令时,它都会抛出错误MSB3073,代码为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>

我该怎么办?

cmd的退出代码9009基本上表示“未找到命令”。换句话说,
$(WixPath)heat
没有指向可执行的内容,这可能是因为我在显示的代码中没有看到WixPath属性。一种快速的调试方法是使用与
Exec
具有相同参数的
消息
任务,这样您就可以准确地看到试图执行的内容

<Message Text='$(WixPath)heat dir $(Publish) -dr INSTALLFOLDER ....'/>


将输出粘贴到命令行上,运行它并检查它是否执行。

使用
/v:diag/fl
运行以增加详细信息并记录到
msbuild.log
文件,找到
Exec
跟踪,并通过手动运行来确认命令成功完成,所有参数均已评估。所有累积值(系统和用户环境变量、cli覆盖、参数组等)都将在转储开始时进行跟踪(但不会记录到文件),结束时如下图所示


当我将VS2010与WIX3.8一起使用时,我更改了如下命令,并且它工作正常

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

我的问题是在以下目录中找不到heat.exe。

也许您在
WixPath
中有空格?尝试添加报价:

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

Command='"$(WiX)bin\heat.exe" dir $(Publish) -dr INSTALLFOLDER -ke -srd -cg DatoCheckerWebComponents -var var.publishDir -gg -out $(WebSiteContentCode)'
<Exec Command='&quot;$(WixPath)heat&quot; ...'
    ContinueOnError="false"
    WorkingDirectory="." />