2017-05-12 58 views
4

试图按照this blog post的地方安装正确的SDK和节点。Microsoft.AspNetCore.SpaTemplates将不会安装

运行命令dotnet new --install Microsoft.AspNetCore.SpaTemplates::*给我的错误:

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]

似乎与我们的内部的NuGet服务器。我正在使用VS 2017.寻找一种方法来强迫它忽略我们的nuget服务器或强制它使用正确的一个?

+0

我能够使用文章中描述的yeoman方法来安装模板。 –

回答

2

在Visual Studio中使用快捷方式Ctrl+Q,然后键入package sources单击第一个搜索结果。您现在可以在Visual Studio中管理您的软件包源代码。如果您在CLI中遇到此错误,请检查您要恢复软件包的项目目录中是否有NuGet.config文件。如果是这样,则将它们指向另一个nuget源或完全删除该文件。