azure-pipelines-tasks: after dotnet tool installer, fails on Nuget.Targets file

When trying to use an alternative .netstandard sdk version, the dotnet restore uses the sdk version you have installed but it fails at a later point when it tries to use the Nuget.Targets file.

@bryanmacfarlane asked me to raise the issue here after creating an issue under the vsts-agent repo https://github.com/Microsoft/vsts-agent/issues/1146

2017-08-16T10:39:25.6434014Z Successfully installed .NET Core runtime version 2.0.0.
2017-08-16T10:40:40.9796157Z [command]d:\a\_tool\dncr\2.0.0\x64\dotnet.exe restore d:\a\1\s\Draycir.Tenants.WebApi\Draycir.Tenants.WebApi.csproj --configfile d:\a\1\Nuget\tempNuGet_6367.config --verbosity Detailed
2017-08-16T10:41:20.0170050Z C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Project Draycir.Tenants.Domain is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Project Draycir.Tenants.Domain supports: netstandard2.0 (.NETStandard,Version=v2.0) [d:\a\1\s\Draycir.Tenants.WebApi\Draycir.Tenants.WebApi.csproj]

This is a log output from flightlevel (also in the above issue)

******************************************************************************
Starting: Restore
******************************************************************************
==============================================================================
Task         : .NET Core
Description  : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports NuGet.org and authenticated feeds like Package Management and MyGet.
Version      : 2.0.5
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
==============================================================================
SYSTEMVSSCONNECTION exists true
Downloading: https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe
Caching tool: NuGet 4.0.0 x64
Using version: 4.0.0
Found tool in cache: NuGet 4.0.0 x64
Saving NuGet.config to a temporary config file.
Can\'t find loc string for key: NGCommon_NoSourcesFoundInConfig
NGCommon_NoSourcesFoundInConfig d:\a\1\Nuget\tempNuGet_144.config
"C:\Program Files\dotnet\dotnet.exe" restore d:\a\1\s\src\MyProject.Tests\MyProject.Tests.csproj --configfile d:\a\1\Nuget\tempNuGet_144.config --verbosity Detailed
  Restoring packages for d:\a\1\s\src\MyProject\MyProject.csproj...
  Restoring packages for d:\a\1\s\src\MyProject.Tests\MyProject.Tests.csproj...
C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Unable to resolve 'Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0'. [d:\a\1\s\src\MyProject.Tests\MyProject.Tests.csproj]

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

Above advice allowed me to get further along thank you, but was still getting weird (to me) NuGet issues

Found this which got me going! Might help someone else https://stackoverflow.com/questions/45717283/vsts-build-packages-failed-to-restore-unable-to-resolve-netstandard-library

@rmarinho - OK, thanks. Confirmed my suspicion, you’re moving faster than the images are 😃