Wix Returning the error "No CA or UI entry points found in module" but [CustomAction] is used in dll

1.5k views Asked by At

First off, apologies for the obfuscated screenshots and not including the full names in code.

I am having issues trying to use custom actions from a dll using the Wix Framework.

I am using Wix 3.10.2

I have a C# Custom Action project under my solution called Install.CustomAction. This is then referenced in the main Wix Project. You can see that here

enter image description here

I have referenced the CA dll as a binary in the main Product.wxs file

<Binary Id="CustomActions.dll" SourceFile="$(var.<porjectname>.Install.CustomAction.TargetDir)<projectname>.CustomAction.CA.dll"/>

Now in a fragment I have the actions referenced like this

<CustomAction Id="CA_RestoreDB" BinaryKey="CustomActions.dll" DllEntry="RestoreMobileDB" Execute="immediate" Return="check" />
<InstallExecuteSequence>
  <Custom Action="CA_RestoreDB" After="InstallFinalize"/>
</InstallExecuteSequence>

So this far though, I would expect everything to work.

In the actual c# file called CustomAction.cs I have this setup with the [CustomAction] attribute

[CustomAction]

public ActionResult RestoreMobileDB(Session session)
{
    //string installPath = session.GetTargetPath(TARGETDIR);
    string x = session["INSTALLFOLDER"];
    session.Log("Begin CustomAction1");
    doSomeStuff(x, session);

    return ActionResult.Success;
}

So far everything is looking good and is working how I woudl expect it. But when I come to compile everything I get this error

    Severity    Code    Description Project File    Line    Suppression State
Error       The command ""C:\Program Files (x86)\WiX Toolset v3.10\bin\..\sdk\MakeSfxCA.exe" "C:\Work Files\Development\<product>\<solution>\<project>.Install.CustomAction\obj\x86\Release\<project>.Install.CustomAction.CA.dll" "C:\Program Files (x86)\WiX Toolset v3.10\bin\..\sdk\x86\SfxCA.dll" "C:\Work Files\Development\<product>\<solution>\<project>Install.CustomAction\obj\x86\Release\<project>.Install.CustomAction.dll" "C:\Program Files (x86)\WiX Toolset v3.10\SDK\Microsoft.Deployment.WindowsInstaller.dll;C:\Work Files\Development\<product>\<solution>\<project>.Install.CustomAction\CustomAction.config"" exited with code 1.    <project>.Install.CustomAction

Followed by this error

No CA or UI entry points found in module

Do you have any idea what could be causing this? I have specified an entry point and referenced the dll in my .wxs files but It doesn't appear to be working for me.

1

There are 1 answers

1
PhilDW On BEST ANSWER

I think it needs to be:

public static ActionResult ...