visual-studio - 在 Visual Studio 2010 中添加 Web 引用以指向 Sharepoint 2007 站点

标签 visual-studio sharepoint web-reference

我正在构建一个控制台应用程序,该应用程序可以加载内容类型并通过 C# 去除其上的印章。在尝试向应用程序添加 Web 引用时,我收到一个奇怪的错误,因为我在另一个应用程序中使用了相同的 Web 引用并且它工作正常。我很确定我之前遇到过这个问题并修复了它,但我不记得是如何:(

我的步骤:

  • 右键单击项目,然后单击 添加服务引用...
  • 点击高级... 按钮
  • 点击添加 Web 引用... (尝试将其添加为服务引用时,我收到相同的错误)
  • 在文本框中粘贴 URL:http://(domain)/videolibrary/_vti_bin/lists.asmx然后按 输入
  • 左侧的框显示了我所有的服务操作,但为 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/

    相关文章:

    .net - Visual Studio Web引用错误

    visual-studio-2010 - 如何执行与从Powershell中发布Visual Studio中的发布完全相同的功能

    git - 在 VSTS 中设置 GitFlow - 最佳实践?

    javascript - 检索两个列表,对值进行排序和比较,然后显示所有结果

    visual-studio - 在 VS 中自动更新项目中的所有 Web 引用

    winforms - 我可以更改配置文件中的 Web 服务引用 URL 吗?

    visual-studio - MSTest 和 AppDomains

    visual-studio - 何时应使用密码保护强名称 key 文件?

    .net - CAML 查询比较 DateTime 与 Eq

    javascript - 如何在Sharepoint中计算项目进度