Visual Studio 2010 Web deployment task failed

2019-01-08 10:36发布

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.

However, when I try and publish from VS2010 on my laptop I get the following error:

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

Any idea what I am doing wrong here?

15条回答
相关推荐>>
2楼-- · 2019-01-08 10:48

This same message would occur almost at random when publishing projects from visual studio 2010.

The fix was to delete the $projectname.Publish.xml file (in the root directory of the project) and re-create it.

查看更多
相关推荐>>
3楼-- · 2019-01-08 10:50

If you are using an SSL certificate you should go into Management Service under the IIS Manager section of Server Manager and stop the service, select the correct certificate and then start the service again. This is what worked for me (I was getting Forbidden message).

查看更多
Melony?
4楼-- · 2019-01-08 10:56

I was able to fix the same issue when I changed the "Service URL" which uses "Windows Management Service" from:

https://ExampleURL:8172/msdeploy.axd?site=SiteName

to this which uses "Remote Agent Service" instead:

http://ExampleURL

It worked just fine after that.

查看更多
我只想做你的唯一
5楼-- · 2019-01-08 10:59

We found the issue was because WebDeploy was installed before the 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 all components of the package are selected.

Following the reinstallation we were immediately able to publishing to the server from my local machine, and also from our 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.
查看更多
聊天终结者
6楼-- · 2019-01-08 11:01

Even though all required software are installed I had similar error. I noticed that the service URL didn't prefixed with http://. Once prefixed it works well.

查看更多
疯言疯语
7楼-- · 2019-01-08 11:02

Like a dummy, this error was throwing for me because I hadn't installed the Remote Web Agent as part of the Web Deployment Tool available here.

查看更多
登录 后发表回答