I am developing an Angular 6 application in dotNet Core 2.1.
Everything is working flawlessly, until I got to setting up EFCore.
All my models are defined and context created. Running dotnet ef migrations add InitialCreate
gives me the "The specified framework 'Microsoft.NETCore.App', version '2.1' was not found" error.
I have searched and read all the posts I could find that has this error across various versions of dotNet Core. Nothing is working to resolve this issue for me.
I have various versions of dotNet Core App installed. Looking at "C:\Program Files\dotnet\shared\Microsoft.NETCore.App" I have the following:
-1.0.4
-1.0.5
-1.1.1
-1.1.2
-2.0.0
-2.0.3
-2.0.5
-2.0.6
-2.0.7
-2.0.9
-2.1.0
-2.1.4
-2.1.5
-2.1.6
"C:\Program Files\dotnet" appears as the first path in my System PATH variable.
Downgrading all the projects in my solution to dotNet Core 2.0, running the command results in exactly the same error, referring to version 2.0.
Any advise would be greatly appreciated...
The csproj file for my EF project is as follows:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\*********.Contracts\*********.Contracts.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="System">
<HintPath>System</HintPath>
</Reference>
<Reference Include="System.Data">
<HintPath>System.Data</HintPath>
</Reference>
<Reference Include="System.Xml">
<HintPath>System.Xml</HintPath>
</Reference>
</ItemGroup>
</Project>
dotnet ef
. (I assume that's in the project where you also have your EF classes, e.g. theDbContext
.) – Marconigraphdotnet ef
command to verify the installation? – Maximomaximum--project
and--startup-project
, and also add--verbose
option? – Maximomaximum