I'm trying to use entity frame work core and have a fresh asp.net core project open. When i attempt to install Microsoft.EntityFrameworkCore.SqlServer through nuget package manager i get the following error.
Package Microsoft.EntityFrameworkCore.SqlServer 3.0.0 is not compatible with net461 (.NETFramework,Version=v4.6.1). Package Microsoft.EntityFrameworkCore.SqlServer 3.0.0 supports: netstandard2.1 (.NETStandard,Version=v2.1)
When i click this i get sent to .csproj file.
In that file i changed the target framework from
<TargetFramework>netstandard2.1 </TargetFramework> as the error implies.
Doing this gets rid of the error but when i use the command 'add-migration' in package manager console i get this error.
"The term 'add-migration' is not recognized as the name of a cmdlet"
I'm not sure what to do going forward. Please help. I hope i've explained the issue clearly.
Deleting the project.assets file or updating nuget package manger and using the the command "enable-migrations" hasnt worked either.
I have faced the same issue and these steps fixed it..
1) Tools -> Nuget Package Manger -> Package Manager Settings
2) General Tab
3) Clear All NuGet Cache(s)
4) Restart Visual Studio