Today I was in a customer where the internet access is provided by a WebProxy that requires credentials.
For some reason, although VS can navigate, the Team Explorer was not able to connect to our TFS server, because a 407 error (Proxy authentication required)
To fix this issue you need a custom proxy module that provides the credentials, so I created a simple DLL with this class:
using System;
using System.Net;
namespace Rido.AuthProxy
{
public class AuthProxyModule : IWebProxy
{
ICredentials crendential = new NetworkCredential("proxy.user", "password");
public ICredentials Credentials
{
get
{
return crendential;
}
set
{
crendential = value;
}
}
public Uri GetProxy(Uri destination)
{
return new Uri("http://proxy:8080", UriKind.Absolute);
}
public bool IsBypassed(Uri host)
{
return host.IsLoopback;
}
}
}
You should copy this DLL to the %PROGRAMFILES\Microsoft Visual Studio 10.0\Common7\IDE folder, and update the devenv.exe.config file to include the module:
<system.net>
<defaultProxy>
<module type="Rido.AuthProxy.AuthProxyModule, Rido.AuthProxy"/>
</defaultProxy>
</system.net>
Hi, I tried this solution but it does not worked for me, can you please explain it more? if the proxy has a port is it alright to write the url as proxyserver.com:8000????
Yes, it work fine, with VS2012
thanks
it dont work fine with VS2013.
VS had abnormal end after VS started up.
Awesome fix for VS 2013 Community … thanks!!!
Can confirm. Worked for VS 2013 Community. Thanks tons!
Thank you. Working with VS 2015 too.
I cannot use C++ so a little help would be nice. After creating a DLL project in visual studio, i copy/pasted the code, but I get: "System is undefined".
missing header? anything else? help please.
This method worked on VS 2013 Community, thanks!
@Stephane Ndong-Mef – This is a C# project, so create a new library project using that language.
Example for VS 2010:
File – New project – Visual C# – Class Library (.Net Framework 3.5)
Name: Rido.AuthProxy
using System;
using System.Net;
namespace Rido.AuthProxy
{
public class AuthProxyModule : IWebProxy
{
ICredentials crendential = System.Net.CredentialCache.DefaultCredentials;
public ICredentials Credentials
{
get
{
return crendential;
}
set
{
crendential = value;
}
}
public Uri GetProxy(Uri destination)
{
return new Uri("http://proxy:port/", UriKind.Absolute);
}
public bool IsBypassed(Uri host)
{
return host.IsLoopback;
}
}
}
Can you please tell how to make it work for VS2015 community?
There is no differences using VS2015 community, pro or enterprise. What problem do you have?
Thanks! Worked with VS2015 community RC!
It is working (at least I can connect to TFS) but I cannot authenticate to TFS. It always says that the password is wrong. Any ideas?
Hi,
it's not working for me VS 2013
Cant get it to work. VS crashes. The solution offered by MS (editing an XML file) fails. This too.
It is amazing that in 2016 Microsoft ignores that most companies are using, for security purposes, filters to Internet, where a proxy authentication is required.
I have dozens of applications installed on my laptop. Most have a switch I can activate, and three fields to enter the proxy IP, port, login and password.
If independant authors are capable of making this work easily, why can’t Microsoft too ?
The most amazing thing being this problem has been known since the beta of VS 2015. Microsoft was told about it. The VS 2015 went into production and release. Patches went by, and this is still a problem.
Next time someone in the company talks about using a Microsoft tool or solution, I will tell them this story and we will select another seller. We are ditching C# for Java as of now, because Microsoft does not listen to people giving them money.
Worked with VS 2015 community with update 2!!!
Works great if you remember to do the following:
Replace:
[proxy.user] with the Proxy user you need
[password] with the proxy password you need
[proxy:8080] with the actual proxy address and port you need
For VS2015 the path changes to Microsoft Visual Studio 12.0