混合模式程序集是针对“v2.0.50727”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集。
今天在项目中用C#操作SQLite,在加载数据库的时候代码报错,因为我把项目的framework版本由2.0升级为4.0后出现的。
解决方法:在app.config 中添加这段代码
<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
下面这段代码不能要:
<supportedRuntime version="v2.0.50727"/>
浙公网安备 33010602011771号