首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行带有COMAdmin互操作的WiX CustomAction时的FileNotFoundException

运行带有COMAdmin互操作的WiX CustomAction时的FileNotFoundException
EN

Stack Overflow用户
提问于 2010-04-14 18:09:11
回答 1查看 1.5K关注 0票数 0

我正在尝试创建一个WiX自定义操作,它允许我在升级安装过程中关闭和清除COM+包,或者在初始安装过程中创建和配置新的COM+包。我之前在标准的Visual Studio MSI中将其作为CustomAction运行,但这只允许在复制文件之后执行自定义操作-这将失败,因为包仍将运行。

COMAdmin.dll已被添加为对CustomAction项目的引用,并被设置为CopyLocal=true。在自定义操作项目的bin文件夹中,存在Interop.COMAdmin.dll。this question的答案似乎表明它应该是有效的。

尝试安装时,MSI日志中出现以下异常:

代码语言:javascript
复制
MSI (s) (C4:04) [10:40:34:205]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI119.tmp, Entrypoint: BeforeInstall
SFXCA: Extracting custom action to temporary directory: C:\WINDOWS\Installer\MSI119.tmp-\
SFXCA: Binding to CLR version v2.0.50727
Calling custom action MyCustomAction!MyCustomAction.CustomActions.BeforeInstall
Exception thrown by custom action:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Interop.COMAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'Interop.COMAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
   at MyCustomAction.CustomActions.BeforeInstall(Session session)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value  (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value .

   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
   at Microsoft.Deployment.WindowsInstaller.CustomActionProxy.InvokeCustomAction(Int32 sessionHandle, String entryPoint, IntPtr remotingDelegatePtr)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-07-11 22:46:10

与使用Visual Studio中的Installer类相比,我建议切换到WiX工具集中的DTF。与Installer类相比,DTF要灵活得多,并且与Windows Installer集成得更好。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2636466

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档