after dotnet tool installer, fails on Nuget.Targets file
See original GitHub issueWhen 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]
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Unable to install dotnet tool from private nuget feed
Unfortunately the install fails because it indicates it doesn't have access to the feed.
Read more >Troubleshoot .NET tool usage issues - Microsoft Learn
When a .NET tool fails to run, most likely you ran into one of the following issues: The executable file for the tool...
Read more >Failed to run dotnet restore - Stack Overflow
When trying to run dotnet restore in the root folder of my project, I get a following error:
Read more >NuGet problems when installing X - ServiceStack
[Code] dotnet tool install --global x /usr/local/share/dotnet/sdk/5.0.403/NuGet.targets(131,5): error : Failed to retrieve information about ...
Read more >Install dotnet global tool with private NuGet feed - Matt DuFeu
PS C:\repos\> dotnet tool install -g try-convert C:\Program Files\dotnet\sdk\3.1.301\NuGet.targets(128,5): error : Failed to retrieve ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 😃