Error in running migrations in v14.2.0-rc.1 Pre-release
PM> Update-Database
Build started...
Build succeeded.
System.TypeLoadException: Method 'Identifier' in type 'Microsoft.EntityFrameworkCore.Design.Internal.CSharpHelper' from assembly 'Microsoft.EntityFrameworkCore.Design, Version=8.0.11.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.
at Microsoft.EntityFrameworkCore.Design.DesignTimeServiceCollectionExtensions.<>c__DisplayClass0_0.<AddEntityFrameworkDesignTimeServices>b__0(ServiceCollectionMap services)
at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.TryAddProviderSpecificServices(Action`1 serviceMap)
at Microsoft.EntityFrameworkCore.Design.DesignTimeServiceCollectionExtensions.AddEntityFrameworkDesignTimeServices(IServiceCollection services, IOperationReporter reporter, Func`1 applicationServiceProviderAccessor)
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.CreateServiceCollection(DbContext context)
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.Build(DbContext context)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String connectionString, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String connectionString, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Method 'Identifier' in type 'Microsoft.EntityFrameworkCore.Design.Internal.CSharpHelper' from assembly 'Microsoft.EntityFrameworkCore.Design, Version=8.0.11.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.
1 Answer(s)
-
0
Hi @ajayak
Thank you for your feedback.
The issue you are facing is a dependency conflict. It's caused by the
AspNetCore.HealthChecks.UIpackage in yourWeb.Coreproject, which requiresMicrosoft.EntityFrameworkCore.Designversion8.0.11There are two alternative ways to resolve this problem:
Alternative 1: Use the
dotnet efCommandWithout changing your current package configuration, you can create migrations directly from the command-line interface (CLI) using the
dotnet ef migrationscommand.Alternative 2: Upgrade the Package Version
Another method is to manually update the
Microsoft.EntityFrameworkCore.Designpackage in the affected projects:Web.Core,Host,Mvc, andPublic.You can upgrade this package to version
9.0.5to ensure compatibility and add it as a top-level dependency to your projects. This action will override the transitive version inherited from another package, forcing the project to use the newer version you specified.Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)