我在c#中有一个简单的应用程序:
NpgsqlConnection conn = new NpgsqlConnection("Server=127.0.0.1;Port=5432;User Id=joedata;Password=joedata;Database=joedata;");
conn.Open();
conn.Close();
使用以下信息在conn.Open()的调试模式下抛出异常:
Npgsql.NpgsqlException: Failed to establish a connection to '127.0.0.1'. ---> System.Exception: Failed to establish a connection to '127.0.0.1'.
at Npgsql.NpgsqlClosedState.Open (Npgsql.NpgsqlConnector context) [0x00101] in /Users/fxjr/Desenvolvimento/ProjetosOpenSource/Npgsql/NpgsqlSourceRelease/Npgsql2/src/Npgsql/NpgsqlClosedState.cs:171
--- End of inner exception stack trace ---
at Npgsql.NpgsqlClosedState.Open (Npgsql.NpgsqlConnector context) [0x00264] in /Users/fxjr/Desenvolvimento/ProjetosOpenSource/Npgsql/NpgsqlSourceRelease/Npgsql2/src/Npgsql/NpgsqlClosedState.cs:232
at Npgsql.NpgsqlConnector.Open () [0x00039] in /Users/fxjr/Desenvolvimento/ProjetosOpenSource/Npgsql/NpgsqlSourceRelease/Npgsql2/src/Npgsql/NpgsqlConnector.cs:685
at Npgsql.NpgsqlConnectorPool.GetPooledConnector (Npgsql.NpgsqlConnection Connection) [0x00169] in /Users/fxjr/Desenvolvimento/ProjetosOpenSource/Npgsql/NpgsqlSourceRelease/Npgsql2/src/Npgsql/NpgsqlConnectorPool.cs:434
此错误仅在调试模式下发生(带断点)。请帮忙。
我正在使用:
MonoDevelop v3.0.5
Npgsql2.0.12彬mono2.0
单声道2.10.9 for Windows