4

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.

1

2 Answers 2

14

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>
Sign up to request clarification or add additional context in comments.

1 Comment

Putting that into the app.config fixed it.
0

If the acepted answer doesnt work for you, check if you have 64bit system, and if you do, right click on your project -> properties -> build -> set platform target to x86 and rebuild.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.