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

System.MissingMethodException after migration to .Net 6

Open KovarikJiri opened this issue 4 years ago • 6 comments

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) `

KovarikJiri avatar Dec 22 '21 16:12 KovarikJiri

@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?

vaibhavpingle avatar Jan 17 '22 15:01 vaibhavpingle

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

KovarikJiri avatar Jan 17 '22 15:01 KovarikJiri

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

martea avatar Feb 02 '22 08:02 martea

@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

KovarikJiri avatar Feb 02 '22 10:02 KovarikJiri

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.

Colt2205 avatar Apr 29 '22 16:04 Colt2205

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

adisadi avatar May 25 '22 19:05 adisadi