visual-studio Visual Studio 2010 Web 部署任务失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2946340/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio 2010 Web deployment task failed
提问by Cranialsurge
I am trying to use VS2010's 1-Click Publish feature to deploy a test site from my laptop to my server. I have the firewall turned off on both machines and the MS Deployment Service is up and running on both my laptop and the server.
我正在尝试使用 VS2010 的一键发布功能将测试站点从我的笔记本电脑部署到我的服务器。我在两台机器上都关闭了防火墙,并且 MS 部署服务已在我的笔记本电脑和服务器上启动并运行。
However, when I try and publish from VS2010 on my laptop I get the following error:
但是,当我尝试在笔记本电脑上从 VS2010 发布时,出现以下错误:
Error 1 Web deployment task failed.(Remote agent (URL https://192.168.1.181/:8172/msdeploy.axd?site=LocationsTest) could not be contacted. Make sure the remote agent service is installed and started on the target computer.)
The requested resource does not exist, or the requested URL is incorrect.
Error details:
Remote agent (URL https://192.168.1.181/:8172/msdeploy.axd?site=LocationsTest) could not be contacted. Make sure the remote agent service is installed and started on the target computer.
An unsupported response was received. The response header 'MSDeploy.Response' was '' but 'v1' was expected.
The remote server returned an error: (404) Not Found. 0 0 Test.Web
错误 1 Web 部署任务失败。(无法联系远程代理(URL https://192.168.1.181/:8172/msdeploy.axd?site=LocationsTest)。请确保在目标计算机上安装并启动了远程代理服务.)
请求的资源不存在,或请求的 URL 不正确。
错误详细信息:无法联系
远程代理(URL https://192.168.1.181/:8172/msdeploy.axd?site=LocationsTest)。确保在目标计算机上安装并启动了远程代理服务。
收到了不受支持的响应。响应标头“MSDeploy.Response”为“”,但应为“v1”。
远程服务器返回错误:(404) 未找到。0 0 测试.Web
Any idea what I am doing wrong here?
知道我在这里做错了什么吗?
采纳答案by beatn1ck
回答by bhavinb
Restart visual studio.
重新启动视觉工作室。
I've had this one come up on a few occasions after having just successfully deployed a WebApp on a server running IIS 7.5. Obviously since a deployment/publishing was done successfully on the server just before this error came up, there was very little that could have gone wrong on the server setup/configuration (unless the previous successful deployment did something horribly wrong and removed some configuration parameters on the server).
我刚刚在运行 IIS 7.5 的服务器上成功部署了一个 Web 应用程序后,出现了几次这个问题。显然,由于在出现此错误之前在服务器上成功完成了部署/发布,因此服务器设置/配置几乎不会出错(除非之前成功的部署做了一些可怕的错误并删除了一些配置参数)服务器)。
After having rebooted the server, checked that Web Management service and Web Deployment service were running correctly, and verified from cUrl tool that a GET of the MsDeploy.axd was successful there was only one thing left to do. Restart Visual Studio. Magically post restart of VS publish started working again. All on its own. Magical stuff, this Web Deployment :)
重新启动服务器后,检查 Web 管理服务和 Web 部署服务是否正常运行,并通过 cUrl 工具验证 MsDeploy.axd 的 GET 成功,只剩下一件事要做。重新启动 Visual Studio。神奇地重新启动 VS 发布后再次开始工作。全靠自己。神奇的东西,这个网络部署:)
回答by Pavel Chuchuva
Make sure you have set Site/Application correctly in publish profile:

确保您在发布配置文件中正确设置了站点/应用程序:

You get the same error message if you spell site or application name wrong.
如果您拼错站点或应用程序名称,您会收到相同的错误消息。
回答by simbolo
Although a lot of different unrelated things can contribute to getting the 404, I solved it for my by.
虽然很多不同的不相关的事情都可以帮助获得 404,但我已经解决了它。
- When installing/reinstalling the WebDeploy installer, choose Custom/Change and then ensure that 'Management Service Delegation UI' is one of the installed options, it is not installed by default, but is required for WebDeploy to work (installer bug).
- Use the new Management Service Delegation icon in the Server node of the IIS manager to add the 'Deploy Applications with Content' role, accepting it's default settings. But you may also want to specify a "Run As" setting with a user that has rights to modify IIS settings.
- Restart the Web Management Service.
- 安装/重新安装 WebDeploy 安装程序时,选择自定义/更改,然后确保“管理服务委派 UI”是已安装选项之一,默认情况下未安装,但 WebDeploy 需要工作(安装程序错误)。
- 使用 IIS 管理器的服务器节点中的新管理服务委派图标添加“使用内容部署应用程序”角色,接受它的默认设置。但您可能还想为有权修改 IIS 设置的用户指定“运行方式”设置。
- 重新启动 Web 管理服务。
After this, everything works fine. Assuming the Web Management Service is setup correctly (mine is configured to accept remote connections, the firewall port was opened, and the user I'm uploading with was added to every single Site that I want to deploy to (using the IIS Manager Permissions icon in each Site node in the IIS Manager)).
在此之后,一切正常。假设 Web 管理服务设置正确(我的配置为接受远程连接,防火墙端口已打开,并且我上传的用户已添加到我想要部署到的每个站点(使用 IIS 管理器权限图标在 IIS 管理器中的每个站点节点中))。
回答by Nick
We found the issue was because WebDeploy was installed beforethe Web Management Service feature was enabled on a Windows 2008 server. After Web Management Service is installed, uninstall Web Deploy fully. Then resinstall and make sure allcomponents of the package are selected.
我们发现问题是因为在 Windows 2008 服务器上启用 Web 管理服务功能之前安装了WebDeploy 。安装Web Management Service后,完全卸载Web Deploy。然后重新安装并确保选择了包的所有组件。
Following the reinstallation we were immediately able to publishing to the server from my local machine, and also from our CI.
重新安装后,我们立即能够从我的本地机器以及我们的 CI 发布到服务器。
A couple of points to note after reading the other answers:
阅读其他答案后需要注意的几点:
- If you are getting a 404 error the problem is not one of security.
- We did not have to restart Visual Studio for this change to take effect.
- Reinstallation will kick off the services in automatic mode, do not adust this setting.
- 如果您收到 404 错误,则问题不是安全问题。
- 我们无需重新启动 Visual Studio 即可使此更改生效。
- 重新安装将在自动模式下启动服务,请勿调整此设置。
回答by WVDominick
I was able to fix the same issue when I changed the "Service URL" which uses "Windows Management Service" from:
当我从以下位置更改使用“Windows 管理服务”的“服务 URL”时,我能够解决相同的问题:
https://ExampleURL:8172/msdeploy.axd?site=SiteName
to this which uses "Remote Agent Service" instead:
对此使用“远程代理服务”:
http://ExampleURL
It worked just fine after that.
在那之后它工作得很好。
回答by Adamy
I got this error because I changed my password. The deployment wizard still saved my old password, after retyped my password, everything works fine now.
我收到此错误是因为我更改了密码。部署向导仍然保存了我的旧密码,重新输入密码后,现在一切正常。
回答by Mike the Tike
I've installed a couple of web servers and I keep getting this issue, so I'm posting my answer here so that I find it when I Google the problem.
我已经安装了几个网络服务器,但我一直遇到这个问题,所以我在这里发布我的答案,以便在我搜索问题时找到它。
Basically I always install Web Deploy 3 from the Web Platform Installer. This is the first mistake. For some reason this only installs half the stuff you need. If you have installed this, uninstall it and download the Web Deploy installer. Then choose "Complete" install.
基本上我总是从 Web 平台安装程序安装 Web Deploy 3。这是第一个错误。出于某种原因,这只会安装您需要的一半内容。如果您已经安装了它,请卸载它并下载 Web Deploy 安装程序。然后选择“完成”安装。
If you are following this guide
如果您遵循本指南
Then disregard option 1.

然后忽略选项1。

Start reading again from "2. Download the Web Deploy installer ..."
再次开始阅读“ 2. 下载 Web 部署安装程序...”
回答by RaSor
I got 404 from a IE browser from https:// servername:8172/MsDeploy.axd
我从 https:// servername:8172/MsDeploy.axd 的 IE 浏览器得到 404
But Chrome did not make trouble.
但 Chrome 并没有惹麻烦。
This can be the first test to see if you can reach the Web Management service on the server at all. In other words: When chome worked (it responded with a blank page), then you have hole through to the service on the server.
这可能是第一个测试,看看您是否可以访问服务器上的 Web 管理服务。换句话说:当 chome 工作时(它以空白页响应),那么您就可以访问服务器上的服务。
Still you also need to have permission to deploy to the specific site. In IIS find the site and do that in "IIS Manager Permissions" under Management.
您仍然需要具有部署到特定站点的权限。在 IIS 中找到该站点并在“管理”下的“IIS 管理器权限”中执行此操作。
回答by AMissico
Silly me, I didn't have .NET 4 installed on the server
傻我,我没有在服务器上安装 .NET 4

