WiX adding .net files to GAC

2

I have a problem copying assembly files to GAC using msi installer file. My project requires me to add some .netmodule files along with a .dll file to GAC. But using the assembly = ".net" for .netmodule file in the <File> element is throwing an error(build error).

Error   2   The assembly file 
'C:\Users\p486\Desktop\DCUBEII\GAC\Cdcube_inq_dynftrm_lnk_srv.netmodule' appears to be
invalid.  <br/>Please ensure this is a valid assembly file and that the user has the 
appropriate access rights to this file. <br/> More information: HRESULT:<br/> 
0x80131018  C:\Wix\MainProject\MainProject\GACFiles.wxs 16  1   MainProject

How can is copy those .netmodule files to GAC?

If we manually drag and drop the .dll file into C:\Windows\assembly folder, all the .netmodule files are being copied automatically but if try to copy only the .dll file into GAC using installer, its throwing an installtime error. How to copy those files to GAC?

wix
gac
wix3.6
asked on Stack Overflow Apr 11, 2013 by Evuri • edited Apr 11, 2013 by Yan Sklyarenko

1 Answer

1

I've not played with .netmodule files much but my understanding is that the .netmodule needs to be in the same Component as the assembly. For example:

<Component>
   <File Assembly='.net' Source='path\to\assembly.dll' />
   <File Source='path\to\first.netmodule' />
   <File Source='path\to\second.netmodule' />
   ...
</Component>

The Component will GAC the assembly and carry all the .netmodule files along with it.

answered on Stack Overflow Apr 11, 2013 by Rob Mensching

User contributions licensed under CC BY-SA 3.0