Skip to content

Package Manager Console Error with Multiple Startup Projects #26871

@SoftCircuits

Description

@SoftCircuits

I recent upgraded all the projects in my solution from .NET 5.0 to .NET 6.0.

The solutions builds and runs without error.

But when I attempt to add a migration, I get an error.

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:
    5.0.12 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    6.0.0 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:

The problem, as it turns out, is that I have two projects set as the Startup Project: A client application and Web API application. If I set only the client application as the Startup Project, then the migration adds without error.

So I'm able to move forward but I do not understand the original error. Why is it looking for version 2 of Microsoft.NETCore.App? And why did upgrading to .NET 6.0 make this version no longer available? Is this a bug?

Include provider and version information

EF Core version:
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 6.0
Operating system: Windows 10
IDE: Visual Studio 2022 17.0.1

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions