简体   繁体   中英

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. I create a Asp.Net Core app (using Visual Studio) targeting netcoreapp3.1 . I test it and it works fine. But when I commit it to CI the build fails to get the 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? What am I missing?

Update

The CI is Azure Devops Pilelines and the agents are Windows machines that have Visual Studio 2017 installed. .Net core sdk 3.1 is not installed on the agents

Method 1: Add the following task in your 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

Note: Make sure this should be the first task of the pipeline configured

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM