I have a custom WIX extension (dll) that I would like to manage as a Nuget package that I can use for WIX installer projects in Visual Studio 2017. At first the Nuget package would not install, giving me this error:
Could not install package 'MyExtension 1.0.10859'. You are trying to install this package into a project that targets 'Unsupported,Version=v0.0', but the package does not contain any assembly references or content files that are compatible with that framework.
Someone suggested that I needed to create a .targets file to include in my package that looked something like this:
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="4.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<WixExtension
Include="$(MSBuildThisFileDirectory)..\tools\MyExtension.dll" />
</ItemGroup>
Now the Nuget package is installed to the packages folder and added to my packages.config file, but the assembly MyExtension.dll is not added to the References for the WIX installer project. How can I get it to be added to the References when I install the Nuget package?
I saw this solution on How to Add Nuget package dlls to Wix installer when I was searching through StackOverflow. And it is a fine solution if the package you are installing is from a third party and you have no control on how it was packaged. But I am creating the Nuget package and would like to package it in a way that it can be directly installed into the WIX project.