6

How to Add Nuget package dlls to Wix installer. I tried with adding

<?define SourceDirectory = $(var.SolutionDir)\ProjectName\bin\Release" ?>

   <Component Id="cmpId1"  Guid="BF985D52-BA8C-4E4F-84CC-B5A95520FBD4">
      <File Id="fileId1" KeyPath="yes" Source="$(var.SourceDirectory)\Unity.Abstractions.dll" />
   </Component>

But not working.

Please guide me how to add nuget package dll to wix installer.

Thanks, Naveen

Jophy job
  • 1,924
  • 2
  • 20
  • 38
user3839566
  • 73
  • 1
  • 6

1 Answers1

6

make a new project (library) that is empty and install the nuget-package in this new project. in your setup you collect the buildoutput of that new project that has the nuget-package installed.

<Component Id="cmpId1"  Guid="BF985D52-BA8C-4E4F-84CC-B5A95520FBD4">
      <File Id="fileId1" KeyPath="yes" Source="$(var.NugetCollectorProject.TargetDir)\Unity.Abstractions.dll" />
   </Component>

NugetCollectorProject is the new project. Your Setup must have a reference to that project to use that var.projectname.targetdir

D.J.
  • 3,644
  • 2
  • 15
  • 22