visual-studio - Web 部署任务失败。无法连接...服务器没有响应

标签 visual-studio iis deployment msdeploy webdeploy

我已经使用 Visual Studio 2012 RC 将 Lightswitch 应用程序发布到我的本地主机(Win 7、SQL 2008 R2、IIS 7.5),效果很好。现在我尝试发布到远程服务器(Win 2008 R2、SQL 2008 R2、IIS 7.5),但遇到了麻烦。

当我尝试发布时,收到以下错误:

Web deployment task failed. (Could not connect to the remote computer ("###.###.###.###") using the specified process ("Web Deployment Agent Service") because the server did not respond. Make sure that the process ("Web Deployment Agent Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.)

我已经检查了“了解更多”链接建议检查的每一项内容。我已验证 MsDepSvc 和 WMSVC 都在运行,并且端口 80 和 8172 都响应端口扫描。在发布设置中,对于服务 URL,我使用远程计算机的 IP 地址 ( http://###.###.###.### )。对于用户名,我使用 DomainName\Administrator,这是我使用 RDP 登录的名称。

我已在 MSDN Forums 上发布一位成员建议我将 Web 部署工具从 V2.0 回滚到 V1.1。我已经这样做了,但它没有改变任何东西。

遵循对此问题的回答中的建议SO Question我尝试过从命令行运行 msdeploy

服务器上的命令行我得到:

C:\Program Files\IIS\Microsoft Web Deploy>msdeploy -verb:dump -source:dirpath=c:\temp,computername=http://SeverName:80/msdeployagentservice,username=Administrator,password=XXXX -verbose -debug Verbose: Using ID 'c12c3392-2290-44b7-9434-dbd0ff5f9385' for connections to the remote server. Verbose: Pre-authenticating to remote agent URL 'http://ServerName:80/msdeployagentservice' as 'Administrator'. MSDeploy.dirPath (name=MSDeploy.dirPath) c:\temp (name=dirPath) (keyAttribute=c:\temp) (linkName=Child1)

开发机器上的命令行我得到:

C:\Program Files\IIS\Microsoft Web Deploy V3>msdeploy -verb:dump -source:dirpath =c:\temp,computername=http://###.###.###.###:80/msdeployagentservice,username=Administrator,password=XXXX -verbose -debug Info: Using ID '7f0b7d5b-e202-424c-a7dd-246920253081' for connections to the remote server. Verbose: Pre-authenticating to remote agent URL 'http://###.###.###.###:80/msdeployagentservice' as 'Administrator'. Verbose: Pre-authenticating to remote agent URL 'http://###.###.###.###:80/msdeployagentservice' as 'Administrator'. Error Code: ERROR_COULD_NOT_CONNECT_TO_REMOTESVC More Information: Could not connect to the remote computer ("###.###.###.###") using the specified process ("Web Deployment Agent Service") because the server did not respond. Make sure that the process ("Web Deployment Agent Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC. ---> Microsoft.Web.Deployment.DeploymentException: Object of type 'dirPath' and path 'c:\temp' cannot be created. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request. at System.Net.HttpWebRequest.GetResponse() at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponse(HttpWebRequest request) --- End of inner exception stack trace --- --- End of Inner Exception Stack Trace --- at Microsoft.Web.Deployment.DeploymentManager.CreateObjectPrivate(DeploymentProviderContext providerContext, DeploymentBaseOptions baseOptions, DeploymentObject sourceObject, String serverVersion) at Microsoft.Web.Deployment.DeploymentManager.CreateObject(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions) at MSDeploy.MSDeploy.CreateObject(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions) at MSDeploy.MSDeploy.ExecuteWorker() at MSDeploy.MSDeploy.Execute()
at MSDeploy.MSDeploy.Main(String[] unusedArgs) Error count: 1.

使用 Wireshark,我发现我登录正常,但在 POST/MSDEPLOYAGENTSERVICE 之后,我收到错误 400:错误请求,如下所示:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">\r\n
<HTML><HEAD><TITLE>Bad Request</TITLE>\r\n
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>\r\n
<BODY><h2>Bad Request - Invalid Content Length</h2>\r\n
<hr><p>HTTP Error 400. There is an invalid content length or chunk length in the request.</p>\r\n
</BODY></HTML>\r\n

我能找到的唯一提到这种特定行为的是 Microsoft Support Article适用于 ISA Server 2000。

我还应该注意什么?

最佳答案

当我使用“Web Platform Installer 5.0”安装 Web Deploy 3.5 时,我遇到了同样的问题

当我尝试从 Visual Studio 发布时,出现此错误:

---------------------------
Microsoft Visual Studio
---------------------------
Could not connect to the remote computer ("10.0.3.102") using the specified process 
("Web Management Service") because the server did not respond. Make sure that the process 
("Web Management Service") is started on the remote computer.  Learn more at: 
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC. 
The remote server returned an error: (403) Forbidden.
---------------------------
OK   
---------------------------

我仔细检查了服务,两者都在运行。我也关闭了防火墙,但仍然出现同样的错误。

我是如何解决这个问题的:

  1. 打开“添加或删除”程序
  2. 点击“Microsoft Web 部署”
  3. 点击“更改”按钮(“卸载”旁边)
  4. 点击“下一步”

enter image description here

  • 点击“更改”
  • enter image description here

  • 添加标有红色 X 的功能
  • enter image description here

  • 完成安装

    结果:从 Visual Studio 发布正在运行

  • 关于visual-studio - Web 部署任务失败。无法连接...服务器没有响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11796838/

    相关文章:

    asp.net - IIS 服务器如何工作(线程)

    c# - 如何防止搜索引擎缓存提供的自定义处理程序 "text/plain"类型

    c# - 如何针对不同的构建配置使用项目中的不同文件 - Visual Studio C# .net

    c# - VS Code 指标如何计算

    c++ - MSVC2013 : How to avoid aborting build process with Pre-build script in error (error MSB3073: :VCEnd"exited with code -1)

    c# - IIS/SQL Server 连接错误

    deployment - Windows 8 模拟器命令行界面

    node.js - 如何在实时 Web 服务器上部署/使用 lit-html、lit-element

    deployment - Laravel:部署和供应商文件夹

    visual-studio - 由于 FileNotFoundException、异常转换测试,NUnit VS Adapter 无法发现测试