【问题标题】:MsDeploy fails for webdeployWebdeploy 的 MsDeploy 失败
【发布时间】:2012-06-05 09:20:09
【问题描述】:

我正在尝试网络部署。

因为我希望能够重现这个,所以我使用了一个测试系统

Windows 2008 RC,IIs 7.5 + 部署包 我使用配置部署 http://learn.iis.net/page.aspx/516/configure-the-web-deployment-handler/ 启用跟踪 http://technet.microsoft.com/en-us/library/ff729439(v=ws.10).aspx

我创建了一个新的 WCF 服务应用程序,(没有改变)编译它并尝试部署

我收到以下回复(几分钟后)

------ Build started: Project: WcfService1, Configuration: Debug Any CPU ------
  WcfService1 -> C:\Development\BrandShield\Services\WcfService1\bin\WcfService1.dll
------ Publish started: Project: WcfService1, Configuration: Debug Any CPU ------
Transformed Web.config using Web.Debug.config into obj\Debug\TransformWebConfig\transformed\Web.config.
Auto ConnectionString Transformed obj\Debug\TransformWebConfig\transformed\Web.config into obj\Debug\CSAutoParameterize\transformed\Web.config.
Copying all files to temporary location below for package/publish:
obj\Debug\Package\PackageTmp.
Start Web Deploy Publish the Application/package to http://dev1:8172/msdeploy.axd/MSDEPLOYAGENTSERVICE ...
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Error : Web deployment task failed.(Could not complete the request to remote agent URL 'http://dev1:8172/msdeploy.axd/MSDEPLOYAGENTSERVICE'.)
This error indicates that you cannot connect to the server. Make sure the service URL is correct, firewall and network settings on this computer and on the server computer are configured properly, and the appropriate services have been started on the server.
Error details:
Could not complete the request to remote agent URL 'http://dev1:8172/msdeploy.axd/MSDEPLOYAGENTSERVICE'.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host
Publish failed to deploy.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

并且在 dev1 服务器端没有(根本)日志。

我尝试了很多变体,但这是最简单、最容易重现的方法。它失败了。

有什么想法吗?

【问题讨论】:

标签: visual-studio-2010 iis-7.5 webdeploy


【解决方案1】:

我发现了问题。

我使用 dev1:8172/msdeploy.axd 而不是“http://”dev1:8172/msdeploy.axd

这实际上与“https://”dev1:8172/msdeploy.axd 相同,出于某种原因,这是部署代理侦听的位置。

从这里,你会得到一个新的错误:

Could not complete the request to remote agent URL 'https://dev1:8172/msdeploy.axd?site=Default web site'. 
The underlying connection was closed: 
Could not establish trust relationship for the SSL/TLS secure channel.
The remote certificate is invalid according to the validation procedure.

这是因为您没有 SSL 证书。

在发布配置文件窗口中,您需要检查 “允许不受信任的证书”复选框

并且发布应该成功。祝你好运

【讨论】:

    【解决方案2】:

    通过证书:

    第 1 步:

    System.Net.HttpWebRequest req = (HttpWebRequest)WebRequest.Create(Url);
    ServicePointManager.ServerCertificateValidationCallback = AcceptAllCertifications;
    

    第 2 步:

    public Boolean AcceptAllCertifications(Object sender, System.Security.Cryptography.X509Certificates.X509Certificate certification, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors)
    {
        return true;
    }
    

    【讨论】:

      【解决方案3】:

      在我的情况下,我在 Azure DevOps 构建管道中遇到了这个问题,这是构建代理(本地机器)和 Azure DevOps之间的 SSL/TLS 版本不匹配>。我不知道为什么会这样,但我按照guide 详细说明了在注册表中使用 SCH_USE_STRONG_CRYPTO 标志来强制使用“强加密”(TLS 1.2、TLS 1.1 和 TLS 1.0)。

      在构建代理机器上,我使用 .NET Framework 4 (x86/x64) 的以下键更新了注册表:

      [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319]
      "SchUseStrongCrypto"=dword:00000001
      
      [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319]
      "SchUseStrongCrypto"=dword:00000001
      

      我仍然不明白为什么我没有从一开始就使用“强密码学”以及我实际使用的是什么? (SSL v.X?为什么?)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-03-10
        • 1970-01-01
        • 2015-12-13
        • 2013-02-12
        • 1970-01-01
        • 1970-01-01
        • 2018-06-13
        • 1970-01-01
        相关资源
        最近更新 更多