Friday, May 07, 2010

SQLite and .NET 4.0

When I converted an existing C# solution with NHibernate/SQLite to .NET 4, I got the following runtime exception:
Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=, Culture=neutral, PublicKeyToken=aa95f207798dfdb4.

The cause is that the System.Data.SQLite.dll is compiled against .NET 2. To avoid this problem, you can add te following configuration in your app.config:

and the application runs fine.

No comments: