I'm using WiX 5 to build an MSI. My setup needs to include files that are obtained through a NuGet package. The files in the NuGet package are set as content files. When referencing the NuGet from my WiX project, I see all content files appear under the WiX project in the solution explorer of Visual Studio.
How can I reference these files from my wxs files, so they can be included in the MSI?
I've noticed the actual content files are unpacked in the NuGet cache (c:\Users\%username%\.nuget\packages\.... In the solution explorer they appear as shortcut (there is an arrow overlay in the bottom left corner). The files are not copied to the project folder or output folder.
The NuGet package is build using the following nuspec file:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>some-id</id>
<title>some-title</title>
<version>some-version</version>
<authors>Me</authors>
<projectUrl>https://github.com/***/***</projectUrl>
<description>Database deploy files</description>
<copyright>Copyright © 2025</copyright>
<developmentDependency>true</developmentDependency>
<repository type="git" url="https://github.com/***/***.git" />
<contentFiles>
<files include="any\any\*.sql" buildAction="Content" copyToOutput="true" flatten="false" />
</contentFiles>
</metadata>
<files>
<file src="Scripts\*.sql" target="contentFiles\any\any" />
</files>
</package>
In the WiX project file, I have referenced the package as such:
<PackageReference Include="My.NuGet.Package">
<IncludeAssets>all</IncludeAssets>
</PackageReference>
I am sure I can get this to work by creating a simple project (e.g. standard library) to acquire the files, and then have WiX obtain the files through a reference to that project. But I was hoping this would be possible from WiX directly.
