Steve Greene
Steve Greene

Reputation: 12304

Microsoft.AspNetCore.SpaTemplates won't install

Trying to follow this blog post where I have the proper SDK and node installed.

Running the command dotnet new --install Microsoft.AspNetCore.SpaTemplates::* gives me the error:

Restoring packages for C:\Users\xxxx.templateengine\dotnetcli\v1.0.4\scratch\restore.csproj... Retrying 'FindPackagesByIdAsyncCore' for source 'https://ournugetserver/httpAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.NETCore.App''. Response status code does not indicate success: 401 (Unauthorized).
Retrying 'FindPackagesByIdAsyncCore' for source 'https://ournugetserver/httpAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.AspNetCore.SpaTemplates''. Response status code does not indicate success: 401 (Unauthorized).
Retrying 'FindPackagesByIdAsyncCore' for source 'https://tcypwv01/httpAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.AspNetCore.SpaTemplates''. Response status code does not indicate success: 401 (Unauthorized).
Retrying 'FindPackagesByIdAsyncCore' for source 'https://ournugetserver/httpAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.NETCore.App''. Response status code does not indicate success: 401 (Unauthorized). C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Failed to retrieve information about 'Microsoft.NETCore.App' from remote source 'https://ournugetserver/httpAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.NETCore.App''. [C:\Users\xxxxx.templateengine\dotnetcli\v1.0.4\scratch\restore.csproj] C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error :
Response status code does not indicate success: 401 (Unauthorized). [C:\Users\xxxxx.templateengine\dotnetcli\v1.0.4\scratch\restore.csproj]

Seems related to our internal nuget server. I'm using VS 2017. Looking for a way to possibly force it to ignore our nuget server or force it to use the correct one?

Upvotes: 5

Views: 1367

Answers (2)

Ajit
Ajit

Reputation: 56

This issue is related to Nuget package source . By selecting only nuget.org (https://www.nuget.org/api/v2/) source helped me to resolve this issue. make sure, you don't have any other source selected . it was happening to me because with nuget.org , Glass Builder Server (http://build.glass.lu/guestAuth/app/nuget/v1/FeedService.svc) was also selected and it was looking package in Glass Builder Server .

Upvotes: 4

Travis Boatman
Travis Boatman

Reputation: 2282

In Visual Studio use the shortcut Ctrl+Q then type package sources click on the first search result. You can now manage your package sources within Visual Studio. If you encounter this error with the CLI check if there is a NuGet.config file in the project directory from which you are restoring the packages. If so then point them to another nuget source or remove the file altogether.

Upvotes: 2

Related Questions