1
votes

I know that there are wery similar question posted and already answered here, but those solution weren't useful for me. I want to create a project which will use sqlite database, fluent nhibernate (all in .Net 4). Problem is that I can't find working example which will act as reference for me. All my efforts ended with Exception(Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=3.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4.) on line:

new SchemaExport(configuration).Create(true, true);

I added those lines in app.config mentioned in other solutions.

So to summarize: can anybody post an exact way to create a solution with some sample code(preferably tutorial from fluent nhibernate get started guide) which will work in .net 4 ?

If you can please post files.

1

1 Answers

0
votes

I think your problem may be solved by this answer, quoted below for convenience. I see you already changed app config, but note the link to a post about getting .NET 4 compatible versions of SQLite.

Quote:

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>

/Quote

Once you get your sample working, please load it to the FNH GitHub.