当前位置: 移动技术网 > IT编程>开发语言>.net > C#异常--System.IO.FileLoadException:“混合模式程序集是针对“v2.0.50727”版的运行时生成的错误

C#异常--System.IO.FileLoadException:“混合模式程序集是针对“v2.0.50727”版的运行时生成的错误

2018年11月21日  | 移动技术网IT编程  | 我要评论

ina导轨,寒天行侠传,cctv3生活就是舞台

异常信息:

system.io.fileloadexception:“混合模式程序集是针对“v2.0.50727”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集。”

解决方案:

在app.config新增如下配置节:

<startup uselegacyv2runtimeactivationpolicy="true">
<supportedruntime version="v4.0" sku=".netframework,version=v4.5.2" />
</startup>

详细的startup的配置说明:https://docs.microsoft.com/zh-cn/dotnet/framework/configure-apps/file-schema/startup/startup-element

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网