Search code examples
sql-serverentity-framework.net-framework-versionpackage-manager-console

Install package Microsoft.EntityFrameworkCore.SqlServer for .net 4.5.2


I'm trying to install the package Microsoft.EntityFrameworkCore.SqlServer but in PMC I got the following error message:

Install-Package : Could not install package 'Microsoft.EntityFrameworkCore.SqlServer 2.2.6'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. At line:1 char:1 + Install-Package Microsoft.EntityFrameworkCore.SqlServer + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

How can I install it for .NET Framework 4.5.2?


Solution

  • You can't.

    Entity Framework Core 2.x only runs on .NET Standard 2.0, meaning you need to target at least .NET Framework 4.6.1.