Hello,
I created a asp.net core mvc solution. I also created a working build on Visual Studio Team Services. Next, I added a reference to Telerik.UI.for.AspNet.Core using the Telerik private Nuget feed. With this addition, the build on VSTS now fails.
I already had a Nuget Installer task in my build. I set the path to a nuget.config file in my repository. I tried with the hashed password and with a clear text password. No matter what I do, the build still fail. The build fails when the next task is executed. The task performs a dotnet restore on the asp.net mvc project.
Can you help ?
Regards,
Patrice
10 Answers, 1 is accepted
Hello Patrice,
The password for the private NuGet feed should be stored clear text only. This is a of NET Core tooling.
You should also check of the .config file set up in the VSTS includes the private NuGet feed. Maybe, this resource can help out on the topic: https://www.visualstudio.com/en-us/docs/package/nuget/nuget-exe.
Another solution is to include the NuGet.config file in the root od the application. And also, make sure that restore searches all feed sources and not only the public NuGet one.
Generally, the described behavior is entirely related to NuGet private feed configuration and it is rather related to the NuGet tooling and configuration.
Regards,Ianko
Telerik by Progress

Thanks Ianko for you help!
I was all setup correctly according to your description. The missing step, or rather a misconfiguration task, was that I used the default version of nuget.exe in VSTS (it was 3.3.0). After I selected version 4.0.0., VSTS was able to restore the Telerik nuget package.
Regards,
Patrice

I have the same issue but just can't seem to get this working. I've tried all version of nuget available on vsts (3.3, 3.5, 4 and even a custom download step to get 4.6) and both encrypted and cleartext passwords in my nuget.config and get an error with every one (most from the telerik nuget feed saying that I need authorization headers in my requests)
I've also tried version 2 of the nuget task in VSTS which allows you to configure the endpoint with basic authentication credentials, but also no luck.
Anybody have this working currently?

Hello Simon,

Hello Simon,
I put somewhere in my VSTS branch the NuGet.config file with my password in clear text. The nuget file I found it on my file system: %appdata%\NuGet\NuGet.Config
For the build, I have 2 tasks executed before the Build task:
1. NuGet Tool Installer 4.3.0 (version to install is: 4.3.0)
2. Nuget Restore, with this configuration:
version: 2.*
Path to solution: I specify where is located the solution file, $/.../.../mysolution.sln
Paht to NuGet.config: I specify where in the branch is located the NuGet.Config file, $/.../NuGet.config
I hope this helps.
Regards

I'm having the same issue. I put the NuGet tasks before the restore task since it failed if I didn't.
I set up authentication as Basic. It looks like I got this error when it went to get the Telerik package:
Unauthorized https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core' 84ms
My NuGet.config and the logs are below for the restore is you could see an issue.
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
packageSources
>
<
add
key
=
"Telerik"
value
=
"https://nuget.telerik.com/nuget"
/>
</
packageSources
>
</
configuration
>
******************************************************************************
Starting: Use NuGet 4.3.0
******************************************************************************
==============================================================================
Task : NuGet Tool Installer
Description : Acquires a specific version of NuGet from the internet or the tools cache and adds it to the PATH. Use this step to change the version of NuGet used in the NuGet steps.
Version : 0.1.5
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?linkid=852538)
==============================================================================
Found tool in cache: NuGet 4.3.0 x64
Resolved from tool cache: 4.3.0
Using version: 4.3.0
Found tool in cache: NuGet 4.3.0 x64
Using tool path: C:\hostedtoolcache\windows\NuGet\4.3.0\x64
Prepending PATH environment variable with directory: C:\hostedtoolcache\windows\NuGet\4.3.0\x64
******************************************************************************
Finishing: Use NuGet 4.3.0
******************************************************************************
******************************************************************************
Starting: NuGet restore
******************************************************************************
==============================================================================
Task : NuGet
Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task.
Version : 2.0.27
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747)
==============================================================================
C:\Windows\system32\chcp.com 65001
Active code page: 65001
Detected NuGet version 4.3.0.4406 / 4.3.0
SYSTEMVSSCONNECTION exists true
998d1992-f9ab-415f-a386-a23d9f99e4b0 exists true
Saving NuGet.config to a temporary config file.
Using authentication information for the following URI: https://nuget.telerik.com/nuget
C:\hostedtoolcache\windows\NuGet\4.3.0\x64\nuget.exe sources Remove -NonInteractive -Name Telerik -ConfigFile D:\a\1\Nuget\tempNuGet_11.config
Package source with Name: Telerik removed successfully.
C:\hostedtoolcache\windows\NuGet\4.3.0\x64\nuget.exe sources Add -NonInteractive -Name Telerik -Source https://nuget.telerik.com/nuget -ConfigFile D:\a\1\Nuget\tempNuGet_11.config -Username ******** -Password ********
Package Source with Name: Telerik added successfully.
C:\hostedtoolcache\windows\NuGet\4.3.0\x64\nuget.exe restore D:\a\1\s\PlatinumWeb.sln -Verbosity Detailed -NonInteractive -ConfigFile D:\a\1\Nuget\tempNuGet_11.config
NuGet Version: 4.3.0.4406
MSBuild auto-detection: using msbuild version '15.6.85.37198' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
MSBuild P2P timeout [ms]: 120000
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\msbuild.exe "C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\z0xeklqt.dqp.nugetinputs.targets" /t:GenerateRestoreGraphFile /nologo /nr:false /v:q /p:NuGetRestoreTargets="C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\n1r3suew.ajg.nugetrestore.targets" /p:RestoreTaskAssemblyFile="C:\hostedtoolcache\windows\NuGet\4.3.0\x64\nuget.exe" /p:RestoreSolutionDirectory="D:\a\1\s" /p:RestoreConfigFile="D:\a\1\Nuget\tempNuGet_11.config"
Running restore with 2 concurrent jobs.
Reading project file D:\a\1\s\PlatinumWeb\PlatinumWeb.csproj.
Reading project file D:\a\1\s\PlatinumWeb\PlatinumWeb.csproj.
Restoring packages for D:\a\1\s\PlatinumWeb\PlatinumWeb.csproj...
Restoring packages for D:\a\1\s\PlatinumWeb\PlatinumWeb.csproj...
Restoring packages for .NETCoreApp,Version=v2.0...
Restoring packages for .NETCoreApp,Version=v2.0...
Resolving conflicts for .NETCoreApp,Version=v2.0...
GET https://nuget.telerik.com/nuget/FindPackagesById()?id='BuildBundlerMinifier'
GET https://nuget.telerik.com/nuget/FindPackagesById()?id='Microsoft.AspNetCore.All'
Using credentials from config. UserName: ********
Unauthorized https://nuget.telerik.com/nuget/FindPackagesById()?id='BuildBundlerMinifier' 2541ms
Unauthorized https://nuget.telerik.com/nuget/FindPackagesById()?id='Microsoft.AspNetCore.All' 2528ms
Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='BuildBundlerMinifier''.
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='Microsoft.AspNetCore.All''.
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
GET https://nuget.telerik.com/nuget/FindPackagesById()?id='BuildBundlerMinifier'
GET https://nuget.telerik.com/nuget/FindPackagesById()?id='Microsoft.AspNetCore.All'
Unauthorized https://nuget.telerik.com/nuget/FindPackagesById()?id='Microsoft.AspNetCore.All' 84ms
Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='Microsoft.AspNetCore.All''.
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
Unauthorized https://nuget.telerik.com/nuget/FindPackagesById()?id='BuildBundlerMinifier' 84ms
GET https://nuget.telerik.com/nuget/FindPackagesById()?id='Microsoft.AspNetCore.All'
Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='BuildBundlerMinifier''.
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
GET https://nuget.telerik.com/nuget/FindPackagesById()?id='BuildBundlerMinifier'
Unauthorized https://nuget.telerik.com/nuget/FindPackagesById()?id='Microsoft.AspNetCore.All' 84ms
Unauthorized https://nuget.telerik.com/nuget/FindPackagesById()?id='BuildBundlerMinifier' 84ms
GET https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core'
Unauthorized https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core' 84ms
Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core''.
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
GET https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core'
Unauthorized https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core' 84ms
Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core''.
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
GET https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core'
Unauthorized https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core' 85ms
NuGet.Protocol.Core.Types.FatalProtocolException: Failed to retrieve information about 'Telerik.UI.for.AspNet.Core' from remote source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core''. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at NuGet.Protocol.HttpSource.<>c__DisplayClass12_0`1.<<
GetAsync
>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Common.ConcurrencyUtilities.<
ExecuteWithFileLockedAsync
>d__2`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.HttpSource.<
GetAsync
>d__12`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.RemoteV2FindPackageByIdResource.<
FindPackagesByIdAsyncCore
>d__22.MoveNext()
--- End of inner exception stack trace ---
at NuGet.Protocol.RemoteV2FindPackageByIdResource.<
FindPackagesByIdAsyncCore
>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.RemoteV2FindPackageByIdResource.<
GetAllVersionsAsync
>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.SourceRepositoryDependencyProvider.<
GetAllVersionsAsync
>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.SourceRepositoryDependencyProvider.<
FindLibraryCoreAsync
>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Failed to retrieve information about 'Telerik.UI.for.AspNet.Core' from remote source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core''.
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.SourceRepositoryDependencyProvider.<>c__DisplayClass16_0.<<
FindLibraryAsync
>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.SourceRepositoryDependencyProvider.<
FindLibraryAsync
>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.ResolverUtility.<>c__DisplayClass7_1.<<
FindLibraryFromSourcesAsync
>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.ResolverUtility.<
FindLibraryFromSourcesAsync
>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.ResolverUtility.<
FindLibraryByVersionAsync
>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.ResolverUtility.<
FindLibraryMatchAsync
>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.ResolverUtility.<
FindLibraryEntryAsync
>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.RemoteDependencyWalker.<
CreateGraphNode
>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.RemoteDependencyWalker.<
CreateGraphNode
>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.ProjectRestoreCommand.<
WalkDependenciesAsync
>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.ProjectRestoreCommand.<
TryRestore
>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreCommand.<
ExecuteRestoreAsync
>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreCommand.<
ExecuteAsync
>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreRunner.<
ExecuteAsync
>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreRunner.<
ExecuteAndCommitAsync
>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreRunner.<
CompleteTaskAsync
>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreRunner.<
RunAsync
>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreRunner.<
RunAsync
>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreRunner.<
RunAsync
>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.CommandLine.RestoreCommand.<
ExecuteCommandAsync
>d__34.MoveNext()
The nuget command failed with exit code(1) and error(Failed to retrieve information about 'Telerik.UI.for.AspNet.Core' from remote source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core''.
Packages failed to restore
******************************************************************************
Finishing: NuGet restore
******************************************************************************

you need to follow the instructions of Telerik to connect to their private nuget feed and to connect with you credentials. Please refer to this page: https://docs.telerik.com/aspnet-mvc/getting-started/nuget-install
1. download nuget.exe (https://dist.nuget.org/win-x86-commandline/latest/nuget.exe)
2. open command promt (cmd.exe) and move to where is downloaded nuget.exe
3. execute the command :
NuGet Sources Add -Name "telerik.com" -Source "https://nuget.telerik.com/nuget" -UserName "your login email" -Password "your password" -StorePasswordInClearText
your nugget.config file should look like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="telerik.com" value="https://nuget.telerik.com/nuget" />
</packageSources>
<activePackageSource>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</activePackageSource>
<packageSourceCredentials>
<telerik.com>
<add key="Username" value="myemail@domainname.com" />
<add key="ClearTextPassword" value="myPasswordInClearText" />
</telerik.com>
</packageSourceCredentials>
</configuration>


