neisbut / Npgsql.Bulk

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

System.MissingMethodException after migration to .Net 6 #69

Open KovarikJiri opened 2 years ago

KovarikJiri commented 2 years ago

When I migrated the project to .Net 6 and Npgsql.Bulk into version 0.10.1 then I received the following exception. System.MissingMethodException: Method not found: 'Microsoft.EntityFrameworkCore.Metadata.IEntityType Microsoft.EntityFrameworkCore.ModelExtensions.FindEntityType(Microsoft.EntityFrameworkCore.Metadata.IModel, System.Type)'. at Npgsql.Bulk.NpgsqlHelper.GetTableSchema(DbContext context, Type t) at Npgsql.Bulk.NpgsqlBulkUploader.GetEntityInfo[T]() at Npgsql.Bulk.NpgsqlBulkUploader.Import[T](IEnumerable1 entities) `

vaibhavpingle commented 2 years ago

@neisbut - First of all thank you for all your effort and hardwork maintaining this library and making it available for public use. However, I am in need of this urgently. I am sure I can slap together something pretty quickly, but wanted to leverage this great library. How soon do you anticipate this issue to be resolved?

KovarikJiri commented 2 years ago

I have found the workaround to not use the NuGet package but build the library locally and attach the generated DLL into my project.

martea commented 2 years ago

@KovarikJiri simply dotnet build src/*dotnet6/*csproj or how did you approach the building?

KovarikJiri commented 2 years ago

@martea My approach was to build the src/Npgsql.Bulk.DotNet6 project in Rider IDE with Release configuration so I would say your solution should work when you specify the release configuration dotnet build src/*dotnet6/*csproj -c Release. Then you can find dll in folder src\Npgsql.Bulk.DotNet6\bin\Release\net6.0

Colt2205 commented 2 years ago

Any idea if there's been headway on getting this issue resolved? KovarikJiri's work around can likely work but I'd want to keep to using the nuget package if possible.

adisadi commented 2 years ago

Please update the Nuget Package! The current version works....