具有自定义操作的 WIX 安装程序:“由比当前加载的运行时更新的运行时构建,无法加载。”

问题描述 投票:0回答:0

我有一个 WIX 安装程序,可以在安装过程中执行自定义操作。当我运行 WIX 安装程序时,它遇到第一个自定义操作,安装程序失败,并且我在 MSI 日志中收到如下错误:

操作开始 12:03:53:加载BCAConfigDefaults。 SFXCA:将自定义操作提取到临时目录:C:\DOCUME~1\ELOY06~1\LOCALS~1\Temp\MSI10C.tmp-\ SFXCA:绑定到 CLR 版本 v2.0.50727 调用自定义操作 WIXCustomActions!WIXCustomActions.CustomActions.LoadBCAConfigDefaults 错误:无法从程序集加载自定义操作类 WIXCustomActions.CustomActions:WIXCustomActions System.BadImageFormatException:无法加载文件或程序集“WIXCustomActions”或其依赖项之一。该程序集是由比当前加载的运行时更新的运行时构建的,无法加载。 文件名:“WIX自定义操作” 在 System.Reflection.Assembly._nLoad(AssemblyName fileName、字符串 codeBase、证据 assemblySecurity、程序集位置Hint、StackCrawlMark& stackMark、布尔值 throwOnFileNotFound、布尔值 forIntrospection) 在 System.Reflection.Assembly.nLoad(AssemblyName fileName、字符串 codeBase、证据 assemblySecurity、程序集位置Hint、StackCrawlMark& stackMark、布尔值 throwOnFileNotFound、布尔值 forIntrospection) 在 System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef、证据 assemblySecurity、StackCrawlMark& stackMark、布尔值 forIntrospection) 在 System.Reflection.Assembly.InternalLoad(字符串 assemblyString,证据 assemblySecurity,StackCrawlMark& stackMark,布尔值 forIntrospection) 在 System.AppDomain.Load(字符串 assemblyString) 在 Microsoft.Deployment.WindowsInstaller.CustomActionProxy.GetCustomActionMethod(会话会话,字符串程序集名称,字符串类名称,字符串方法名称)

...上面的具体问题是“System.BadImageFormatException:无法加载文件或程序集“WIXCustomActions”或其依赖项之一。该程序集是由比当前加载的运行时更新的运行时构建的,无法加载。”

该错误的措辞似乎表明诸如错误引用的 .NET 框架之类的东西(我在自定义操作及其依赖项中都以 3.5 为目标),但我不知道在哪里进行更改来解决此问题问题。有什么想法吗?

...不确定这是否有帮助,但它是我运行的 CustomActions 包批处理文件,用于创建包含自定义操作函数的 .dll 包:

================

调用“C:\Program Files\Microsoft Visual Studio 10.0\VC cvarsall.bat”

@回声开启

cd "C:\development runk\PortalsDe

wix windows-installer custom-action
© www.soinside.com 2019 - 2024. All rights reserved.