Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 无法使用VS2012从VSTS nuget安装nuget软件包_Visual Studio_Visual Studio 2012_Nuget_Azure Devops - Fatal编程技术网

Visual studio 无法使用VS2012从VSTS nuget安装nuget软件包

Visual studio 无法使用VS2012从VSTS nuget安装nuget软件包,visual-studio,visual-studio-2012,nuget,azure-devops,Visual Studio,Visual Studio 2012,Nuget,Azure Devops,无法使用VS2012从visual studio team services nuget server安装nuget软件包 PM> install-package <package_name> -Source https://<vsts_hostname>/_packaging/Components/nuget/v3/index.json PM>安装包-源代码https:///_packaging/Components/nuget/v3/index.json 错

无法使用VS2012从visual studio team services nuget server安装nuget软件包

PM> install-package <package_name> -Source https://<vsts_hostname>/_packaging/Components/nuget/v3/index.json
PM>安装包-源代码https:///_packaging/Components/nuget/v3/index.json
错误消息:-

install-package : An error occurred while loading packages from 'https://<vsts_hostname>/_packaging/Components/nuget/v3/index.json': 
The remote server returned an error: (404) Not Found.
At line:1 char:1 install-package <package_name> -Source https://<vsts_hostname>...

+ CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
安装程序包:从加载程序包时出错'https:///_packaging/Components/nuget/v3/index.json': 
远程服务器返回错误:(404)未找到。
在第1行char:1安装包-源代码https://...
+CategoryInfo:NotSpecified:(:)[Install Package],InvalidOperationException
+FullyQualifiedErrorId:NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
PS:-
同样的安装包命令也适用于VS2015和VS2017,而使用v2端点。(将v3/index.json替换为v2):

安装程序包-源代码https:///_packaging/Components/nuget/v2

另一方面,您可以将VSTS提要添加到nuget source:
nuget.exe sources add-name{your feed name}-source{your feed URL}-username{anything}-password{your PAT}-StorePasswordInClearText
,然后右键单击VS=>Manage nuget Packages=>Online=>中的项目,选择您添加的包源

没有帮助。将v2用作时出现相同错误well@SureshRaja将VSTS提要添加到nuget source:nuget.exe sources Add-name{your feed name}-source{your feed URL}-username{anything}-password{your PAT},然后右键单击VS=>Manage nuget Packages=>Online=>中的项目,选择您添加的包源。谢谢@starain MSFT。我不得不另外使用-StorePasswordInClearText来让它工作。
install-package <package_name> -Source https://<vsts_hostname>/_packaging/Components/nuget/v2