Npgsql - Specified method is not supported

霸气de小男生 提交于 2019-12-12 23:01:22

问题


This might be somehow connected to this other issue I had with FNH.

Fluent NHibernate cannot load MySql.Data from GAC in debug mode of a test

Generally I got a simple test that runs following code first:

FluentConfiguration config = Fluently
    .Configure()
    .Database(
        PostgreSQLConfiguration.Standard.ConnectionString(c => c.FromConnectionStringWithKey("PostgreSQLConnectionString")))
    .Mappings(m => m.FluentMappings.AddFromAssemblyOf<MyMapping>());

s_SessionSource = new SessionSource(config);

When I am not running it in Debug (just run tests) it works fine.

When I try to debug i get NotSupportedException: Second line throws that (new SessionSource one)

Specified method is not supported. at Npgsql.NpgsqlConnection.GetSchema(String collectionName, String[] restrictions) in C:\projects\Npgsql2\src\Npgsql\NpgsqlConnection.cs:line 970

Why in debug throws exception, but when ran without debug no errors? I am puzzled with this.. Notice again, when I just run code it works fine, it accesses postgre db no prob.

Notice this is not difference between Release and Debug, its Debug in both cases, but in first case I run debug, but in second I run code without debugging.

EDIT: found this question : http://pgfoundry.org/forum/message.php?msg_id=1003008 appears to be my exact issue, but only occurs in debugging.


回答1:


Npgsql.NpgsqlConnection.GetSchema throws NotSupportedException when its collectionName argument is unknown. You should perhaps upgrade to the latest patch that supports the NHibernate test suite.

The exception must be catched by Fluent, but an attached debugger will stop on it.



来源:https://stackoverflow.com/questions/7289061/npgsql-specified-method-is-not-supported

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!