Npgsql.Bulk icon indicating copy to clipboard operation
Npgsql.Bulk copied to clipboard

Problem with bulk operation

Open Prutenskiy opened this issue 3 years ago • 1 comments

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?

Prutenskiy avatar Apr 30 '21 08:04 Prutenskiy

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

neisbut avatar Dec 10 '21 09:12 neisbut