[Mono-list] Npgsql sample does not run, if manually compiled

manfred.braun manfbraun at manfbraun.de
Sat Oct 30 10:00:13 EDT 2010

Hi All !

I am just experimental working on the sample shown
[http://www.mono-project.com/PostgreSQL] for postgres. The program compiles
fine, this way:

# gmcs -debug+ -t:exe NpgSqlTest.cs -r:System.Data -r:Npgsql

but crashes with this message:

# mono --debug NpgSqlTest.exe

Unhandled Exception: Npgsql.NpgsqlException:
Connection refused
  at Npgsql.NpgsqlClosedState.Open (Npgsql.NpgsqlConnector context)
  at Npgsql.NpgsqlConnector.Open () [0x00000] 
  at Npgsql.NpgsqlConnectorPool.GetPooledConnector (Npgsql.NpgsqlConnection
Connection) [0x00000] 

The completely unexpected thing is:If I make a project with SharpDevelop the
program [without source changes!] compiles AND runs !!!!!!!!!!!!!!!!! It is
NOT a "connection refused" issue [at the same time, I am connected].

Anyone any ideas, what happening here?

I am just in a early beginner situation, where I expect all [simple] proggis
to compile and run from the commandline. This looks like missing a compiler
switch [I think, I tried them all], a defined environment or something like

I am using:

debian lenny, 2.6.26-2-686
mono 1.9.1, containing corelib 2.0

Any help would be really great!


More information about the Mono-list mailing list