-1

I created a pipeline but when the process failed all the time on "Nuget Restore", see error message below.

I don't understand why

Thanks for your help

enter image description here

*The nuget command failed with exit code(1) and error(C:\Program Files\dotnet\sdk\2.2.110\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. [D:\a\1\s\PackSecurity\PackSecurity.csproj] C:\Program Files\dotnet\sdk\2.2.110\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. [D:\a\1\s\PackSecurity.Tests\PackSecurity.Tests.csproj])
Packages failed to restore*
TheBoubou
  • 19,487
  • 54
  • 148
  • 236

2 Answers2

2

Use "windows-2019" as the agent. Click on "Agent job 1" and set "Agent Specification" as "windows-2019".

Let me know if it worked for you.

Agent specification -> windows-2019

1

According to the error message:

The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.0.

We could to know that you have one or more projects target to the .NET Core 3.0, but the agent you select does not have that version .NET Core installed by default. It should has version 2.2.11 installed.

To resolve this issue, we could add a Use .NET Core task to install the .net core 3.0.x:

enter image description here

Check the similar ticket for some more details.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135