单独项目中的SQLite程序集

时间:2013-09-04 09:20:39

标签: c# .net sqlite fluent-nhibernate assembly-resolution

我有2个项目(有问题)

DataAccessLayer
Tests

我正在使用Fluent nHibernate,并设置SQLite数据库。

我在System.Data.SQLite项目中引用了DataAccessLayerCopyLocal = true}但是当我在Tests项目中运行配置时,nHibernate找不到SQLite提供程序程序集。< / p>

现在我已将SQLite引用添加到Tests项目中,并且运行时没有问题。

但我想在我的DataAccessLayer项目中保留程序集引用,因为那里是数据访问层(要使用的数据库)。

为什么我的Tests项目没有看到DataAccessLayer项目中的SQLite程序集引用?

DataAccessLayer项目中引用了

Tests

编辑 - app.config中的连接字符串

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

修改 - 例外

  ----> 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 个答案:

没有答案
相关问题