现在的位置: 首页 > 综合 > 正文

C# 使用SQLite由于.NetFramework 的错误

2013年10月03日 ⁄ 综合 ⁄ 共 533字 ⁄ 字号 评论关闭

In order to use a CLR 2.0 mixed
mode assembly
, you need to modify your App.Config file to include:

<?xml version="1.0"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>

The key is the useLegacyV2RuntimeActivationPolicy flag.
This causes the CLR to use the latest version (4.0) to load your mixed mode assembly. Without this, it will not work.

Note that this only matters for mixed mode (C++/CLI) assemblies. You can load all managed CLR 2 assemblies without specifying this in app.config.

抱歉!评论已关闭.