VS 2010 Publish using Web Deploy
Asked Answered
M

3

7

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.

Measure answered 30/3, 2011 at 18:22 Comment(0)
N
5

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

Noellenoellyn answered 30/3, 2011 at 18:32 Comment(5)
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.Measure
@zote - have you allowed port 8172 in your firewall?Noellenoellyn
yes. Our DMZ FW is allowing it and windows firewall is disabled. Our sysadmin is monitoring and nothing is being blocked or dropped.Measure
@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.Homeric
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?Tarpeia
T
1

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.

Terrilyn answered 23/3, 2012 at 12:39 Comment(0)
A
1

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.

Allo answered 13/8, 2012 at 14:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.