简体   繁体   中英

How to include a GAC'd dll in a Wix managed CustomAction assembly?

I have a Wix-based installer with a managed (C#) CustomAction assembly. As is described in this question , I use the Wix Visual Studio extensions to build the xx.CA.dll assembly that's included in the MSI.

However, as is described on Custom action project templates :

"Building the custom action project will produce an additional DLL in the target directory with the name $(TargetName).CA.dll. That is the DLL to be streamed into your MSI Binary table....

The custom action build process will automatically package up any non-GAC'd assemblies that your CA depends on. "

In my case, I'm referencing a Microsoft DLL, which is in the GAC on my dev and build machines (since it is needed by the build process on those machines), but the target machines on which this MSI will be run may not have that DLL in the GAC, resulting in a runtime exception:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft...' or one of its dependencies. .

So... How do I force Wix to include a GAC'd assembly when building the .CA.dll version of my managed CustomAction assembly?


Edited to remove any specific dll names, since people were focusing on the dll I mentioned and not the larger question of any GAC'd dll.

I had this issue until I checked the references in the project that contains the custom action. It references 'Microsoft.Web.Administration' as you do, but CopyLocal was set to false. Setting it to true pulls the DLL into the built MSI and all was well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM