Base solution for your next web application
Open Closed

Migration issues after latest update #12520


User avatar
0
Prasanthtp created

Hi I recently updated my solution to version 14.2.1 of MVC JQuery. Everything is working fin . But when I trytop add a newfieldd in the DB using migratio . I got an error.

Add-Migration AddedImagesJson 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.

Upon investigation, I have noticed that in the latest code Microsoft.EntityFrameworkCore.Design was removed from web.mvc project

  • <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference>*

I included this package again in the web.mvc project, and it started working again.

  • <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.5"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference>*

I have also noticed a version mismatch for this package in different projects. May be not a major issue.

Another thing is, following variable has to be protected, not private.

protected readonly ILocalizationSource _localizationSource = localizationManager.GetSource(BookingsHiveConsts.LocalizationSourceName);

I just want to share my findings. It is not a support ticket. You can close it once you've reviewed it.

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

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

    Hi @Prasanthtp

    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)