Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# dennis 3/10/2006 11:51 PM
I downloaded the source version, started up visual studeo 2003, built everything.

I created a postgresql database called cuyahoga.
I created a virtual directory that points to the Web directory.
I edited the Web.config to uncomment the postgresql section of nhibernate and put in the correct connection info.

I surf to http://localhost/cuyahoga and get this error:

Server Error in '/cuyahoga' Application.
The IDbCommand and IDbConnection implementation in the Assembly Npgsql.dll could not be found. Please ensure that the Assemblies needed to communicate with PostgreSQL are in the Global Assembly Cache or in a location that NHibernate can use System.Type.GetType(string) to load the types from.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: NHibernate.HibernateException: The IDbCommand and IDbConnection implementation in the Assembly Npgsql.dll could not be found. Please ensure that the Assemblies needed to communicate with PostgreSQL are in the Global Assembly Cache or in a location that NHibernate can use System.Type.GetType(string) to load the types from.

Source Error:

Line 90: Configuration config = new Configuration();
Line 91: this._nhibernateConfiguration = config.AddAssembly(this.GetType().Assembly);
Line 92: this._nhibernateFactory = this._nhibernateConfiguration.BuildSessionFactory();
Line 93: }
Line 94: }


Source File: E:\downloads\Cuyahoga-0.9.0-src\Core\Service\SessionFactory.cs Line: 92

Stack Trace:

[HibernateException: The IDbCommand and IDbConnection implementation in the Assembly Npgsql.dll could not be found. Please ensure that the Assemblies needed to communicate with PostgreSQL are in the Global Assembly Cache or in a location that NHibernate can use System.Type.GetType(string) to load the types from.]
NHibernate.Driver.NpgsqlDriver..ctor() +105

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) +0
System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary settings) +107

[HibernateException: Could not create the driver from NHibernate.Driver.NpgsqlDriver.]
NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary settings) +184
NHibernate.Connection.ConnectionProvider.Configure(IDictionary settings) +92
NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider(IDictionary settings) +289
NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary properties) +848
NHibernate.Cfg.Configuration.BuildSessionFactory() +29
Cuyahoga.Core.Service.SessionFactory.RegisterCoreClasses() in E:\downloads\Cuyahoga-0.9.0-src\Core\Service\SessionFactory.cs:92
Cuyahoga.Core.Service.SessionFactory..ctor() in E:\downloads\Cuyahoga-0.9.0-src\Core\Service\SessionFactory.cs:25
Cuyahoga.Core.Service.SessionFactory..cctor() in E:\downloads\Cuyahoga-0.9.0-src\Core\Service\SessionFactory.cs:15

[TypeInitializationException: The type initializer for "Cuyahoga.Core.Service.SessionFactory" threw an exception.]
Cuyahoga.Core.Service.SessionFactory.GetInstance() +0
Cuyahoga.Core.Util.DatabaseUtil.GetNHibernateSessionFactory() in E:\downloads\Cuyahoga-0.9.0-src\Core\Util\DatabaseUtil.cs:153
Cuyahoga.Core.Util.DatabaseUtil.GetCurrentDatabaseType() in E:\downloads\Cuyahoga-0.9.0-src\Core\Util\DatabaseUtil.cs:32
Cuyahoga.Core.Service.DatabaseInstaller..ctor(String installRootDirectory, Assembly assembly) in E:\downloads\Cuyahoga-0.9.0-src\Core\Service\DatabaseInstaller.cs:88
Cuyahoga.Web.Global.Application_Start(Object sender, EventArgs e) in E:\downloads\Cuyahoga-0.9.0-src\Web\Global.asax.cs:29
# martijnb 3/11/2006 4:43 AM
dennisThe IDbCommand and IDbConnection implementation in the Assembly Npgsql.dll could not be found. Please ensure that the Assemblies needed to communicate with PostgreSQL are in the Global Assembly Cache or in a location that NHibernate can use System.Type.GetType(string) to load the types from.]

This means that the Npgsql driver cannot be found. Make sure Npgsql.dll and Mono.Security.dll are in the Web\bin directory. When compiling from source, this step has to be done manually because most of the times, Npgsql is not installed in the Global Assembly Cache.
# dennis 3/14/2006 12:00 PM
Thanks. That did it.