简体   繁体   中英

Azure devops gives NuGet package restore error for reference project

NuGet package restore error for the solution which have a mix of .netcoreapp3.1 and .NETStandard 2.1 projects.

I have multiple .net projects in one solution file which are added as references to each other projects. Some of the projects has .netcore 3.1 version and some of has .NET Standard 2.1. It is working fine in my local machine.

Now i am creating my azure devops build pipeline using classic editor and selected the asp.net core template so it will add all the necessary tasks (Showing in attached image). But it is giving me error in NuGet package restore task "##[error]The nuget command failed with exit code(1) and error(NU1201: Project XX is not compatible with.netcoreapp3.1 (.NETCoreApp,Version=v3.1). Project XX supports:.netstandard2.1 (.NETStandard,Version=v2.1)".

管道错误

Note: I can not change the any project version as it is used in many other projects, can any one help me on this if i missed anything.

Azure devops gives NuGet package restore error for reference project

To resolve this issue, please try to upgrade the version of Nuget specified in the NuGet tool installer to 5.4 and above:

在此处输入图像描述

Or you could use the do.net restore task instead of nuget restore:

在此处输入图像描述

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