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

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

问题描述

我将项目从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项目上的管道Nuget还原失败(NU1202)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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