[英]Unable to find package Microsoft.NETCore.App with version (>= 3.1.0)
I have .NET Core SDK 3.1.200 installed on my local machine.我在本地机器上安装了 .NET Core SDK 3.1.200。 I create a Asp.Net Core app (using Visual Studio) targeting netcoreapp3.1
.我创建了一个针对netcoreapp3.1
的 Asp.Net Core 应用程序(使用 Visual Studio)。 I test it and it works fine.我测试了它,它工作正常。 But when I commit it to CI the build fails to get the nuget package:但是当我将它提交给 CI 时,构建无法获得 nuget package:
##[error]The nuget command failed with exit code(1) and error(NU1102: Unable to find package Microsoft.NETCore.App with version (>= 3.1.0)
- Found 81 version(s) in MyGet [ Nearest version: 3.0.0-preview8-28405-07 ]
- Found 73 version(s) in NuGet [ Nearest version: 2.2.8 ]
.NET Core 3.1 was released in December 2019 so why is the package not on nuget? .NET Core 3.1 于 2019 年 12 月发布,那么为什么 package 不在 nuget 上? What am I missing?我错过了什么?
Update更新
The CI is Azure Devops Pilelines and the agents are Windows machines that have Visual Studio 2017 installed. CI 是 Azure Devops Pilelines,代理是 Windows 安装了 Visual Studio 2017 的机器。 .Net core sdk 3.1 is not installed on the agents .Net core sdk 3.1 未安装代理
Method 1: Add the following task in your yaml方法一:在你的yaml中添加如下任务
steps:
- task: UseDotNet@2
displayName: 'Use .Net Core sdk 3.1.x'
inputs:
version: 3.1.x
Method 2:方法二:
If using template editor, add Use.Net Core
task and provide the version over there如果使用模板编辑器,请添加Use.Net Core
任务并提供那边的版本
Note: Make sure this should be the first task of the pipeline configured注意:确保这应该是配置管道的第一个任务
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.