dotnet / dotnet/efcore

Bundle-Migration "failed to restore project" or "it was not possible to find any compatible framework version"

Open
#27,317 11 comments 0 reactions 0 assignees View on GitHub
area-tools customer-reported
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

We're trying to get the Bundle-Migration to work so we can integrate migrations in our CI/CD pipelines. We are however facing some issues.

**When using the dotnet CLI, we're getting the following 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:
3.1.22 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:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.0.0&arch=x64&rid=win10-x64
```

**When using the Package Manager Console Bundle-Migration command**
```
Failed to restore xxx.csproj (in 2,51 sec).
Failed to restore xxx.csproj (in 2,51 sec).
Restored xxx.csproj (in 2,51 sec).
Restored xxx.csproj (in 2,51 sec).
Restored xxx.csproj (in 2,51 sec).
Restored C:\Users\xxx\AppData\Local\Temp\zbp3cxwh.dds\efbundle.csproj (in 2,69 sec).
Microsoft.EntityFrameworkCore.Tools.CommandException: Build failed. Use --verbose to see errors.
at Microsoft.EntityFrameworkCore.Tools.Commands.MigrationsBundleCommand.Execute(String[] args)
at Microsoft.EntityFrameworkCore.Tools.Commands.CommandBase.<>c__DisplayClass0_0.b__0(String[] args)
at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)
at Microsoft.EntityFrameworkCore.Tools.Program.Main(String[] args)
```

We do not understand why the dotnet CLI is complaining about .NET Core 2.0.0 as we are not referencing any packages that require this framework.
On the other hand our projects restore and build just fine, no issues. So we also do not quite understand why ef-tools cannot restore some projects.

Versions:
- VS2022 on Windows 11
- All projects are .NET 6
- NuGet packages are up-to-date (v6.0.1)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.