Visual Studio错误提示“System.BadImageFormatException”异常

在调试Winform程序时遇到如下错误:

“System.BadImageFormatException”类型的未经处理的异常在 未知模块。 中发生
未能加载文件或程序集“OpenPCINFO.exe”或它的某一个依赖项。生成此程序集的运行时比当前加载的运行时新,无法加载此程序集。 出现了

System.BadImageFormatException

System.BadImageFormatException

产生的原因是将.NETFramework版本从2.0改为了4.5

解决办法只要将app.config中的v2.0删除即可

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup>
    <!--<supportedRuntime version="v2.0.50727"/>-->
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup>
</configuration>

再次运行已经不会弹出 System.BadImageFormatException 错误了

官方QQ群号码:922069959(空)1093596563(空)

您可能感兴趣的文章

    留言评论

    发表回复

    您的电子邮箱地址不会被公开。 必填项已用 * 标注

    Captcha Code