为你的Visual Studio单独设置代理服务器

http://blog.sina.com.cn/s/blog_58c506600101tycn.html

最近,因为国内访问Visual Studio Online(微软的免费代码托管服务,以前叫Team Foundation Service)越来越慢——原因你懂的——甚至有些时候连登录页面都刷不出来,所以我只好在Firefox浏览器中设置了用GoAgent“科学上网”。并且,Visual Studio本身也需要访问代码库和Visaul Studio Online上的TFS服务器,所以也需要给VS设置代理服务器。但是问题来了,在设置中能看到VS使用的是IE代理设置,并且没有单独的代理服务器选项。

 

image

 

但是我并不想把整个系统的代理都设置成GoAgent,那么有没有办法单独设置VS的代理服务器而不影响Windows系统、IE和其他程序么?

 

答案是有的!我意识到Visual Studio本身实际上也是用.NET技术写成的,那么一些可以适用于.NET应用程序的配置也可以用在Visual Studio上。在.NET中,我们可以通过修改应用程序的config文件中的system.net节点来单独指定这个程序所使用的代理

MSDN文档如下: http://msdn.microsoft.com/en-us/library/kd3cf2ex(v=vs.110).aspx

 

所以问题就可以这么解决了:

1.安装并配置GoAgent,默认地址应该是127.0.0.1,端口8087 (安装过程不再详述,教程点这里http://maolihui.com/goagent-detail.html

 

2.使用管理员权限打开记事本(或NotePad++等文本编辑器),打开这个文件

VS 2012:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe.config

VS 2010:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config

 

3.搜索sytem.net节点,默认设置应该是这样的

<system.net>
       <settings>
           <ipv6 enabled="true"/>
       </settings>
</system.net>

4.添加下面文字到system.net节点中

<defaultProxy useDefaultCredentials="true" enabled="true">
    <proxy bypassonlocal="true" proxyaddress="
http://127.0.0.1:8087/" />
</defaultProxy>

使其变成类似这样的

image

 

之后重启Visual Studio就可以了!

posted @ 2016-05-14 08:59  shiningrise  阅读(12088)  评论(0编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css