I'm building a console application that can load a content type and remove the seal on it through C#. In attempting to add a web reference to the application, I'm getting an error which is strange because I use the same web reference in another application and it works fine. I'm pretty sure I hit this problem before and fixed it, but I cannot remember how :(
My steps:
There was an error downloading 'http://(domain)/videolibrary/_vti_bin/lists.asmx'. Unable to connect to the remote server No connection could be made because the target machine actively refused it 127.0.0.1:80 Metadata contains a reference that cannot be resolved: 'http://(domain)/videolibrary/_vti_bin/lists.asmx'. There was no endpoint listening at http://(domain)/videolibrary/_vti_bin/lists.asmx that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. Unable to connect to the remote server No connection could be made because the target machine actively refused it 127.0.0.1:80 If the service is defined in the current solution, try building the solution and adding the service reference again.
EDIT: Tried changing Target Framework from .NET Framework 4 Client Profile to .NET Framework 3.5 to no avail
The following solved my problem:
http://social.msdn.microsoft.com/Forums/zh/wcf/thread/02ce9fb9-6f67-45ec-9668-2dcd2317aab0
If you are behind firewall you need to make Visual Studio use the system proxy settings which can be done by manipulating your devenv.exe.config file.
Open it in Visual Studio and alter the section as below:
<system.net>
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy usesystemdefault="True" proxyaddress="http://yourproxyserver:port" bypassonlocal="False"/>
</defaultProxy>
<settings>
<servicePointManager expect100Continue="false" />
<ipv6 enabled="true"/>
</settings>
</system.net>