Deployment Tools Foundation
Building Managed Custom Actions
Development Guide > Managed CAs > Building

The build process for managed CA DLLs is a little complicated becuase of the proxy-wrapper and dll-export requirements. Here's an overview:

  1. Compile your CA assembly, which references WixToolset.Dtf.WindowsInstaller.dll and marks exported custom actions with a CustomActionAttribute.

  2. Package the CA assembly, CustomAction.config, WixToolset.Dtf.WindowsInstaller.dll, and any other dependencies using MakeSfxCA.exe. The filenames of CustomAction.config and WixToolset.Dtf.WindowsInstaller.dll must not be changed, since the custom action proxy specifically looks for those files.


Compiling


    csc.exe
        /target:library
        /r:$(DTFbin)\WixToolset.Dtf.WindowsInstaller.dll
        /out:SampleCAs.dll
        *.cs
            

Wrapping


    MakeSfxCA.exe
        $(OutDir)\SampleCAsPackage.dll
        $(DTFbin)\SfxCA.dll
        SampleCAs.dll
        CustomAction.config
        $(DTFbin)\WixToolset.Dtf.WindowsInstaller.dll
            

Now the resulting package, SampleCAsPackage.dll, is ready to be inserted into the Binary table of the MSI.


For a working example of building a managed custom action package you can look at included sample ManagedCAs project.



See also: