Base solution for your next web application
Open Closed

14.2.1 Migration Issue #12485


User avatar
0
stanley5389 created

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(Action1 serviceMap) at Microsoft.EntityFrameworkCore.Design.DesignTimeServiceCollectionExtensions.AddEntityFrameworkDesignTimeServices(IServiceCollection services, IOperationReporter reporter, Func1 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. PM>

EntityFramework <Project Sdk="Microsoft.NET.Sdk"> <Import Project="....\common.props"></Import> <PropertyGroup> <TargetFramework>net9.0</TargetFramework> <AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> <RootNamespace>CoreSync</RootNamespace> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType> <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> </PropertyGroup> <ItemGroup> <PackageReference Include="Abp.ZeroCore.OpenIddict.EntityFrameworkCore" Version="10.2.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.5" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.5"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.5"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> </ItemGroup> <ItemGroup> <ProjectReference Include="..\CoreSync.Core\CoreSync.Core.csproj" /> </ItemGroup> </Project>

Web <Project Sdk="Microsoft.NET.Sdk.Web"> <Import Project="....\common.props"></Import> <PropertyGroup> <TargetFramework>net9.0</TargetFramework> <AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> <PreserveCompilationContext>true</PreserveCompilationContext> <AssemblyName>CoreSync.Web.Host</AssemblyName> <OutputType>Exe</OutputType> <PackageId>CoreSync.Web.Host</PackageId> <UserSecretsId>MyCompanyName-CoreSync-894FDFC1-6482-4A56-926A-3C46C9FE0329</UserSecretsId> <RootNamespace>CoreSync.Web</RootNamespace> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType> <GenerateDocumentationFile>False</GenerateDocumentationFile> </PropertyGroup> <ItemGroup> <Compile Remove="App_Data*" /> <Content Remove="App_Data*" /> <EmbeddedResource Remove="App_Data*" /> <None Remove="App_Data*" /> </ItemGroup> <ItemGroup> <Content Remove="wwwroot\swagger\ui\index.html" /> </ItemGroup> <ItemGroup> <None Include="app.config" /> <None Include="wwwroot\Plugins.gitkeep" /> <None Update="Dockerfile"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> <None Update="log4net.config"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> </None> <None Update="wwwroot***"> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> </None> </ItemGroup> <ItemGroup> <ProjectReference Include="..\CoreSync.Web.Core\CoreSync.Web.Core.csproj" /> </ItemGroup> <ItemGroup> <PackageReference Include="Abp.Castle.Log4Net" Version="10.2.0" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="wwwroot\swagger\ui\index.html" /> </ItemGroup> <ItemGroup> <Folder Include="wwwroot\Plugins&quot; /> </ItemGroup> </Project>

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

2 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @stanley5389

    This issue occurs because the HealthChecks package uses an older version of the Microsoft.EntityFrameworkCore.Design package. When performing migration operations, you should select the .*EntityFrameworkCore project as the Default Project in the Package Manager Console and also set it as the Startup Project.

    Another option is to install the Microsoft.EntityFrameworkCore.Design package at the top level of the web project you are using.

    If you have any further questions, please don’t hesitate to contact us.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    stanley5389 created

    Perfect. Thanks.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)