Azure Devops nuget restore unable to resolve dependencies

Viewed 1806

I have a dotnet web api project with EF. When I try to configure build and run the Nuget Restore step fails with below errors

The nuget command failed with exit code(1) and error(Errors in E:\TFS_Agents2017\...\s\ABC.Employees\ABC.Employees.csproj
    Unable to resolve 'Microsoft.NETCore.App (>= 3.1.0)' for '.NETCoreApp,Version=v3.1'.
Errors in E:\TFS_Agents2017\....\s\EmployeesEF\EmployeesEF.csproj
    Unable to resolve 'Microsoft.NETCore.App (>= 3.1.0)' for '.NETCoreApp,Version=v3.1'.
Errors in E:\TFS_Agents2017\...\s\UnitTests\abcUnitTests.csproj
    Unable to resolve 'Microsoft.NETCore.App (>= 3.1.0)' for '.NETCoreApp,Version=v3.1'.
Errors in E:\TFS_Agents2017\...\s\askldf\asdfasdf.UnitTests.csproj
    Unable to resolve 'Microsoft.NETCore.App (>= 3.1.0)' for '.NETCoreApp,Version=v3.1'.)
Packages failed to restore

Am I missing anything, do I need to add any other steps ?

1 Answers

We cannot see the .NET Core SDK version 3.1.0 in the agent info. Please run the cmd dotnet –info to check your local .NET Core SDK version and Runtime version, then open the build definition and add the task .NET Core SDK and .NET Core restore to restore the package. enter image description here

Related