WiX 5 Files not expanding project references correctly? #8117
Replies: 4 comments
-
If it helps any, the project reference entries in the .wixproj file look something like: |
Beta Was this translation helpful? Give feedback.
-
Probably also worth mentioning that if I replace $(var.MyProject.TargetDir) with the actual path to the files, everything works fine. |
Beta Was this translation helpful? Give feedback.
-
This works for me, from a simple .sln with one .csproj and one .wixproj: <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="Package1" Manufacturer="TODO Manufacturer" Version="1.0.0.0" UpgradeCode="310a7b02-d393-4f22-b5da-7818c6f253b1">
<Files Include="$(var.ConsoleApp1.TargetDir)**" />
</Package>
</Wix> You can also use bind paths: <ProjectReference Include="..\ConsoleApp1\ConsoleApp1.csproj" BindName="app" />
...
<Files Include="!(bindpath.app)**" />\ |
Beta Was this translation helpful? Give feedback.
-
Looks like part of what I thought I'd excluded from being relevant was in fact relevant....
Thought I'd excluded the Exclude from being responsible, but it turns out it was. Replaced it with To be slightly nitpicky, the warning message's line number indicated the Files entry was at fault, not the Exclude, but perhaps that's unavoidable... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to convert over a WiX 4 project to WiX 5 using Files instead of harvesting with Heat and what I'm getting is not what I would have expected from using the documentation on project references (https://wixtoolset.org/docs/v3/votive/votive_project_references).
For instance, suppose I have a source tree that looks like
C:\
with a VS MySolution.sln file in the MySolutionDirectory directory, a .csproj building MyProject.exe in the MyProject directory, and a WiX 5 Install.wixproj in the Install directory. If I have
<Files Include="$(var.MyProject.TargetDir)**"/>
in my .wxs file. This is generating the error
warning WIX8601: Missing directory for harvesting files: Could not find a part of the path 'C:\source\MySolutionDirectory\Install\MySolution\MyProject
I would have expected that this would instead search the directory C:\source\MySolutionDirectory\MyProject\bin\Release\ and all its subdirectories for files to include.... I don't think the project references are incorrect because there are File directives elsewhere in the .wxs file which seem to work correctly, something like:
<File Id="MyProjectExe" Source="$(var.MyProject.TargetPath)" Name="$(var.MyProject.TargetFileName)" KeyPath="yes"/>
Am I doing something wrong with the Files directive?
As an additional problem, the name of one of the projects the Install.wixproj references has a . in it (something like MyOtherProject.Something). When I try to reference that project's target directory using
<Files Include="$(var.MyOtherProject.Something.TargetDir)**"/>
the error I get changes to read
warning WIX8601:... Could not find a part of the path 'C:\source\MySolutionDirectory\Install\MySolution\MyOtherProject
The .Something is left off entirely...
Beta Was this translation helpful? Give feedback.
All reactions