3rd party libraries in Installer

May 30, 2016 at 9:33 AM
Hello

I am again writing about installer which I implement using ManagedProject. I need to use 3rd party library for a custom action. So I added appropriate nuget package to the installer project. But during the installation that custom action fails with message something like "Cannot find dll file" and it seems that dll file which comes from the 3rd library is not included/accessible in the installer.

Currently we resolved this issue by creating a separate program which performs operations with that library and this program is run from the custom action. Is there any better way how to use 3rd libraries in the installer project?

Tibor
Coordinator
May 30, 2016 at 12:49 PM
Correct. WiX compiler MakeSfxCA.exe doesn't know that the NuGet package needs to be included in the CA package as NuGet is a VS package manager and it has no integration with WiX.

Thus all non-GAC assemblies the CA depends on must be added to the Wix# project so they are available at runtime. See DTF_ExternalAssembly sample for details.

If you are using ManagedProject then you need to add the assembly to the project:
project.DefaultRefAssemblies.Add(typeof(LibA.ClassB).Assembly.Location);
Marked as answer by fulbts on 6/2/2016 at 3:25 AM