为什么在Windows应用程序设置中出现system . io . fileloadeexception

本文关键字:system io fileloadeexception Windows 应用程序 设置 为什么 | 更新日期: 2023-09-27 18:08:19

我使用c#.net(4.0)和SQLite数据库制作了一个windows应用程序。它在调试时工作得很好,然后我创建了设置并安装了它,然后当我执行。exe时,它给出了这样的错误:

  System.IO.FileLoadException: Mixed mode assembly is built against version 
  'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without  
  additional configuration information.

创建应用程序设置时-

在我的app.config中,代码是
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
</configuration>

和数据库在[System.Environment]中。CurrentDirectory]。Bin 'debug目录,其中.exe保存。

我在创建设置时犯了什么错误,我需要在SQLite的情况下添加更多的东西吗?

需要帮助! !非常感谢。

为什么在Windows应用程序设置中出现system . io . fileloadeexception

你需要添加

<supportedRuntime version="v2.0"/>