[英]NU1107: .Net Core 2.1-compatible alternatives to Microsoft.EntityFrameworkCore.SqlServer?
I am following the Microsoft tutorial for creating an MVC application with .Net Core 3.1 .我正在按照 Microsoft 教程使用 .Net Core 3.1 创建 MVC 应用程序。 I'm using .Net Core 2.1 with Visual Studio 2017. My Visual Studio instance is managed by my company, so I'm not able to upgrade to .Net Core 3.1 because it requires Visual Studio 2019.
我在 Visual Studio 2017 中使用 .Net Core 2.1。我的 Visual Studio 实例由我的公司管理,因此我无法升级到 .Net Core 3.1,因为它需要 Visual Studio 2019。
On the step to install the NuGet package for SqlServer , I receive error NU1107 because the .NetCore version of the package does not match the version of my project.在为 SqlServer 安装 NuGet 包的步骤中,我收到错误 NU1107,因为包的 .NetCore 版本与我的项目版本不匹配。
Is there a way to resolve this error without installing .Net Core 3.1?有没有办法在不安装 .Net Core 3.1 的情况下解决这个错误? A different package to use perhaps?
也许使用不同的包?
Install-Package : NU1107: Version conflict detected for Microsoft.EntityFrameworkCore. Install/reference Microsoft.EntityFrameworkCore 3.1.0 directly to project MvcMovie to resolve this issue.
MvcMovie -> Microsoft.EntityFrameworkCore.SqlServer 3.1.0 -> Microsoft.EntityFrameworkCore.Relational 3.1.0 -> Microsoft.EntityFrameworkCore (>= 3.1.0)
MvcMovie -> Microsoft.AspNetCore.App 2.1.1 -> Microsoft.EntityFrameworkCore (>= 2.1.1 && < 2.2.0).
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore.SqlServer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Install-Package : Package restore failed. Rolling back package changes for 'MvcMovie'.
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore.SqlServer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
I ran into some more issues trying to follow a .Net Core 3 tutorial using a .Net Core 2.1 environment, and eventually figured out that I could use an older version of the tutorial!我在尝试使用 .Net Core 2.1 环境学习 .Net Core 3 教程时遇到了更多问题,最终发现我可以使用旧版本的教程! I blame banner-blindness.
我责怪横幅失明。
Right click your project and open "Manage Nuget Packages...".右键单击您的项目并打开“管理 Nuget 包...”。 (Highlighted below)
(以下突出显示)
Search for the Nuget Package, Microsoft.EntityFrameworkCore.SqlServer
, and change the version to an older 2.2 version.搜索 Nuget 包
Microsoft.EntityFrameworkCore.SqlServer
,并将版本更改为较旧的 2.2 版本。 Then install that version of the Nuget Package.然后安装该版本的 Nuget 包。 (Also highlighted)
(也突出显示)
This should fix your conflict with Microsoft.AspNetCore.App
.这应该可以解决您与
Microsoft.AspNetCore.App
的冲突。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.