我正在构建一个控制台应用程序,该应用程序可以加载内容类型并通过 C# 去除其上的印章。在尝试向应用程序添加 Web 引用时,我收到一个奇怪的错误,因为我在另一个应用程序中使用了相同的 Web 引用并且它工作正常。我很确定我之前遇到过这个问题并修复了它,但我不记得是如何:(
我的步骤:
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.
编辑:尝试将目标框架从 .NET Framework 4 Client Profile 更改为 .NET Framework 3.5 无济于事
最佳答案
以下解决了我的问题:
http://social.msdn.microsoft.com/Forums/zh/wcf/thread/02ce9fb9-6f67-45ec-9668-2dcd2317aab0
如果你在防火墙后面,你需要让 Visual Studio 使用系统代理设置,这可以通过操作 devenv.exe.config 文件来完成。
在 Visual Studio 中打开它并更改如下部分:
<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>
关于visual-studio - 在 Visual Studio 2010 中添加 Web 引用以指向 Sharepoint 2007 站点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5411245/