SQLite assembly in separate project

536 views Asked by At

I have 2 projects (in question)

DataAccessLayer
Tests

I am using Fluent nHibernate, and setting up a SQLite database.

I have referenced System.Data.SQLite in DataAccessLayer project (with CopyLocal = true) but when I run the configuration in the Tests project, nHibernate cannot find the SQLite provider assembly.

Now I have added the SQLite reference to Tests project and it runs without a problem.

But I would like to leave the assembly reference in my DataAccessLayer project, as that is where there the data access layer (what database to use) is.

Why does my Tests project not see the SQLite assembly reference from the DataAccessLayer project?

DataAccessLayer is referenced in Tests project.

Edit - Connection String in app.config

  <connectionStrings>        
    <add name="SQLiteLocal" connectionString="Data Source=SQLite.db;" providerName="System.Data.SQLite" />
  </connectionStrings>

Edit - Exception

  ----> NHibernate.HibernateException : Could not create the driver from 
        NHibernate.Driver.SQLite20Driver, NHibernate, Version=3.3.1.4000,
        Culture=neutral, PublicKeyToken=aa95f207798dfdb4.
  ----> System.Reflection.TargetInvocationException : Exception has been thrown 
        by the target of an invocation.
  ----> System.ArgumentException : Unable to find the requested .Net Framework 
        Data Provider.  It may not be installed.
0

There are 0 answers