FileContextCore icon indicating copy to clipboard operation
FileContextCore copied to clipboard

Does not work with EF Core 5.0.0

Open manisto opened this issue 5 years ago • 1 comments

I Just updated my project from .NET Core 3.1 to .NET 5.0. While updating, I also updated EF Core packages (3.1.7 -> 5.0.0). After updating, I get the following error:

System.TypeLoadException: Method 'CommitTransactionAsync' in type 'FileContextCore.Storage.Internal.FileContextTransactionManager' from assembly 'FileContextCore, Version=3.4.0.0, Culture=neutral, PublicKeyToken=165cac099da39c78' does not have an implementation.
   at Microsoft.Extensions.DependencyInjection.FileContextServiceCollectionExtensions.AddEntityFrameworkFileContextDatabase(IServiceCollection serviceCollection)
   at FileContextCore.Infrastructure.Internal.FileContextOptionsExtension.ApplyServices(IServiceCollection services)
   at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.ApplyServices(IDbContextOptions options, ServiceCollection services)
   at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.<>c__DisplayClass4_0.<GetOrAdd>g__BuildServiceProvider|3()
   at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.<>c__DisplayClass4_0.<GetOrAdd>b__2(Int64 k)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.GetOrAdd(IDbContextOptions options, Boolean providerRequired)
   at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
   at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
   at Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.get_EntityFinderFactory()
   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_Finder()
   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.FindAsync(Object[] keyValues)
   at Recipes.Infrastructure.Repositories.CategoryRepository.GetCategoryAsync(Int32 categoryId) in C:\workspace\private\recipe-printer\Recipes.Infrastructure\Repositories\CategoryRepository.cs:line 25
   at Recipes.Application.Commands.SaveCategoryCommandHandler.HandleAsync(SaveCategoryCommand command) in C:\workspace\private\recipe-printer\Recipes.Application\Commands\SaveCategoryCommandHandler.cs:line 23
   at Recipes.Api.Controllers.CategoriesController.Save(SaveCategoryCommand command) in C:\workspace\private\recipe-printer\Recipes.Api\Controllers\CategoriesController.cs:line 48
   at lambda_method17(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

If I downgrade Microsoft.EntityFrameworkCore.Design to 3.1.7, the error goes away.

manisto avatar Nov 24 '20 09:11 manisto

.NET 7 / EFCore 7 still manifest this problem.

mc0re avatar Jan 29 '23 14:01 mc0re