enter image description here
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>net461</TargetFramework>
to
<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.
enter image description here
The following helped me to add the missing tools to .net core 3.1
Install-Package Microsoft.EntityFrameworkCore.Tools
Update-Package Microsoft.EntityFrameworkCore.Tools
From this Blog
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