Error while Add-Migration "Initialize" in .NET 6 Entity Framework

Rijwan Ansari 746 Reputation points MVP
2022-02-03T07:21:33.487+00:00

It was not possible to find any compatible framework version The framework 'Microsoft.NETCore.App', version '2.0.0' (x64) was not found.

  • The following frameworks were found: 3.1.22 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 5.0.13 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 6.0.1 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,119 questions
0 comments No comments
{count} votes

Accepted answer
  1. satya karki 986 Reputation points MVP
    2022-02-05T14:03:15.113+00:00

    Hi @Rijwan Ansari ,

    I think the displayed error message in .NET 6 is not correct. I had the same issue a few days ago.

    The issue was, my startup project was chosen wrong.
    Fixing:
    I fixed it by setting the web project as a startup. You can try changing the startup project into the correct one.

    6 people found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Zhi Lv - MSFT 32,006 Reputation points Microsoft Vendor
    2022-02-04T03:09:46.597+00:00

    Hi @Rijwan Ansari ,

    The framework 'Microsoft.NETCore.App', version '2.0.0' (x64) was not found.
    You can resolve the problem by installing the specified framework and/or SDK.

    The specified framework can be found at:

    The error message is clear, you can download and install the .NET Core 2.0 Runtime from this website or from here. You can try it.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Dillion


  2. Rijwan Ansari 746 Reputation points MVP
    2022-02-06T12:47:40.41+00:00

    Thank @satya karki

    Yes, you are correct. Message is incorrect. After changing the start-up project, it fixed.


  3. Armando Martí 1 Reputation point
    2022-06-09T12:04:20.13+00:00

    Add this to the 'Infrastructure' proyect:

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

    0 comments No comments