VS 2010 Publish using Web Deploy

19,334

Solution 1

Take a look at this answer I provided for someone encountering a different issue, WebDeploy has a few gotcha's:

msdeploy (Web Deploy) failing with 401 auth issues

Also make sure you upgrade to WebDeploy 2.0 if you have control over both your development machine and the server.

And finally make sure you configure the server properly, trust me taking the time over this step can save hair:

Configure Web Deploy

Solution 2

I pulled my hair out for 4 hours over this. Here's what I used for config settings. In IIS (7.5 on server 2008 R2)

I gave publishing permissions to an IIS account I had set up (although I used the Server Admin account also, to rule out permission issues, in the end, both worked.)

I left everything else as is. The sever I deployed to was a VPS, so the computer name had nothing to do with my application, or domain, so I left the Specify the URL for the publishing connection as it was. I left the location to save the publish settings file as it was.

In Visual Studio:

  • Publish Method: Web Deploy
  • Service URL: https://myservice.com (no port or msdeploy here, just the url over https)
  • site application: mysitename/myapplicationname (for me they were both the same name)
  • Mark as IIS application : checked
  • Leave Extra files: checked
  • Allow Untrusted Cert: checked

For the username - I did not need to use the fully resolved name, so user, as opposed to servername\user - worked fine.

This failed with a 404 error - and if I tried sending it over http instead of https(Service URL) it failed with a socket error (10054).

I verified that all the required services were running and I restarted them all. I also restarted IIS (which for my situation is painful). Still nada.

Then I decided to re-install web deploy on the server(3.0 RC). I made sure to use the custom install option, when I did that I made sure that all components and handlers were installed (they aren't by default). Once I did this everything started to work fine.

I'm not sure if I had a bad install the first time around, but it's working great now.

Solution 3

For those still looking, I had to make sure to:

  • Specify port 8172, use the default service name (msdeploy.axd), use https and check the box to allow untrusted certificates in the publish service url from Visual Studio: https://serveraddress:8172/msdeploy.axd

Also, I found this IIS article to be extremely helpful for setting up the service.

Share:
19,334
Harish
Author by

Harish

Developer actually using C# and SQLAnywhere but with long experience with Delphi.

Updated on August 10, 2022

Comments

  • Harish
    Harish over 1 year

    I'm trying to deploy my ASP.NET MVC 3 web application using VS2010 Publish feature. I'm using Web Deploy as Publish method, but I'm getting this error:

    Error 1 Web deployment task failed.(Remote agent (URL http://192.168.1.11/MSDEPLOYAGENTSERVICE) could not be contacted. Make sure the remote agent service is installed and started on the target computer.) Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator. Error details: Remote agent (URL http://192.168.1.11/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 'V1' but 'v1' was expected. The remote server returned an error: (401) Unauthorized.

    How can I bypass this and to put it work? My server is Windows 2008 R2.

  • Harish
    Harish about 13 years
    now I'm getting this: Warning : Retrying the sync because a socket error (10054) occurred. Retrying operation 'Serialization' on object sitemanifest (sourcePath). Attempt 3 of 10.
  • Kev
    Kev about 13 years
    @zote - have you allowed port 8172 in your firewall?
  • Harish
    Harish about 13 years
    yes. Our DMZ FW is allowing it and windows firewall is disabled. Our sysadmin is monitoring and nothing is being blocked or dropped.
  • jazzy
    jazzy almost 13 years
    @zote - are you using http or https? Even if it's local you still use https with 'allow untrusted certificate'. Double-check the "Url for the publishing server connection" textbox from the second link that @kev posted.
  • Konstantin Tarkus
    Konstantin Tarkus almost 13 years
    I am also getting an error "Warning : Retrying the sync because a socket error (10054) occurred. Retrying operation 'Serialization' on object sitemanifest (sourcePath). Attempt 1 of 10." Did anyone find a solution how to fix it?