[wix-devs] NuGet support for wixlibs

Heath Stewart Heath.Stewart at microsoft.com
Mon Mar 7 15:05:56 PST 2016

I've talked with the NuGet team quite a bit about this and don't think it will happen - at least not any time soon. However, I did evolve a strategy which works without scripting support that is checked into wix4. See commit 24c1d14313e6809202903ab3bf8401f739d0b4d1.

The only thing I've evolved further with some help from Andrew Arnott (who does a lot with solution explorer / common project system) is to create a target that imports wixlibs and/or WiX extensions as references. Seems MPF (which Votive uses) doesn't like references added by .targets files so we hook the build targets to add them during build only. I.e., something like this:

<Target Name="ReferenceMyWixlib" BeforeTargets="CoreBuild">
    <WixLibrary Include="..\wix\mywixlib.lib" />

Put that in a file like build\MyNuGetPackageName.targets (matching MyNuGetPackageName, of course) and this works.

In case the NuGet team ever does add first-party support for wixlibs, they ask you do not put wixlibs (or WixExtensions) under the special "lib" root directory of a package.

Heath Stewart
Visual Studio, Microsoft

-----Original Message-----
From: wix-devs [mailto:wix-devs-bounces at lists.wixtoolset.org] On Behalf Of Tom Glastonbury
Sent: Monday, March 7, 2016 1:32 AM
To: wix-devs at lists.wixtoolset.org
Subject: [wix-devs] NuGet support for wixlibs

This is about using NuGet packages to distribute wixlibs, and follows on


I'm not sure if WiX has grown built-in support for this since that thread was posted, but I failed to find anything despite vigorous Googling. We needed this functionality in-house at my workplace, so I created a NuGet package that, when added to a WiX Library project, extends the build process to produce a NuGet package that can be added to a WiX project, adding a reference to the wixlib. In case it might be useful for others, I've put the project on github and published the generator package to nuget.org. The project is called WixNuGetPackager.


See the github project homepage for details of use, and notably a disclaimer regarding limited test scenarios.


WiX Toolset Developer Mailing List provided by FireGiant https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fwww.firegiant.com%2f&data=01%7c01%7cHeath.Stewart%40microsoft.com%7cfea97d298d7f4a19d9bf08d3466b4a69%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=70rQyQUxMZ6q7kKQu8%2f9DfaPejsucYRmJS8%2f5H23z5o%3d

More information about the wix-devs mailing list