[Mono-devel-list] Npgsql - null reference exception during opening connection

Francisco Figueiredo Jr. fxjrlists at yahoo.com.br
Tue May 18 21:32:05 EDT 2004

Kamil Skalski wrote:
> I've encountered an exception during opening of NpgsqlConnection. The stack 
> trace is following:
> sql.n:17:9: debug: System.NullReferenceException: A null value was found where 
> an object instance was required.
> in (unmanaged) /usr/lib/libmono.so.0(mono_class_from_name+0xd7) [0x4011c2a8]
> in (unmanaged) /usr/lib/libmono.so.0 [0x400eb9a3]
> in (unmanaged) /usr/lib/libmono.so.0 [0x400edbcf]
> in (unmanaged) /usr/lib/libmono.so.0 [0x400ee2eb]
> in <0x00066> System.Net.Dns:GetHostByName (string)
> in <0x00032> System.Net.Sockets.TcpClient:Connect (string,int)
> in <0x00026> System.Net.Sockets.TcpClient:.ctor (string,int)
> in <0x00080> Npgsql.NpgsqlClosedState:Open (Npgsql.NpgsqlConnection)
> in <0x00662> Npgsql.NpgsqlConnection:Open ()
> in <0x0004f> (wrapper remoting-invoke-with-check) Npgsql.NpgsqlConnection:Open 
> ()
> my connection string is
> "Server=localhost;Database=test;User ID=postgres;Password=sql;"
> The starngest thing is that I have another application, where exactly the same 
> connection string succedes and I can query database without problem. I'm not 
> yet able to find any related differences between those two application - 
> there is no network / database specific code at all in them. 
> I also tried Server= but the behavior is identical - I've one 
> application succesfully opening connection and other failing.
> I'm still trying to reproduce behavior in some small example, but maybe 
> anybody has any suggestions? 

Hi Kamil.

I'm also getting this behavior when runing nunit-tests. I still don't 
know why this is happening too. Please, if you find something about it, 
let me know.


Francisco Figueiredo Jr.
Membro Fundador do Projeto MonoBrasil - MonoBrasil Project Founder Member

"Science without religion is lame;
religion without science is blind."

                   ~ Albert Einstein

More information about the Mono-devel-list mailing list