IIS 7 and Above
Problems with Web Deploy: "The response header 'MSDeploy.Response' wa...
Last post Apr 06, 2011 09:37 AM by joja
Mar 08, 2011 10:02 PM|brentonw|LINK
I'm having problems getting Web Deploy working from Visual Studio 2010. Here's the error that is being generated:
Error 1 Web deployment task failed.(Remote agent (URL https://server:8172/MsDeploy.axd?site=Default Web Site) 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.
Remote agent (URL https://server:8172/MsDeploy.axd?site=Default Web Site) 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 TestSimpleWebApplication
Initially, I took the following steps, loosely based on this post by Scott Guthrie: http://weblogs.asp.net/scottgu/archive/2010/09/13/automating-deployment-with-microsoft-web-deploy.aspx. Note, it's not totally relevant, since it has instructions for an
older version of Web Deploy and the Web Platform Installer.
Here's what I did:
At this point I experienced the above error from Visual Studio. I've hunted around many forums looking for ways to fix this, but haven't found a solution yet. I found and tried the following suggestions, to no avail:
Some other notes:
Does anyone have any suggestion as to how to actually make this work?
Thanks in advance for your help.
Mar 09, 2011 01:44 AM|kctt|LINK
You might find solution in this topic
Mar 09, 2011 02:20 AM|brentonw|LINK
I saw that thread. It deals with IIS 6 issues, not IIS7. Either way, I couldn't find anything in there that helped solve my problem.
Mar 10, 2011 01:36 AM|timamm|LINK
Here are some things that may help:
* To find the Management Service Delegation icon in IIS Manager, make sure your web server node is selected in the Connections pane hierarchy (not a Web site or Web application node). Because MSD is a server-level feature, the server node is the only context
in which the icon will appear, . That should allow you to follow the steps in ScottGu's blog to enable the checkbox that says: "Allow administrators to bypass rules".
* Make sure that the "Web Deployment Agent Service" listed in Services is started. (Unfortunately, there are a plethora of informal names for this service - you might find it called the "Remote Agent Service," "Web Deploy Agent Service," "MS Deploy Agent
Service," "Remote Agent," or "Remote Service.") If you're using Web Deploy as an administrator, this is the way to go - and in fact only admins can use the service.
* Try using http as a first step instead of https. VS 2010 defaults to using https, which is more secure, but you may not need it if you're using Windows authentication since it's encrypted.
* In VS 2010, in the Publish dialog box, you might try specifying http://<ip address> where the ip address is of the Web server. That worked for me on an intranet using http, so it might work over the internet as well.
Mar 14, 2011 09:22 PM|brentonw|LINK
@timamm - thanks for the response, I tried your suggestions but still can't get this working:
1. I did get the Management Service Delegation icon to show up by uninstalling and reinstalling Web Deploy 2.0 per my original post:
"Removed the "Web Deploy 2.0" package and re-installed manually instead of via the Web platform installer so I could get the "Management Service Delegation" icon to show up. I made sure that the "Enable Administrators to bypass rules" was checked. No effect,
same error. "
2. I made sure the "Web Deployment Agent Service" was started, but still receive the same error as before
3. I tried HTTP instead of HTTPS, this yielded a different error:
"Error 1 Web deployment task failed.(Could not complete the request to remote agent URL 'http://server:8172/msdeploy.axd/MSDEPLOYAGENTSERVICE'.)
This error indicates that you cannot connect to the server. Make sure the service URL is correct, firewall and network settings on this computer and on the server computer are configured properly, and the appropriate services have been started on the server.
Could not complete the request to remote agent URL 'http://server:8172/msdeploy.axd/MSDEPLOYAGENTSERVICE'.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host 0 0 TestSimpleWebApplication"
4. I tried your other suggestion of using the IP address, however, I got the same error as above.
Is there anybody from the IIS Web Deploy team who can shed some light on to these errors?
Mar 15, 2011 03:21 PM|RightCoder|LINK
I have the same problem as Brenton, I have used hours to try every possible solution suggested. Is this really so complicated and difficult to solve?
I cant belive deploying av Web App should be that difficult.
Anyone have a solution that works?
Mar 15, 2011 04:33 PM|krolson|LINK
Could you please post the command that results in the error? It is possible there is a problem there.
One thing to try to confirm that everything is configured correctly would be to do an msdeploy.exe dump operation just to confirm that you can connect. On command line go to %programfiles%\IIS\Microsoft Web Deploy v2 and run a command similar to the following
(some adjustment will be required for your specific computer/user info):
msdeploy.exe -verb:dump -source:iisapp="Default Web Site",computername="https://<servername>:8172/msdeploy.axd?site=Default%20Web%20Site",username=<adminUserName>,password=<userPassword>,authType=basic -allowUntrusted
If this doesn't work, please post the error that occurs for this as well.
Another thing to keep in mind is that the commands posted earlier are all using the "handler" service (when you're connecting to msdeploy.axd). One problem could be that the WMSvc service is not started or was not recycled after install (you can try to do
a net stop WMSvc & net start WMSvc).
I am not as familiar with the VS entry options, but if you want to use the "agent" service instead (the admin only service that only requires that msdepsvc service is started on the server), you could try a similar test command, and if this works where the
previous command doesn't, you would simply have to switch the VS target to use the agent, so the connection would be more like http://<servername>/MSDEPLOYAGENTSERVICE - for msdeploy cmd line we just require computer name but I think VS might do some formatting
by default to convert to use "handler" if you aren't explicit with the full URL.
msdeploy.exe -verb:dump -source:iisapp="Default Web Site",computername=<servername>,username=<adminUserName>,password=<adminPassword>
Let me know if these commands don't yield any positive results!
Mar 16, 2011 09:23 AM|RightCoder|LINK
It may seem like I have an error in my command because with the command you suggests I get a positive response. Here is my command:
if "$(ConfigurationName)" == "Release" "$(TargetDir)_PublishedWebsites\Host_Package\Host.deploy.cmd" /Y /M:https://<myserver>:8172/MSDeploy.axd /U:<username> /P:<password>
I do this in the VS 2010 projects Post Build Event. I can see there is a difference to the command-prompt command you suggests but I guess my post-build-event-script works against the "msdeploy.exe"?
Mar 17, 2011 05:41 PM|krolson|LINK
So I think that VS will actually output the msdeploy command, Sayed has a nice blog post on how to get it to do this:
This would allow you to see the difference between the cmd you tried that worked and what may or may not be specified in the cmd that VS is generating. If you post that msdeploy.exe cmd I'll be more able to give suggestions.
To check if it's a problem that's only specific to using the handler (which will often require more settings), if the 2nd command I noted (msdeploy.exe -verb:dump -source:iisapp="Default Web Site",computername=<servername>,username=<adminUserName>,password=<adminPassword>)
worked for you just try modifying the VS command /M argument to only computername "/M:<myserver>" to see if that gets you going - I believe this is the only change required to use the Agent service instead of the handler.
Mar 22, 2011 06:54 AM|brentonw|LINK
I tried both of your suggestions: running msdeploy.exe from the command line and changing VS to use the msdeploy.exe then looking at the output.
When running from the command line, I got the exact same error as I was getting originally:
C:\Program Files\IIS\Microsoft Web Deploy V2>msdeploy -verb:dump -source:iisapp=
"Default Web Site",computername="https://[server]:8172/MsDeploy
Error: Object of type 'iisApp' and path 'Default Web Site' cannot be created.
Error: Remote agent (URL https://[server]:8172/MsDeploy.axd?sit
e=Default Web Site) could not be contacted. Make sure the remote agent service
is installed and started on the target computer.
Error: An unsupported response was received. The response header 'MSDeploy.Respo
nse' was '' but 'v1' was expected.
Error: The remote server returned an error: (404) Not Found.
Error count: 1.
When I altered VS to use the msdeploy.exe using the instructions on http://sedodream.com/2010/11/04/WebDeployHowToSeeTheCommandExecutedInVisualStudioDuringPublish.aspx, it doesn't work at all, instead, I get the following error:
Start Web Deploy Publish the Application/package to https://[server]:8172/MsDeploy.axd?site=Default%20Web%20Site ...
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3605,5): Error MSB6001: Invalid command line switch for "msdeploy.exe". Value cannot be null.
Parameter name: path1
Any more suggestions?
Mar 30, 2011 08:44 PM|mintal|LINK
Apr 06, 2011 09:37 AM|joja|LINK
I'm having the exact same error. Any progress made on this issue?
Ok, so I managed to fix the error. What brought me to the solution was enabling the failed request tracing logs for the delegation service and then restarting the service. After that I was able to see in the logs that i was really getting a 401.2 error
saying that the useraccount i was accessing under didn't have the right permissions.
So in the management service delegation i added the deploy application with content and set permissions for applications rules for my iis user i created and now it works. You also have to make sure that the account the service is running under (local service
with me) has full control rights on the physical folder you are trying to update. Oh, and don't forget to restart the service again after doing so.
Hope this can help you 2.