简体   繁体   English

Wix返回错误“模块中未找到CA或UI入口点”,但在dll中使用了[CustomAction]

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

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. 我在尝试使用Wix Framework从dll使用自定义操作时遇到问题。

I am using Wix 3.10.2 我正在使用Wix 3.10.2

I have a C# Custom Action project under my solution called Install.CustomAction. 我的解决方案下有一个名为Install.CustomAction的C#Custom Action项目。 This is then referenced in the main Wix Project. 然后,在主要的Wix项目中引用它。 You can see that here 你可以在这里看到

在此处输入图片说明

I have referenced the CA dll as a binary in the main Product.wxs file 我在主Product.wxs文件中将CA dll引用为二进制文件

<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.cs的实际c#文件中,我使用[CustomAction]属性进行了此设置

[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 在模块中找不到CA或UI入口点

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. 我已经指定了一个入口点,并在我的.wxs文件中引用了dll,但它似乎对我不起作用。

我认为必须是:

public static ActionResult ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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