Grasshopper component that integrates entity framework core + postgresql

Hi,

I am struggling with the integration of Entity Framework Core and postgresql.
The need is to write a grasshopper component capable of loading data from a postgresql database.

Setup :

  • Rhino 7 WIP (Rhino 7 SR0 2020-11-4 (Rhino 7 BETA, 7.0.20309.06003, Git hash:master @ 368ab021c8426434a95c36999f545f918e04df2c)
  • Visual Studio 2019
  • New Grasshopper component
    — Targets dotnet 4.8
    — Installed nuget package “Npgsql.EntityFrameworkCore.PostgreSQL” version 3.1.4
    — Only one line of code in the SolveInstance method
    var a = typeof(Npgsql.NpgsqlBinaryExporter);

An error message occurs during the execution :


Sorry it is in french, but it says that the method ‘DisposeAsync’ of type ‘Npgsql.NpgsqlBinaryExporter’ from assembly ‘Npgsql, Version=4.1.3.1, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7’ does not have an implementation.

I have tried different versions with no luck.
Also when looking at the loaded assemblies during the SolveInstance, Npqsql is nowhere to be found.
The same postgresql package in a console app targeting 4.8 works.

Does anyone have any idea what the problem could be?

Where do you store the Npqsql package? Is it installed into the system GAC?

By default Grasshopper loads DLLs by memory-COFF, which causes trouble in referencing some libraries.

Loading by memory-coff is disabled.
image

And no the package is not installed in the GAC.
I expect Grasshopper to load the libraries from the bin folder where the component has been compiled.