efcore: Error creating DB migrations on 3.0.0
From @deepak-khopade-isdr on Wednesday, October 16, 2019 8:56:59 PM
Getting error creating DB migrations after upgrading to . NET Core 3.0.0
I recently updated .NET Core Framework on my linux docker containers from 1.1.0 to 3.0.0 and when trying to create migrations getting error for compatibility.
General
Running .NET Core 3.0.0 container with Ubuntu 18.04 (Linux).
Command: dotnet ef migrations add Initial
Output:
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.0.7' was not found.
- The following frameworks were found:
3.0.0 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The .NET Core frameworks can be found at:
- https://aka.ms/dotnet-download
Platform info from 2 commands:
docker@03dda20017a9:/dotnet/app$ dotnet --version
3.0.100
docker@03dda20017a9:/dotnet/app$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/3.0.100/
Host (useful for support):
Version: 3.0.0
Commit: 95a0a61858
.NET Core SDKs installed:
3.0.100 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
docker@03dda20017a9:/dotnet/app$
Do I need to install SDK 2.0.7?
Copied from original issue: dotnet/core#3646
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 23 (9 by maintainers)
@fergalmoran : my 2 cents on this; make sure you get
.NET Core SDKs
as both2.1
and3.0
installed alongside. And same for.NET Core
runtime.See my
dotnet --info
output.dotnet-ef became part of SDK in 2.1 https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-2.1#command-line-tool-dotnet-ef-included-in-net-core-sdk
And it became global tool in 3.0 https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-3.0/breaking-changes#dotnet-ef
May be this too
@deepak-khopade-isdr The project is pulling in a mixture of 2.2 and 3.0 EF packages. This generally doesn’t work. For example,
Pomelo.EntityFrameworkCore.MySql
is based on EF Core 2.2. A 3.0 version is available in preview.You should also check all your other 2.2 packages.