Search code examples
iismsdeploy

msdeploy failure: IIS 7.5->8.5: Error: The ApplicationHost.config file is invalid / eventlog error 9000 on destination system


Using v7.1 (that is the ver at cmd prompt), 3.6 (from web platform installer) of msdeploy.exe

Migrating from Win2008-R2 IIS to Win2012-R2

Attempting to move everything IIS related over. (And yes, we have customized applicatiohost.config, but we do not know all the mods... that is why we are using a migration tool,,, to move everything...)

Command I am running:

C:\Program Files\IIS\Microsoft Web Deploy V3>msdeploy 
-verb:sync -source:webserver,
computername=WIN-67E8GTGADGJ 
-dest:webserver,computername=192.168.2.21,
userName="administrator",password="###"

output:

Info: Using ID '1d59e6bd-0f89-4479-9853-98e164c9f613' for connections to the rem
ote server.
Info: Using ID '0c99bd7f-faa3-4737-ac35-d65c495402b6' for connections to the rem
ote server.
Info: Adding MSDeploy.webServer (MSDeploy.webServer).
Info: Adding webServer (MSDeploy.webServer/webServer).
Info: Adding appHostConfig ().
Error: (8/24/2015 10:28:43 PM) An error occurred when the request was processed on the remote computer.
Error: The ApplicationHost.config file is invalid. Cannot proceed with synchronization.
Error count: 1.

MORE INFORMATION

The sequence of events is:

Target system logs one error event:

Microsoft-Windows-IIS-APPHOSTSVC -- message 9000

And then msdeploy on the source system throws (and msdeploy exits):

Error: (8/25/2015 4:36:50 PM) An error occurred when the request was processed on the remote computer.
Error: The ApplicationHost.config file is invalid. Cannot proceed with synchronization.
Error count: 1.

UPDATE: Initially I was getting TWO event log errors on target system. Message 9000 and 9012. I was able to fix the 9012 by extending the applicationhost.config file. But hours of work and no solution yet for the 9000 error.

I have examined the ApplicationHost.config, and compared it to baseline, and there really seems to be nothing special there.

What is the path to resolution?


Solution

  • The answer is that there seems to be real problems with msdeploy, but no one seems to understand (or document) why. The tool is primarily built to go from IIS 6.x (Win 2003) to newer IIS.

    In our experience, when going from IIS 7.x to 8.x, you often cannot use msdeploy with "source:webserver" approach. However, msdeploy can do a lot of the lifting for you from 7.x to 8.x.

    Here are some steps I have seen work:

    First, do three steps. This will let msdeploy move as much as it can (would be nice if it could move more, but this is as far as I have seen work):

    msdeploy -verbose -verb:sync -source:apphostconfig="WEB SITE NAME",computername=SOURCEMACHINE -dest:apphostconfig="WEB SITE NAME",computername=DESTINATIONMACHINE,userName="administrator",password="password-here"  -enableLink:AppPoolExtension
    

    Note the "enablelink" flag.

    Repeat the above with:

    • -enableLink:CertificateExtension and then
    • -enableLink:FrameworkConf

    Once this is done, msdeploy has done all it can. You should now have the site migrated, with content and app pools, and ssl certs, and the configuration related to the sites and app pools.

    For mime mappings, and other IIS system wide settings (compression is one example), you are on your own.

    Don't ask me why there is no document on how to do this. (Don't ask me why msdeploy can't just do the whole freaking server. It works great from IIS 6, but not from IIS 7, like what kind of crazy is that? Anyway, send Satya an email about it.)