I've just installed .NET 6 SDK and updated all my projects to use target net6.0, but when I try to create a new migration with the dotnet tool I get:
.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ApplicationIcon>assets-logo.ico</ApplicationIcon>
<RootNamespace>LC.Assets</RootNamespace>
<Authors>Stein Lundbeck</Authors>
<Company>Lundbeck Consulting</Company>
<Product>LC Assets</Product>
<Copyright>2021</Copyright>
</PropertyGroup>
<ItemGroup>
<Content Include="assets-logo.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LC.Components.Core\LC.Components.Core.csproj" />
<ProjectReference Include="..\LC.Components\LC.Components.csproj" />
</ItemGroup>
</Project>
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:
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.
I've updated the dotnet-ef tool to version 6.0.0, so I don't know what it is that still target the 2.0.0 version.
Tool 'dotnet-ef' was successfully updated from version '5.0.4' to version '6.0.0'.
Any ideas?
I just ran into the exact same issue.
Rather than installing Microsoft.NETCore.App 2.0.0., I installed the Entity Framework Core Design package:
dotnet add package Microsoft.EntityFrameworkCore.Design
It made the error go away for me.
Note: I came upon the solution after remembering that following the EF Getting Started guide (https://learn.microsoft.com/en-us/ef/core/get-started/overview/first-app?tabs=netcore-cli) had me install the Design package and didn't throw the error when I followed the guide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With