Valentin Kuzub
Valentin Kuzub

Reputation: 12093

Npgsql - Specified method is not supported

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.

Upvotes: 1

Views: 1540

Answers (1)

plodoc
plodoc

Reputation: 2803

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.

Upvotes: 2

Related Questions