作者:剡亚军_191 | 来源:互联网 | 2023-02-01 22:15
微软刚刚宣布 Entity Framework Core 2.0现在将在.NET Standard 2.0上运行.
.Net Standard 2.0与.NET Framework 4.6.1兼容(如果这是正确的术语).
但是,当我尝试添加最新的NuGet包时,我收到一个错误,告诉我我使用的是错误的版本:
Install-Package : Could not install package
'Microsoft.EntityFrameworkCore.SqlServer 2.0.0-preview2-25332'. You are
trying to install this package into a project that targets
'.NETFramework,Version=v4.6.1', but
the package does not contain any assembly references or content files
that are compatible with that framework.
如果根据公告,我可以使用带有.NET Framework 4.6.1的EF Core 2.0,有人可以解释一下,如果可能的话,举个例子来看看它是什么样的.
1> user281921..:
为了在.NET 4.6.1项目中包括.NET Standard 2.0库,您似乎需要包括NetStandard.Library.NetFramework NuGet包。
packages.config文件中当前版本的示例:
不推荐使用此软件包,而推荐使用Nuget 3.6+