无法加载文件或程序集“System.Runtime.dll,版本=6.0.0.0”

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

实际上在我的应用程序中,.net Framework 和 .net standard 运行良好并且引导程序包安装正常。

由于某种原因,我们已经将其中一个项目迁移到 .net 6,然后我能够构建,但是在安装包的过程中出现错误

Couldn't Load the assembly 'System.Runtime.dll version=6.0.0.0' 

在调试过程中,我发现 .net 标准之一中的异常引发错误发生的代码是

cobj = Activator.CreateInstance(<classType>,
                            BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic,
                            null, args, null);

创建对象失败的类构造函数的实际行是

/config = ConfigurationManager.OpenExeConfiguration(GetType().Assembly.Location);

ConfigurationManager 存在于命名空间下

System.Configuration
;

我觉得自从早期的 .net 标准和 .net 框架以来,这段代码就可以工作,但是其中一个组件在 .net 6 中,所以这一行给出了异常。

是否有任何改变的解决方案。

wix .net-6.0 .net-4.8 .net-standard-2.0
© www.soinside.com 2019 - 2024. All rights reserved.