2017-05-12 51 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源或完全刪除該文件。