Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem Upgrading NHibernate SQLite Application to .Net 4.0

I have a WPF Application using Fluent NHibernate 1.0 RTM and System.Data.SQLite 1.0.65 that works fine in .Net 3.5. When I try to upgrade it to .Net 4.0 everything compiles but I get a runtime error where the innermost exception is this:

`The IDbCommand and IDbConnection implementation in the assembly System.Data.SQLite could not be found.`

The only change made to the project was switching the Target Framework to 4.0.

like image 406
Xavin Avatar asked Dec 09 '22 16:12

Xavin


1 Answers

You need to use a version of SQLite that is compatible with .NET 4.0. You might also try putting this in your app.config:

<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
</configuration>
like image 190
Darin Dimitrov Avatar answered Dec 12 '22 05:12

Darin Dimitrov