VS 2010 Publish using Web Deploy

iis-7visual studio 2010web-deployment-projectwebdeploywindows-server-2008-r2

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.

Best Answer

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