简体   繁体   English

NU1107:Microsoft.EntityFrameworkCore.SqlServer 的 .Net Core 2.1 兼容替代品?

[英]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

Update更新

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.

相关问题 错误 NU1202 Microsoft.EntityFrameworkCore.SqlServer 5.0.0 package 与 net50 不兼容 - Error NU1202 Microsoft.EntityFrameworkCore.SqlServer 5.0.0 package is not compatible with net50 Microsoft.EntityFrameworkCore.SqlServer依赖关系无法解决 - Microsoft.EntityFrameworkCore.SqlServer dependency could not be resolved 错误NU1107版本冲突检测到Microsoft.CodeAnalysis.Common - Error NU1107 Version conflict detected for Microsoft.CodeAnalysis.Common 无法找到无法找到包“Microsoft.EntityFrameworkCore.SqlServer” - Unable to find Unable to find package 'Microsoft.EntityFrameworkCore.SqlServer' Nuget 找不到包(Microsoft.EntityFrameworkCore.SqlServer) - Nuget pacakage (Microsoft.EntityFrameworkCore.SqlServer) can not found 使用复合键在 Microsoft.EntityFrameworkCore.SqlServer 5.0.8 C# 中进行更新 - Upsert in Microsoft.EntityFrameworkCore.SqlServer 5.0.8 C# with a composite key Microsoft.EntityFrameworkCore.SqlServer - 数据库未在 context.Database.Migrate() 上更新; - Microsoft.EntityFrameworkCore.SqlServer - Database not updating on context.Database.Migrate(); 在单元测试项目中检测到NU1107版本冲突 - NU1107 Version conflict detected in Unit Test project NU1107-更新nuget包时的Xamarin Android错误 - NU1107 - Xamarin Android erro when updating nuget packages .Net Core 2.0 与.Net Core 2.1 兼容 - .Net Core 2.0 compatible with .Net Core 2.1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM