Rim*_*mer 2 windows-installer custom-action wix
我有一个调用两个 C# 自定义操作的 WIX 安装程序。
第一个运行例程,将具有默认值的 WIX 会话加载到 GUI 提示中以进行应用程序设置。然后,GUI 在安装过程中提示用户输入新值,这会将提供的设置存储到会话中。这运行得很好,然后在安装程序运行期间向用户显示提示。
然而,在 InstallFinalize 之后,应该运行另一个自定义操作来获取这些保存的设置,并将它们写入数据库和注册表。我编写了一个处理数据库连接的外部库,此自定义操作尝试加载它并使用它,但失败并出现以下错误:
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 'myCompany.PortalLib, Version=2.9.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'myCompany.PortalLib, Version=2.9.0.0, Culture=neutral, PublicKeyToken=null'
at WIXCustomActions.CustomActions.SetBCAConfigOptions(Session session)
Run Code Online (Sandbox Code Playgroud)
细节:
需要获取自定义操作以利用 myCompany.POrtalLib 才能写入服务器数据库...
更新:我尝试将 .dll 文件与自定义操作的 Packaged .dll 一起包含在 WIX 中,并在 XML 中引用它(在 HTML 尖括号中添加“[”):
[二进制 ID =“myCompany.PortalLib.dll”SourceFile =“myCompany.PortalLib.dll”/]
...我仍然收到上面的“无法加载文件或程序集”错误:(。
好吧,我也修好了这个!
我注意到,当我使用 makefxca 运行打包命令时,我正在打包自定义操作的 dll、Windows 安装程序的 dll 和 customaction.config。当我为 myCompany.PortalLib.dll 添加一个有效 dll 的路径以及这三个函数时,当需要执行该函数时,它工作得非常好...因此,将所有依赖的外部 dll 添加到打包的自定义操作 DLL 中与 makefxca 一起使用,以便包含外部 DLL 以与您的自定义操作一起使用。
| 归档时间: |
|
| 查看次数: |
2478 次 |
| 最近记录: |