On my current project I am in charge of getting a fresh install of Server 2008 R2 with IIS 7.5 running to support a Silverlight web site and its accompanying  WCF service. Here are the some of the error messages and tips and tricks I did to get Visual Studio 2010 Web Deploy to work.

IIS 7.5 Failure Possibilities

Web deployment task failed.(Remote agent (URL http://… //MSDEPLOYAGENTSERVICE) could not be contacted.  Make sure the remote agent service is installed and started on the target computer.)

Remote agent (URL http://… //MSDEPLOYAGENTSERVICE) 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: (503) Server Unavailable.

These errors can come up and for the most part can be fixed on the Server which is running IIS.

  1. Web Deploy package is not installed on the IIS server in question. To install find the “Web Deploy” or “Web Deploy 2.0” from the top level IIS.Net\Download (for downloading all extensions) or directly on the Web Deploy 2.0 page.  Alternately if the Platform installer addin is installed one can find it through the IIS Server Manager where one can also install it and other goodies. (The platform installer as shown below can be found in the Server list or and individual website list of icons in the management section.)
    WebPlatform
  2. Even if Web Deploy package is installed, the service is not running automatically. Follow these steps to find the correct service and get it running.
    1. Run services.msc from the start bar or command line.
    2. Search for the service named Web Deployment Agent Service. Once found verify it is running and also starts up automatically after a reboot.
      WebDeploymentAgentService
  3. Also your account may not have permissions to publish to the web site in question. In IIS Management Studio, find the website in question and make sure your (or other’s) credentials are found in the IIS Manager Permission list.
    Permissions

Fear and Loathing in Visual Studio During Publish

Here are some of the errors one can get when trying to publish

Web deployment task failed.(Could not complete the request to remote agent URL ‘https://{your server name}:8172/msdeploy.axd?site=Default Web Site’.)

Could not complete the request to remote agent URL ‘https://{your server name}: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.

If you get one of the above, it is suggesting that it cannot find your server. To fix this situation, specify the server name with HTTP:// behind it. For example if (on your intranet) you remote to your server named ValHalla Visual Studio expects you to have this in the server line to look like this:
Service URL

No need to have /MsDeploy.axd!

Wait There is More

If you receive any of these errors:

Invalid Service Url

Web deployment task failed. An error occurred when the request was processed on the remote computer.)

An error occurred when the request was processed on the remote computer.
Site ‘OneSource’ does not exist.

Check the website name. Note IIS is setup with at default web site named “Default Web Site”. If that is the case then literally specify “Default Web Site” in the list. Otherwise find the name of the target website and the application/service which has been setup in IIS and make sure one is publishing to that site/name combination. The following example is publishing the OneSource site to a “Default Web Site” in IIS.

Default

I hope this helps (HTH) to any whomever may come after. Smile

Share