Dll Can';t在卸载时运行托管自定义操作

Dll Can';t在卸载时运行托管自定义操作,dll,wix,windows-installer,uninstallation,custom-action,Dll,Wix,Windows Installer,Uninstallation,Custom Action,我有一个自定义操作,应该在卸载时运行。但由于未知原因,msiexec说“此Windows Installer软件包有问题。无法运行完成此安装所需的DLL。请与您的支持人员或软件包供应商联系。”。代码如下: <Binary SourceFile="SetupWiX.CA.dll" Id="Binary1" /> <CustomAction Id="DropDatabase" BinaryKey="Binary1" DllEntry="DropDatabase" E

我有一个自定义操作,应该在卸载时运行。但由于未知原因,msiexec说“此Windows Installer软件包有问题。无法运行完成此安装所需的DLL。请与您的支持人员或软件包供应商联系。”。代码如下:

<Binary SourceFile="SetupWiX.CA.dll" Id="Binary1"  />       
<CustomAction Id="DropDatabase" BinaryKey="Binary1" DllEntry="DropDatabase" Execute="deferred" Return="check"/>
<Custom Action='DropDatabase'  After="SetCustomActionDataValue_DropDatabase">Installed</Custom>
Action start 16:07:34: INSTALL.
Action start 16:07:34: ValidateProductID.
Action ended 16:07:34: ValidateProductID. Return value 1.
Action start 16:07:34: CostInitialize.
Action ended 16:07:34: CostInitialize. Return value 1.
Action start 16:07:34: FileCost.
Action ended 16:07:34: FileCost. Return value 1.
Action start 16:07:34: CostFinalize.
Action ended 16:07:34: CostFinalize. Return value 1.
Action start 16:07:34: InstallValidate.
Action ended 16:07:34: InstallValidate. Return value 1.
Action start 16:07:34: InstallInitialize.
Action ended 16:07:37: InstallInitialize. Return value 1.
Action start 16:07:37: ProcessComponents.
Action ended 16:07:37: ProcessComponents. Return value 1.
Action start 16:07:37: UnpublishFeatures.
Action ended 16:07:37: UnpublishFeatures. Return value 1.
Action start 16:07:37: RemoveFiles.
Action ended 16:07:37: RemoveFiles. Return value 0.
Action start 16:07:37: InstallFiles.
Action ended 16:07:37: InstallFiles. Return value 1.
Action start 16:07:37: DropDatabase.
Action ended 16:07:37: DropDatabase. Return value 1.
Action start 16:07:37: RegisterUser.
Action ended 16:07:37: RegisterUser. Return value 0.
Action start 16:07:37: RegisterProduct.
Action ended 16:07:37: RegisterProduct. Return value 1.
Action start 16:07:37: PublishFeatures.
Action ended 16:07:37: PublishFeatures. Return value 1.
Action start 16:07:37: PublishProduct.
Action ended 16:07:37: PublishProduct. Return value 1.
Action start 16:07:37: InstallFinalize.
CustomAction DropDatabase returned actual error code 1154 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (D4:DC) [16:07:41:650]: Product: MyProduct -- Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor.  Action DropDatabase, entry: DropDatabase, library: C:\Windows\Installer\MSI4DEF.tmp 

Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor.  Action DropDatabase, entry: DropDatabase, library: C:\Windows\Installer\MSI4DEF.tmp 
Action ended 16:07:41: InstallFinalize. Return value 3.
Action ended 16:07:42: INSTALL. Return value 3.

问题在于我的自定义操作方法是私有的,而不是公共的。

您是否查看了MSI日志以查看到底出了什么问题?@saschabeaumont日志包含完全相同的错误,没有详细的描述可用,并且您的CA DLL肯定会导出函数DropDatabase(MSIHANDLE)?您是否尝试过将SetupWiX.CA.dll复制到目标系统并运行depends.exe以确保加载正常。@Stephen Connolly,没有,但我会尝试。当然,DLL包含DropDatabase方法。您能否在错误之前发布前10行,这可能会让您了解安装程序服务如何尝试加载DLL。还只是检查一下-您在安装时使用相同的DLL,并且工作正常吗?