Visual Studio 2015中的程序包管理器"407(需要代理身份验证)" [英] Package manager in Visual Studio 2015 "407 (Proxy Authentication Required)"

查看:284
本文介绍了Visual Studio 2015中的程序包管理器"407(需要代理身份验证)"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我理解这是一个经常被问到的问题,但是经过数天的研究,我仍未找到解决该特定问题的答案.

我有一个新的ASP.NET 5(Core 1.0)MVC模板,我想每次在包管理器"输出中都添加一个包:

I have a new ASP.NET 5 (Core 1.0) MVC template that I'm trying to add a package to however each and every time I get in the Package Manager output:

Response status code does not indicate success: 407 (Proxy Authentication Required). 

以及以下在解决方案资源管理器顶部:

and the following at the top of solution explorer:

我的设置看起来不错,并且可以在管理解决方案的软件包"屏幕中浏览软件包.

my settings look fine and I am able to browse packages in the 'Manage Packages for Solution' screen.

我了解我被要求提供凭据,那么我应该在哪里输入凭据?另一方面,我机器上的所有其他应用程序都已验证了互联网访问权限,那我为什么要这么做?

I understand I'm being requested to supply credentials so where do I enter them? On the other hand all other applications on my machine have validated internet access, so why should I?

任何想法/指针都非常受欢迎.

Any ideas / pointers are very welcome.

Visual Studio 2015 -14.0.24720.00更新1
用于Visual Studio 2015的NuGet软件包管理器-3.3.0.167

Visual Studio 2015 - 14.0.24720.00 Update 1
NuGet Package Manager for Visual Studio 2015 - 3.3.0.167

程序包管理器"输出的顶部:

Top section of Package Manager output:

安装NuGet软件包AutoMapper.4.2.1.
已成功将"AutoMapper 4.2.1"安装到CustomerPortal
==========完成==========
PATH =.\ node_modules.bin;%PATH%; C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ Common7 \ IDE \ Extensions \ Microsoft \ Web Tools \ External; C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ Common7 \ IDE \ Extensions \ Microsoft \ Web工具\ External \ git
C:\ Users \ medmondson.dnx \ runtimes \ dnx-clr-win-x86.1.0.0-rc1-update1 \ bin \ dnx.exe"C:\ Users \ medmondson.dnx \ runtimes \ dnx-clr-win- x86.1.0.0-rc1-update1 \ bin \ lib \ Microsoft.Dnx.Tooling \ Microsoft.Dnx.Tooling.dll恢复" M:\ visual studio 2015 \ Projects \ CustomerPortal \ src \ CustomerPortal"-f" C: \ Program Files(x86)\ Microsoft Web Tools \ DNU"
Microsoft .NET开发实用程序Clr-x86-1.0.0-rc1-16231
GET https://www.nuget.org/api/v2/
GET http://packages.nuget.org/v1/FeedService.svc/
GET https://www.postsharp.net/nuget/packages/
恢复M:\ visual studio 2015 \ Projects \ CustomerPortal \ src \ CustomerPortal \ project.json的软件包
GET https://www.nuget.org/api/v2/FindPackagesById() ?id = 'AutoMapper'
GET http://packages.nuget.org/v1/FeedService.svc/FindPackagesById()?id = 'AutoMapper'
GET https://www.postsharp.net/nuget/packages/FindPackagesById() ?id = 'AutoMapper'
警告:FindPackagesById:AutoMapper
发送请求时发生错误.
GET https://www.nuget.org/api/v2/FindPackagesById() ?id = 'AutoMapper'
GET https://www.nuget.org/api/v2/FindPackagesById() ?id = 'System.Collections.Immutable'
GET http://packages.nuget.org/v1/FeedService.svc/FindPackagesById()?id = 'System.Collections.Immutable'
GET https://www.postsharp.net/nuget/packages/FindPackagesById() ?id = 'System.Collections.Immutable'
警告:FindPackagesById:AutoMapper
发送请求时发生错误.
GET https://www.postsharp.net/nuget/packages/FindPackagesById() ?id = 'AutoMapper'
警告:FindPackagesById:AutoMapper
响应状态代码不表示成功:407(需要代理身份验证).

Installing NuGet package AutoMapper.4.2.1.
Successfully installed 'AutoMapper 4.2.1' to CustomerPortal
========== Finished ==========
PATH=.\node_modules.bin;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\git
C:\Users\medmondson.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1\bin\dnx.exe "C:\Users\medmondson.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1\bin\lib\Microsoft.Dnx.Tooling\Microsoft.Dnx.Tooling.dll" restore "M:\visual studio 2015\Projects\CustomerPortal\src\CustomerPortal" -f "C:\Program Files (x86)\Microsoft Web Tools\DNU"
Microsoft .NET Development Utility Clr-x86-1.0.0-rc1-16231
GET https://www.nuget.org/api/v2/
GET http://packages.nuget.org/v1/FeedService.svc/
GET https://www.postsharp.net/nuget/packages/
Restoring packages for M:\visual studio 2015\Projects\CustomerPortal\src\CustomerPortal\project.json
GET https://www.nuget.org/api/v2/FindPackagesById()?id='AutoMapper'
GET http://packages.nuget.org/v1/FeedService.svc/FindPackagesById()?id='AutoMapper'
GET https://www.postsharp.net/nuget/packages/FindPackagesById()?id='AutoMapper'
Warning: FindPackagesById: AutoMapper
An error occurred while sending the request.
GET https://www.nuget.org/api/v2/FindPackagesById()?id='AutoMapper'
GET https://www.nuget.org/api/v2/FindPackagesById()?id='System.Collections.Immutable'
GET http://packages.nuget.org/v1/FeedService.svc/FindPackagesById()?id='System.Collections.Immutable'
GET https://www.postsharp.net/nuget/packages/FindPackagesById()?id='System.Collections.Immutable'
Warning: FindPackagesById: AutoMapper
An error occurred while sending the request.
GET https://www.postsharp.net/nuget/packages/FindPackagesById()?id='AutoMapper'
Warning: FindPackagesById: AutoMapper
Response status code does not indicate success: 407 (Proxy Authentication Required).

我设法捕获了一个非工作请求(返回407)和一个工作请求,其中唯一的区别是代理授权标头的内容更长.这表明代理身份验证确实存在,但是它使用了不同的协议.

I've managed to capture a non-working request (returning 407) and a working request with the only difference being the content of the Proxy-Authorization header which is longer. This would suggest the proxy authentication does exist but it's using a different protocol.

推荐答案

我必须修改 32位 machine.config(假设VS以32位运行)以添加<system.net>部分但省略<defaultProxy>标记内的任何内容:

I had to modify the 32 bit machine.config (assumption being VS runs in 32 bit) to add the <system.net> section but omitting anything within the <defaultProxy> tag:

<system.net>
    <defaultProxy useDefaultCredentials="True" enabled="True" />
</system.net>

根据 MSDN :

如果defaultProxy元素为空,则将使用Internet Explorer中的代理设置.

If the defaultProxy element is empty, the proxy settings from Internet Explorer will be used.

这对我来说是完美的,因为我机器上的所有其他应用程序都可以正常工作-包括IE.

This is perfect for me as every other application on my machine works - including IE.

manchine.config位置(Win 7):%SYSTEMROOT%\ Microsoft.NET \ Framework \ v4.0.30319 \ Config \ machine.config

manchine.config location (Win 7): %SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319\Config\machine.config

我解决了这个问题,这要归功于@ user3063127向我指出了正确的方向(您有赞成意见).据我所知,这仅影响DNX项目上的程序包还原,并且在发布RC2时可能会得到修复.

这篇关于Visual Studio 2015中的程序包管理器"407(需要代理身份验证)"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆