neisbut / Npgsql.Bulk

Helper for performing COPY (bulk insert and update) operation easily, using Entity Framework + Npgsql.
MIT License
105 stars 44 forks source link

Problem with bulk operation #62

Open Prutenskiy opened 3 years ago

Prutenskiy commented 3 years ago

I have app witch configured as net472;netcoreapp3.1 I use Npgsql 4.*(try any vertions) for work with DB INSERT\UPDATE worked fine, but when I try use bulk operation then on start app under net472 have this exception "Void Npgsql.Bulk.NpgsqlBulkUploader..ctor(Microsoft.EntityFrameworkCore.DbContext)".

For bulk operation I try like this:

using (var ctx = new MyContext(NpgsqlDbContextOptionsExtensions.UseNpgsql(new DbContextOptionsBuilder(), _connectionStr).Options)) { var d = new List();

        var uploader = new NpgsqlBulkUploader(ctx);
        uploader.Insert(d, Npgsql.Bulk.InsertConflictAction.Update<UserByRole>(........));
    }

Call stack: at PGTestCommand.Test.Run() in C:...\Program.cs:line 45 at PGTestCommand.Program.Main(String[] args) in C:...\Program.cs:line 13

Exception Message: Method not finde: "Void Npgsql.Bulk.NpgsqlBulkUploader..ctor(Microsoft.EntityFrameworkCore.DbContext)".

This problem only when start app under NET472. Same code under core work fine.

Have any some advise?

P.S. I download master, build project (only build Npgsql.Bulk), connect Npgsql.Bulk.dll to my test app and run. Evrething work in both mode(core and net). Maybe some problem in nuget packages?

neisbut commented 2 years ago

Hi @Prutenskiy , I update package today, please try again.