I know NHibernate has a driver for SQLite, but what do I have to install locally to use the in-me开发者_如何学编程mory version?
Take a look at this
SQL.Data.SqlLite version with NHibernate 2.1
No you don't have to install anything when you want to run in-memory. Just reference the dll (copy-local true)
The name of the dll is System.Data.SQLite.dll You can download it at source forge
I started using sqllite in-memory when I was browsing through the FluentNhibernate examples. So I copied it from FluentNhibernate. I use the following configuration:
FluentConfiguration configuration = Fluently.Configure()
.Database(() =>
SQLiteConfiguration.Standard
.InMemory()
.ProxyFactoryFactory("NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle")
.Mappings(mappingConfiguration => mappingConfiguration
.FluentMappings
.AddFromAssemblyOf<User>());
SessionSource sessionSource = new SingleConnectionSessionSourceForSQLiteInMemoryTesting(configuration);
ISession session = sessionSource.CreateSession()
Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
Solution:
Please do some settings in Testsettings: choose Hosts --> choose Run tests in 32 bit or 64 bit process --> choose "Run tests in 64 bit process on 64 bit machine"
Thats it. That works or me.
Hoping I could help.
merry coding
精彩评论