VS2010版本兼容性带来的问题

2010-08-06 13:52:35 |

重新安装了机器,因为老爷子要用移动硬盘在电视上看连续剧,没忍心将移动硬盘带到办公室,所以很多东西都没有复制到我的机器上。我的机器直到现在还是一个半成品,至少,我没法接受到QQ消息,呵呵,可牛的安装界面还是无耻的乱码

终于忍不住,安装了Visual Studio 2010,当初被我安装完成之后就扔掉的产品,现在貌似又要恢复青春了,这次我决定将几乎所有的产品全部定位到最新的DotNet Framework V4上面,这样我也可以使用最新的语言特性,我已经离开江湖很多年了啊。

我在编译一个简单的SQLite封装的时候,出现了严重的错误:

System.IO.FileLoadException was unhandled
Message=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.

真让人无奈啊,这个错误我从来没有遇到过,检查了半天,才知道是System.Data.Sqlite的问题,解决办法也很简单,在目标工程中增加一个app.config输入以下内容:

<?xml version="1.0"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
    <requiredRuntime version="v4.0.20506" />
  </startup>
</configuration>

然后重新编译即可

Comments (1) -

Air Jordan Retro 1 :

新年快乐

Add comment




biuquote
  • Comment
  • Preview
Loading