Estoy utilizando el último NHibernate 2.1.0Beta2. Estoy tratando de probar la unidad con SQLite y he puesto la configuración como:Cómo configurar SQLite para ejecutar con NHibernate donde el ensamblado resuelve System.Data.SQLite?
Dictionary<string, string> properties = new Dictionary<string, string>();
properties.Add("connection.driver_class", "NHibernate.Driver.SQLite20Driver");
properties.Add("dialect", "NHibernate.Dialect.SQLiteDialect");
properties.Add("connection.provider", "NHibernate.Connection.DriverConnectionProvider");
properties.Add("query.substitutions", "true=1;false=0");
properties.Add("connection.connection_string", "Data Source=test.db;Version=3;New=True;");
properties.Add("proxyfactory.factory_class",
"NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu");
configuration = new Configuration();
configuration.SetProperties(properties);
cuando trato de correr, me sale el siguiente error:
NHibernate.HibernateException: The IDbCommand and IDbConnection implementation in the assembly System.Data.SQLite could not be found. Ensure that the assembly System.Data.SQLite is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly.
at NHibernate.Driver.ReflectionBasedDriver..ctor(String driverAssemblyName, String connectionTypeName, String commandTypeName) in c:\CSharp\NH\nhibernate\src\NHibernate\Driver\ReflectionBasedDriver.cs: line 26
at NHibernate.Driver.SQLite20Driver..ctor() in c:\CSharp\NH\nhibernate\src\NHibernate\Driver\SQLite20Driver.cs: line 28
por lo que parece que necesito para referenciar el montaje directamente. ¿Cómo haría esto para no tener más este error?
He descargado el último ensamblaje desde aquí: http://sourceforge.net/projects/sqlite-dotnet2.
En caso de que alguien se topa con esta pregunta y está buscando una versión actualizada de esta respuesta -
El puesto en mi blog sobre esta pregunta exacta es mucho más actualizada que las respuestas aquí ...
[http: // debuggerstepthrough.blogspot.co.il/2011/08/unit-testing-fluentnhibernate.html](http://debuggerstepthrough.blogspot.co.il/2011/08/unit-testing-fluentnhibernate.html) – gillyb
Es el código de sqlite-dotnet2 en el directorio de la aplicación? (¿o registrado en el GAC?) – Jay
Tengo una referencia a System.Data.SQLite.DLL en mis referencias del proyecto. Supongo que cuando ejecuto la prueba unitaria (a través del corrector de prueba de la unidad Resharper), la copia. –