C# 获取错误candle.exe:错误CNDL0103:系统找不到文件';Product.wxs';类型为';来源';

C# 获取错误candle.exe:错误CNDL0103:系统找不到文件';Product.wxs';类型为';来源';,c#,visual-studio,wix,ieaddon,wix3.10,C#,Visual Studio,Wix,Ieaddon,Wix3.10,我正在使用最新版本的wix v3.10.3,同时执行以下命令: D:\File_Transfer\11-Nov-16\internetexplorer\2000\INTERNET_EXPLORER_SRC>call "C:\Program Files (x86)\WiX Toolset v3.10\bin\candle.exe" -sw1076 -sw1072 -dDebug -d"ADX_PATH=C:\Program Files (x86)\Add-in Express\Add-in

我正在使用最新版本的wix v3.10.3,同时执行以下命令:

D:\File_Transfer\11-Nov-16\internetexplorer\2000\INTERNET_EXPLORER_SRC>call "C:\Program Files (x86)\WiX Toolset v3.10\bin\candle.exe" -sw1076 -sw1072 -dDebug -d"ADX_PATH=C:\Program Files (x86)\Add-in Express\Add-in Express .NET for Internet Explorer\\" -d"DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\\" -d"SolutionDir=D:\File_Transfer\11-Nov-16\internetexplorer\2000\INTERNET_EXPLORER_SRC\PMP\\" -dSolutionExt=.sln -dSolutionFileName=PMP.sln -dSolutionName=PMP -d"SolutionPath=D:\File_Transfer\11-Nov-16\internetexplorer\2000\INTERNET_EXPLORER_SRC\PMP\PMP.sln" -dConfiguration=Release -dOutDir=bin\Release\ -dPlatform=x86 -d"ProjectDir=D:\File_Transfer\11-Nov-16\internetexplorer\2000\INTERNET_EXPLORER_SRC\PMP\PMPSetup\1.0.0\\" -dProjectExt=.wixproj -d"ProjectFileName=PMPSetup(1.0.0).wixproj" -d"ProjectName=PMPSetup(1.0.0)" -d"ProjectPath=D:\File_Transfer\11-Nov-16\internetexplorer\2000\INTERNET_EXPLORER_SRC\PMP\PMPSetup\1.0.0\PMPSetup(1.0.0).wixproj" -d"TargetDir=D:\File_Transfer\11-Nov-16\internetexplorer\2000\INTERNET_EXPLORER_SRC\PMP\PMPSetup\1.0.0\bin\Release\\" -dTargetExt=.msi -d"TargetFileName=PMPSetup(1.0.0).msi" -d"TargetName=PMPSetup(1.0.0)" -d"TargetPath=D:\File_Transfer\11-Nov-16\internetexplorer\2000\INTERNET_EXPLORER_SRC\PMP\PMPSetup\1.0.0\bin\Release\PMPSetup(1.0.0).msi" -dPMP.Configuration=Release -d"PMP.FullConfiguration=Release|AnyCPU" -dPMP.Platform=AnyCPU -d"PMP.ProjectDir=D:\File_Transfer\11-Nov-16\internetexplorer\2000\INTERNET_EXPLORER_SRC\PMP\\" -dPMP.ProjectExt=.csproj -dPMP.ProjectFileName=PMP.csproj -dPMP.ProjectName=PMP -d"PMP.ProjectPath=D:\File_Transfer\11-Nov-16\internetexplorer\2000\INTERNET_EXPLORER_SRC\PMP\PMP.csproj" -d"PMP.TargetDir=D:\File_Transfer\11-Nov-16\internetexplorer\2000\INTERNET_EXPLORER_SRC\PMP\bin\Release\\" -dPMP.TargetExt=.dll -dPMP.TargetFileName=PMP.dll -dPMP.TargetName=PMP -d"PMP.TargetPath=D:\File_Transfer\11-Nov-16\internetexplorer\2000\INTERNET_EXPLORER_SRC\PMP\bin\Release\PMP.dll" -out obj\\Release\ -arch x86 -ext "C:\Program Files (x86)\WiX Toolset v3.10\bin\\WixNetFxExtension.dll" Product.wxs StandardUI.wxs 
我得到以下错误:

candle.exe : error CNDL0103 : The system cannot find the file 'Product.wxs' with type 'Source'.
当我使用VisualStudio编译时,我没有得到任何错误,构建成功。而通过命令提示符,我得到了上面的错误


有人能建议如何解决这个问题吗?

从Product.wxs和Product.wixobj文件所在的文件夹运行批处理文件。 让我们将批处理文件命名为installer.bat

使用以下命令编辑installer.bat:

candle Product.wxs 
light Product.wixobj
@pause
将installer.bat文件复制到Product.wxs文件所在的setupproject文件夹以及其他bin和obj文件夹中。 运行installer.bat文件。 希望这对你有用


谢谢

candle.exe
似乎在解析以反斜杠结尾的引用命令行参数时遇到问题。例如,更改此选项:

-d"ADX_PATH=C:\Program Files (x86)\Add-in Express\Add-in Express .NET for Internet Explorer\\"
致:

在您提供的命令中,同一问题存在于多个位置

我使用的宏如下所示:

-d"BinariesDir=$(OutputPath)"
我不得不改成:

-d"BinariesDir=$(OutputPath)."

因此,当它们展开时,它们不会以
\

结尾。这可能是指product.wxs中的某个空片段

像 在product.wxs中

!--<Feature Id="F_UpdateConnectionString" Title="Updating ConnectionString" Description="Update the Connection String" Level="1">
      <ComponentRef Id="SetConfigurationValues" />
    </Feature>-->

 and insidefragment 

<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
      <Component Id="SetConfigurationValues" Guid="03D1E734-464F-4A2D-B385- 
  42DECB86C557">

  </Component>
    </DirectoryRef>
</Fragment>
--
-->
内陷

在这里,我们可以看到组件必须要成功构建。

使用相对路径而不是绝对路径我想这是希望Product.wxs文件位于
D:\file\u Transfer\11-Nov-16\internetexplorer\2000\internetexplorer\u SRC
中。是在那里吗?
!--<Feature Id="F_UpdateConnectionString" Title="Updating ConnectionString" Description="Update the Connection String" Level="1">
      <ComponentRef Id="SetConfigurationValues" />
    </Feature>-->

 and insidefragment 

<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
      <Component Id="SetConfigurationValues" Guid="03D1E734-464F-4A2D-B385- 
  42DECB86C557">

  </Component>
    </DirectoryRef>
</Fragment>