I trying to get VS 2010 Beta 2 one-click publish (MSDeploy) working against IIS 7.5 running on Windows Server 2008R2. I can successfully build a package and manually copy the package files (<appname>.deploy.cmd, <appname>.SetParameters.xml, <appname>.SiteManifest.xml,
<appname>.zip) from my Windows 7 / VS 2010 machine to the Windows Server and then run the <appname.deploy.cmd file and it successfully installs. So MSDeploy itself and the packaging from VS 2010 Beta 2 are working fine.
On my Windows Server 2008R2, I've installed MSDeploy (clearly). SSL is configured and certificate installed. "Web Deployment Agent Service" and "Web Management Service" are up and running. "Enable Remote Connections" is checked for "Management Service"
in IIS Manager. Firewall is disabled (for now) on the Windows Server. And from my Windows 7 box, I can establish Telnet connection to port 8172. But at the end of Publish... from VS 2010, I get the following error:
Error detail:
Remote agent (URL https://192.168.0.113:8172/msdeploy.axd?site=<sitename>) 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.
When I look on my Windows Server in the \inetpub\logs\wmsvc\W3SVC1\xxx.log, I see the following entry:
It looks like everything's configured and TCP is even responding on port 8172 but for some reason, the 1-click deployment is still failing with "404 file not found".
Would love any advice that'd lead in a good direction to track down the root cause and get 1-click working. (Getting tired of manually copying files and running scripts.)
Microsoft (R) Web Deployment Command Line Tool (MSDeploy.exe)
Version 7.1.600.0
Copyright (c) Microsoft Corporation. All rights reserved.
Windows 7 Ultimate (VS 2010 Beta 2 dev machine):
Microsoft (R) Web Deployment Command Line Tool (MSDeploy.exe)
Version 7.1.600.0
Copyright (c) Microsoft Corporation. All rights reserved.
--
They are the same version. Not sure if 7.1.600.0 is the version I'm supposed to be using. And I do not remember installing Web Deployment Tool on my Windows 7 Ultimate dev machine. Must have been installed there as part of VS 2010 Beta 2?
I've spent the past week working though MSDeploy issues trying to get my VS 2010 Beta2 to one-click deploy to my Windows Server 2008 R2 with IIS 7.5. I've managed to get it working but have taken quite a circuitous route through many trials and errors.
So I'll post what I think were some key hints I stumbled upon that may save others some time.
-------------
HINT #1 - In IIS Manager's "Web Platform Installer", install *all* of the "Management" features and after that run the "Web Deployment Tool" installer.
I had just "IIS Management Console" and "Management Service" installed (with WMSVC confirmed as running in Services admin panel) and I'm pretty sure that I only saw TWO, not FOUR installable features when I ran the "Web Deployment Tool" installer (http://www.iis.net/expand/WebDeploymentTool).
The options "IIS 7 Deployment Handler" and "Management Service Delegation UI" were *not* available even though WMSVC installed and running on my machine. (Is this a bug in docs or in "Web Deployment Tool" installer??)
But after installing *all* Management features in the "Web Platform Installer",
when I re-ran the "Web Deployment Tool" installer (Control Panel | Programs | Programs and Features, then right-click "Web Deployment Tool" and select "Change") the two new features showed up (showing all features listed in picture above) and I was able to
mark them as "install to hard disk" and get them installed. Then and only then was I able to see the "Management Service Delegation" feature in IIS Manager.
At this point, I was still getting "(404) Not Found" errors from the MSDeploy client.
-------------
HINT #2 - If getting inexplicable "(404) Not Found" and you're sure WMSVC and MsDepSvc are both running (OS' Services panel), try adding explicit IPv4 "Allows" in IIS Manager's "Management Service" pane. Don't know why this worked, but I explicitly added an
"Allow..." for my local IP subnet in the "IPv4 Address Restrictions" area of "Management Service" pane in ISS Manager.
And then my client stopped reporting "(404) Not Found" errors. Funny thing was I reverted back by removing the explicit "Allow" for local IP subnet and the client continued to work so I cannot say what was causing the "(404) Not Found" errors...a strange bug
which goes away when inserting and then removing explicit "Allows"??
Once past the "(404) Not Found" error, the one-click wizard was reporting a different type of error. I was getting "you do not have permissions" and "see your System Administrator" (that would be me) errors from my one-click client.
-------------
HINT #3 - Do verbose logging on your server side to debug permissions problems seen by MSDeploy clients.
Read this article
http://technet.microsoft.com/en-us/library/ee461173%28WS.10%29.aspx and set up full (verbose, level 4) tracing across "All" (-1 in regedit didn't work for me but 0x1ff aka 511 did) trace sources. Then try something from your VS 2010 Beta2 one-click deploy
client and read the verbose XML logs on your IIS machine to figure out what additional permissions to grant (hint, visually read from end of XML file until you see a stack trace and just above it usually you'll find an English string describing root cause).
In the end, I ended up with two key grants in IIS Manager's "Management Service Delegation" pane.
The first grants delegation to "*" (all) users, and I have a special IIS Manager User I configured for installs, to do "dbFullSql" provider for specified data source. The second grants delegated privileges to do all other relevant MSDeploy providers. Also,
don't forget that since WMSVC runs as NT account "Local Service" that you must grant "Local Service" appropriate SQL Server access (I used SQL Server Studio to do that) and file directory permissions. A good articles on those required file system grants:
http://blogs.iis.net/krolson/archive/2009/11/04/using-iis-manager-accounts-for-web-deployment-tool-msdeploy-delegation.aspx.
-------------
Once I was able to get all Web Deployment Tool features installed, get past (404) Not Found errors, and work out delegated permissions, I was able to get one-click deploy fully working (and it is a nice feature). I hope these hints help save you some time
getting one-click working.
-Andy
Also, don't forget that since WMSVC runs as NT account "Local Service" that you must grant "Local Service" appropriate SQL Server access (I used SQL Server Studio to do that) and file directory permissions.
Ooops...what I meant to say... On SQL Server, I didn't assign privileges to "Local Service". I assigned my MSDeployed app to run in an IIS AppPool named "IIS AppPool\Xyz" and then assigned SQL Server privileges to "IIS AppPool\Xyz".
On file permissions, I assigned "Local Service" permissions to files and directories that MSDeploy (running delegate under WMSVC which is running as "Local Service") had to touch to deploy my app.
Instead of granting "Local Service" permissions to the files that webdeploy will update, you can use the delegation configuration to declare a user that webdeploy should run as when it updates the files and make sure that that user has access. This can
be more secure than allowing all of Local Service access.
AndyFraley
4 Posts
VS 2010 Beta 2 one-click results in "(404) Not Found"
Dec 02, 2009 01:46 AM|LINK
Hi,
I trying to get VS 2010 Beta 2 one-click publish (MSDeploy) working against IIS 7.5 running on Windows Server 2008R2. I can successfully build a package and manually copy the package files (<appname>.deploy.cmd, <appname>.SetParameters.xml, <appname>.SiteManifest.xml, <appname>.zip) from my Windows 7 / VS 2010 machine to the Windows Server and then run the <appname.deploy.cmd file and it successfully installs. So MSDeploy itself and the packaging from VS 2010 Beta 2 are working fine.
On my Windows Server 2008R2, I've installed MSDeploy (clearly). SSL is configured and certificate installed. "Web Deployment Agent Service" and "Web Management Service" are up and running. "Enable Remote Connections" is checked for "Management Service" in IIS Manager. Firewall is disabled (for now) on the Windows Server. And from my Windows 7 box, I can establish Telnet connection to port 8172. But at the end of Publish... from VS 2010, I get the following error:
Error detail:
Remote agent (URL https://192.168.0.113:8172/msdeploy.axd?site=<sitename>) 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.
When I look on my Windows Server in the \inetpub\logs\wmsvc\W3SVC1\xxx.log, I see the following entry:
2009-12-02 02:19:49 192.168.0.113 POST /msdeploy.axd site=<sitename> 8172 - 192.168.0.124 - 404 7 0 1
It looks like everything's configured and TCP is even responding on port 8172 but for some reason, the 1-click deployment is still failing with "404 file not found".
Would love any advice that'd lead in a good direction to track down the root cause and get 1-click working. (Getting tired of manually copying files and running scripts.)
Thanks!
-Andy
vs 2010 beta 2 1-click one-click 404 not found
EmilyK
18 Posts
Microsoft
Re: VS 2010 Beta 2 one-click results in "(404) Not Found"
Dec 02, 2009 02:19 AM|LINK
Can you run "msdeploy -help" on both boxes? It will give you a version number for MSDeploy as one of the first lines. Do they match?
MsDeploy is in Program Files\IIS\Microsoft Web Deployment directory.
AndyFraley
4 Posts
Re: VS 2010 Beta 2 one-click results in "(404) Not Found"
Dec 02, 2009 11:33 AM|LINK
MSDeploy versions...
Windows Server 2008 R2 (IIS machine):
Microsoft (R) Web Deployment Command Line Tool (MSDeploy.exe)
Version 7.1.600.0
Copyright (c) Microsoft Corporation. All rights reserved.
Windows 7 Ultimate (VS 2010 Beta 2 dev machine):
Microsoft (R) Web Deployment Command Line Tool (MSDeploy.exe)
Version 7.1.600.0
Copyright (c) Microsoft Corporation. All rights reserved.
--
They are the same version. Not sure if 7.1.600.0 is the version I'm supposed to be using. And I do not remember installing Web Deployment Tool on my Windows 7 Ultimate dev machine. Must have been installed there as part of VS 2010 Beta 2?
Thanks for any guidance.
-Andy
AndyFraley
4 Posts
Re: VS 2010 Beta 2 one-click results in "(404) Not Found"
Dec 10, 2009 03:09 PM|LINK
I've spent the past week working though MSDeploy issues trying to get my VS 2010 Beta2 to one-click deploy to my Windows Server 2008 R2 with IIS 7.5. I've managed to get it working but have taken quite a circuitous route through many trials and errors. So I'll post what I think were some key hints I stumbled upon that may save others some time.





-------------
HINT #1 - In IIS Manager's "Web Platform Installer", install *all* of the "Management" features and after that run the "Web Deployment Tool" installer.
I had just "IIS Management Console" and "Management Service" installed (with WMSVC confirmed as running in Services admin panel) and I'm pretty sure that I only saw TWO, not FOUR installable features when I ran the "Web Deployment Tool" installer (http://www.iis.net/expand/WebDeploymentTool). The options "IIS 7 Deployment Handler" and "Management Service Delegation UI" were *not* available even though WMSVC installed and running on my machine. (Is this a bug in docs or in "Web Deployment Tool" installer??)
But after installing *all* Management features in the "Web Platform Installer",
when I re-ran the "Web Deployment Tool" installer (Control Panel | Programs | Programs and Features, then right-click "Web Deployment Tool" and select "Change") the two new features showed up (showing all features listed in picture above) and I was able to mark them as "install to hard disk" and get them installed. Then and only then was I able to see the "Management Service Delegation" feature in IIS Manager.
At this point, I was still getting "(404) Not Found" errors from the MSDeploy client.
-------------
HINT #2 - If getting inexplicable "(404) Not Found" and you're sure WMSVC and MsDepSvc are both running (OS' Services panel), try adding explicit IPv4 "Allows" in IIS Manager's "Management Service" pane. Don't know why this worked, but I explicitly added an "Allow..." for my local IP subnet in the "IPv4 Address Restrictions" area of "Management Service" pane in ISS Manager.
And then my client stopped reporting "(404) Not Found" errors. Funny thing was I reverted back by removing the explicit "Allow" for local IP subnet and the client continued to work so I cannot say what was causing the "(404) Not Found" errors...a strange bug which goes away when inserting and then removing explicit "Allows"??
Once past the "(404) Not Found" error, the one-click wizard was reporting a different type of error. I was getting "you do not have permissions" and "see your System Administrator" (that would be me) errors from my one-click client.
-------------
HINT #3 - Do verbose logging on your server side to debug permissions problems seen by MSDeploy clients.
Read this article http://technet.microsoft.com/en-us/library/ee461173%28WS.10%29.aspx and set up full (verbose, level 4) tracing across "All" (-1 in regedit didn't work for me but 0x1ff aka 511 did) trace sources. Then try something from your VS 2010 Beta2 one-click deploy client and read the verbose XML logs on your IIS machine to figure out what additional permissions to grant (hint, visually read from end of XML file until you see a stack trace and just above it usually you'll find an English string describing root cause). In the end, I ended up with two key grants in IIS Manager's "Management Service Delegation" pane.
The first grants delegation to "*" (all) users, and I have a special IIS Manager User I configured for installs, to do "dbFullSql" provider for specified data source. The second grants delegated privileges to do all other relevant MSDeploy providers. Also, don't forget that since WMSVC runs as NT account "Local Service" that you must grant "Local Service" appropriate SQL Server access (I used SQL Server Studio to do that) and file directory permissions. A good articles on those required file system grants: http://blogs.iis.net/krolson/archive/2009/11/04/using-iis-manager-accounts-for-web-deployment-tool-msdeploy-delegation.aspx.
-------------
Once I was able to get all Web Deployment Tool features installed, get past (404) Not Found errors, and work out delegated permissions, I was able to get one-click deploy fully working (and it is a nice feature). I hope these hints help save you some time getting one-click working.
-Andy
msdeploy vs 2010 beta 2 one-click 404 permissions not found tracing
AndyFraley
4 Posts
Re: VS 2010 Beta 2 one-click results in "(404) Not Found"
Dec 10, 2009 05:57 PM|LINK
Ooops...what I meant to say... On SQL Server, I didn't assign privileges to "Local Service". I assigned my MSDeployed app to run in an IIS AppPool named "IIS AppPool\Xyz" and then assigned SQL Server privileges to "IIS AppPool\Xyz".
On file permissions, I assigned "Local Service" permissions to files and directories that MSDeploy (running delegate under WMSVC which is running as "Local Service") had to touch to deploy my app.
-Andy
EmilyK
18 Posts
Microsoft
Re: VS 2010 Beta 2 one-click results in "(404) Not Found"
Dec 23, 2009 12:43 AM|LINK
Instead of granting "Local Service" permissions to the files that webdeploy will update, you can use the delegation configuration to declare a user that webdeploy should run as when it updates the files and make sure that that user has access. This can be more secure than allowing all of Local Service access.
HectorMenese...
6 Posts
Re: VS 2010 Beta 2 one-click results in "(404) Not Found"
Mar 02, 2012 06:06 AM|LINK
wow... what a pain....
I had to REBOOT my server to be able to change the Web Deploy tool.
Added the Delegation UI component as per your instructions and started working.... :)