I having an issue with a WiX setup project I recently added to a Visual Studio
2012 (Ultimate, Update 4) web service project.
When the Candle utility processes the Product.wxs file, it's complaining that
it can't find any of the var.<ProjectName>.* preprocessor variables.
At first I thought it might be just .ProjectName, but none of the others, such
as .ProjectPath, .Configuration, .TargetDir, etc. work, so clearly the whole
<ProjectName>.* set is not being defined.
I have used WiX without issue on several other projects, but those are VS 2010
projects, so I'm wondering if there's something special about VS 2012 w/r/t WiX
that I'm missing?
When I installed WiX, I already had VS 2010 and VS 2012 installed, so WiX
project types were added without issue.
The target project is called DMICoreService and the setup project is called
DMICoreService_Setup.
Below are the relevant fragments of the DMICoreService_Setup.csproj and
Product.wxs files and build output that I think will be helpful:
----------------------------------------------------------
Project reference for target project:
----------------------------------------------------------
<ItemGroup>
<ProjectReference Include="..\DMICoreService\DMICoreService.csproj">
<Name>DMICoreService</Name>
<Project>{e793a8ce-2dc7-403d-a43c-566cc846b71c}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>
</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
<WebProject>True</WebProject>
</ProjectReference>
</ItemGroup>
----------------------------------------------------------
The following fragment is to get the web transforms to happen and pulled into
the final build.
It also defines some constants to be made available to WiX.
This fragment has been used successfully, as-is, in several other projects (as
noted above).
----------------------------------------------------------
<Target Name="BeforeBuild">
<PropertyGroup>
<ProjectReferenceFilename>%(ProjectReference.Filename)</ProjectReferenceFilename>
</PropertyGroup>
<MSBuild Projects="%(ProjectReference.FullPath)" Targets="Package"
Properties="Configuration=$(Configuration);Platform=AnyCPU"
Condition="'%(ProjectReference.WebProject)'=='True'" />
<Copy
SourceFiles="%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Configuration)\TransformWebConfig\transformed\web.config"
DestinationFiles="%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Configuration)\Package\PackageTmp\web.config"
Condition="'%(ProjectReference.WebProject)'=='True'">
</Copy>
<ItemGroup>
<LinkerBindInputPaths
Include="%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Configuration)\Package\PackageTmp\"
/>
</ItemGroup>
<HeatDirectory OutputFile="%(ProjectReference.Filename).wxs"
Directory="%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Configuration)\Package\PackageTmp\"
DirectoryRefId="INSTALLFOLDER"
ComponentGroupName="$(ProjectReferenceFilename.Replace('-','_'))_Project"
AutogenerateGuids="true" SuppressCom="true" SuppressFragments="true"
SuppressRegistry="true" SuppressRootDirectory="true" ToolPath="$(WixToolPath)"
Condition="'%(ProjectReference.WebProject)'=='True'" />
<GetAssemblyIdentity
AssemblyFiles="%(ProjectReference.RootDir)%(ProjectReference.Directory)bin\%(ProjectReference.Name).dll">
<Output TaskParameter="Assemblies" ItemName="AssemblyVersion" />
</GetAssemblyIdentity>
<PropertyGroup>
<DefineConstants>AssemblyVersion=%(AssemblyVersion.Version)</DefineConstants>
<DefineConstants
Condition="'$(Configuration)'=='DemoRelease'">$(DefineConstants);VirtualDirSuffix=Demo</DefineConstants>
<DefineConstants
Condition="'$(Configuration)'!='DemoRelease'">$(DefineConstants);VirtualDirSuffix=</DefineConstants>
</PropertyGroup>
</Target>
----------------------------------------------------------
Product.wxs fragment (build dies when it gets to the <Product> element because
it can't find the preprocessor variable):
----------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
<Product Id="*"
Name="$(var.DMICoreService.ProjectName)-PID-839-($(var.Configuration))-v$(var.AssemblyVersion)"
Language="1033" Version="$(var.AssemblyVersion)" Manufacturer="My Employer"
UpgradeCode="7753fa5e-6c89-4af4-99bb-53653afb1d05">
----------------------------------------------------------
Partial build output:
----------------------------------------------------------
1> C:\Program Files (x86)\WiX Toolset v3.9\bin\Heat.exe dir
C:\Users\TNewell\Documents\Projects\DMICoreServices\DMICoreService\obj\Debug\Package\PackageTmp\
-cg DMICoreService_Project -dr INSTALLFOLDER -scom -sreg -srd -ag -sfrag -out
DMICoreService.wxs
1> C:\Program Files (x86)\WiX Toolset v3.9\bin\candle.exe -v
-dAssemblyVersion=1.0.0.0 -dVirtualDirSuffix= -d"DevEnvDir=C:\Program Files
(x86)\Microsoft Visual Studio 11.0\Common7\IDE\\"
-dSolutionDir=C:\Users\TNewell\Documents\Projects\DMICoreServices\
-dSolutionExt=.sln -dSolutionFileName=DMICoreService.sln
-dSolutionName=DMICoreService
-dSolutionPath=C:\Users\TNewell\Documents\Projects\DMICoreServices\DMICoreService.sln
-dConfiguration=Debug -dOutDir=bin\Debug\ -dPlatform=x86
-dProjectDir=C:\Users\TNewell\Documents\Projects\DMICoreServices\DMICoreService_Setup\
-dProjectExt=.wixproj -dProjectFileName=DMICoreService_Setup.wixproj
-dProjectName=DMICoreService_Setup
-dProjectPath=C:\Users\TNewell\Documents\Projects\DMICoreServices\DMICoreService_Setup\DMICoreService_Setup.wixproj
-dTargetDir=C:\Users\TNewell\Documents\Projects\DMICoreServices\DMICoreService_Setup\bin\Debug\
-dTargetExt=.msi -dTargetFileName=DMICoreService_Setup.msi
-dTargetName=DMICoreService_Setup -dTarget
Path=C:\Users\TNewell\Documents\Projects\DMICoreServices\DMICoreService_Setup\bin\Debug\DMICoreService_Setup.msi
-out obj\Debug\ -arch x86 -ext "C:\Program Files (x86)\WiX Toolset
v3.9\bin\\WixIIsExtension.dll" DMICoreService.wxs Product.wxs
1>C:\Users\TNewell\Documents\Projects\DMICoreServices\DMICoreService_Setup\Product.wxs(6,0):
error CNDL0150: Undefined preprocessor variable
'$(var.DMICoreService.ProjectName)'.
1>Done building project "DMICoreService_Setup.wixproj" -- FAILED.
TIA
Regards,
--
Tim Newell
Program Manager, IS
Department of Biostatistics
MD Anderson Cancer Center
713-792-8391
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users