在bundle.wxs中我试图设置一个自定义变量,它基于正在构建的配置:
<Variable Name="SETTINGPROVIDERURL" Value="$(var.siteloc)"/>
我正试图设置&#34; siteloc&#34;在属性&gt; VS2017项目中的构建选项卡。我正在尝试预处理器和wix变量,以获得至少一个来通过。
在wixproj文件中,我可以看到:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<WixVariables>siteloc=bar;</WixVariables>
<DefineConstants>siteloc=foo;</DefineConstants>
</PropertyGroup>
当我构建时,我得到CNDL0150:未定义的预处理器变量&#39; $(var.siteloc)&#39;。如您所见,我的变量(任一个)未作为参数添加到VS控制台中的蜡烛:
2>------ Build started: Project: KioskHostBootstrapper, Configuration: Release x86 ------
2> C:\Program Files (x86)\WiX Toolset v3.11\bin\candle.exe -dBuildVersion=5.0.307.1 -d"DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\\" -dSolutionDir=C:\centrics\CentricsStoreFront_5_0\Source\ -dSolutionExt=.sln -dSolutionFileName=CentricsStoreFront_5_0.sln -dSolutionName=CentricsStoreFront_5_0 -dSolutionPath=C:\centrics\CentricsStoreFront_5_0\Source\CentricsStoreFront_5_0.sln -dConfiguration=Release -dOutDir=bin\Release\ -dPlatform=x86 -dProjectDir=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostBootstrapper\ -dProjectExt=.wixproj -dProjectFileName=KioskHostBootstrapper.wixproj -dProjectName=KioskHostBootstrapper -dProjectPath=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostBootstrapper\KioskHostBootstrapper.wixproj -dTargetDir=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostBootstrapper\bin\Release\ -dTargetExt=.exe -dTargetFileName=KioskHostSetup.exe -dTargetName=KioskHostSetup -dTargetPath=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostBootstrapper\bin\Release\KioskHostSetup.exe -dKioskHostInstaller.Configuration=Release -d"KioskHostInstaller.FullConfiguration=Release|x86" -dKioskHostInstaller.Platform=x86 -dKioskHostInstaller.ProjectDir=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostInstaller\ -dKioskHostInstaller.ProjectExt=.wixproj -dKioskHostInstaller.ProjectFileName=KioskHostInstaller.wixproj -dKioskHostInstaller.ProjectName=KioskHostInstaller -dKioskHostInstaller.ProjectPath=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostInstaller\KioskHostInstaller.wixproj -dKioskHostInstaller.TargetDir=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostInstaller\bin\Release\ -dKioskHostInstaller.TargetExt=.msi -dKioskHostInstaller.TargetFileName=KioskHostInstaller.msi -dKioskHostInstaller.TargetName=KioskHostInstaller -dKioskHostInstaller.TargetPath=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostInstaller\bin\Release\KioskHostInstaller.msi -out obj\Release\ -arch x86 -ext "C:\Program Files (x86)\WiX Toolset v3.11\bin\\WixUtilExtension.dll" -ext "C:\Program Files (x86)\WiX Toolset v3.11\bin\\WixBalExtension.dll" Bundle.wxs
2>C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostBootstrapper\Bundle.wxs(20,0): error CNDL0150: Undefined preprocessor variable '$(var.siteloc)'.
2>Done building project "KioskHostBootstrapper.wixproj" -- FAILED.
我试过这个SF Suggestion,
<PropertyGroup>
<siteloc>fubar</siteloc>
</PropertyGroup>
但它没有用。
我错过了什么?