February 25, 2010

How to Register a .Net assembly into GAC using WiX?

Ealier we have seen some articles to register a .Net assembly into GAC using either gacutil.exe or RegAsm.exe. In this article we will see the code snippet to register the assembly into GAC using WiX.

<Directory Id="ProgramFilesFolder">
<Directory Id="ProductDirectory" Name="$(var.ProductName)">
      <Directory Id="GAC" Name="GAC">
          <Component Id="MyGACControl" Guid="55857611-A13E-51ED-897B-A78830F68ADC" DiskId="1">
                <!-- Registering assembly in GAC -->
               <File Id="F_MyGACControl" Name="MyGACCtrl.dll" LongName="MyGACControl.dll" Source="$(var.SrcPath)

               \MyGACControl.dll" KeyPath="yes" Assembly=".net"/>
           </Component>
      </Directory>
</Directory>
</Directory>

The highlighted text - Name="GAC" Assembly=".Net", in the above code drives the .Net assembly registration into GAC.


Read the following related articles:
  1. How to register a .Net assembly into GAC in a development environment?
  2. How to Register .Net assembly into GAC using InstallShield 2010?

No comments:

Post a Comment