.Net Core 3.0 Preview 8 项目 (NU1202) 上的管道 Nuget 还原失败 [英] Pipeline Nuget restore failing on .Net Core 3.0 Preview 8 project (NU1202)

查看:24
本文介绍了.Net Core 3.0 Preview 8 项目 (NU1202) 上的管道 Nuget 还原失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将一个项目从 netcoreapp2.2 更新到 netcoreapp3.0,并使用 Preview8 SDK 以及 Microsoft.EntityFrameworkCore.SqlServer、工具和设计.

I updated a project from netcoreapp2.2 to netcoreapp3.0 and use Preview8 SDK as well as Microsoft.EntityFrameworkCore.SqlServer, tools, and design.

我可以在本地构建和运行我的项目,只需找到 (VS 2019).但是当我尝试使用 Azure DevOps 进行部署时,Nuget 还原会出现以下错误:

I can build and run my projects locally just find (VS 2019). But when I try to deploy with Azure DevOps, the Nuget restore gives this error:

NU1202:包 Microsoft.EntityFrameworkCore.SqlServer 3.0.0-preview8.19405.11 与 netcoreapp3.0 (.NETCoreApp,Version=v3.0) 不兼容.包 Microsoft.EntityFrameworkCore.SqlServer 3.0.0-preview8.19405.11 支持:netstandard2.1 (.NETStandard,Version=v2.1)

NU1202: Package Microsoft.EntityFrameworkCore.SqlServer 3.0.0-preview8.19405.11 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.EntityFrameworkCore.SqlServer 3.0.0-preview8.19405.11 supports: netstandard2.1 (.NETStandard,Version=v2.1)

对 EntityFrameworkCore 包的每次引用都会导致该错误.

Every reference to an EntityFrameworkCore package will result in that error.

我正在通过 global.json 将管道中的 .Net Core SDK 设置为 Preview8.

I'm setting the .Net Core SDK in the pipeline to Preview8 via a global.json.

我有一个 NuGet 工具安装程序任务,引入了最新版本,还有一个针对我的解决方案运行的 Nuget Restore 任务命令.

I have a NuGet tool installer task, bringing in the latest version, and a Nuget Restore task command running against my solution.

推荐答案

我的问题是我使用的是 Nuget Restore.将其更改为 dotnet restore 就成功了.

My problem was that I was using the Nuget Restore. Changing it to dotnet restore made the trick.

这篇关于.Net Core 3.0 Preview 8 项目 (NU1202) 上的管道 Nuget 还原失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆