Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Error in Internet Information Services (IIS) using Web Farm Framework : "Exception in response stream.The ApplicationHost.config file is invalid"


Symptoms

When trying to add a server to a Web Farm Framework (WFF) environment running in Internet Information Services (IIS) 7.0 or 7.5, you may receive an error similar to the following:

'Microsoft.Web.Farm.SyncApplicationsRemoteMethod' on server '<Server Name>'. Exception in response stream. The ApplicationHost.config file is invalid. Cannot proceed with synchronization. Exception in response stream. The ApplicationHost.config file is invalid. Cannot proceed with synchronization.

↑ Back to the top


Cause

This problem can occur if Web Deploy 3.0 has been installed on the Primary or Secondary WFF servers. When configured in this manner, the synchronization process can corrupt the .Net Framework configuration files, which can result in the error message above.

IMPORTANT: The only supported version of Web Deploy for use with WFF in IIS is 2.0.

When this problem occurs, you may also observer on of the following error conditions on the affected server:


IIS Manager Errors

Opening the IIS manager and selecting the server node results in:


---------------------------
Internet Information Services (IIS) Manager
---------------------------
Configuration system failed to initialize
---------------------------
OK
---------------------------

Click OK and then in IIS Manager and select the server node again

---------------------------
Failed to connect
---------------------------
There was an error when trying to connect. Do you want to retype your credentials and try again? Details:

Filename: \\?\C:\Windows\system32\inetsrv\config\redirection.configLine number: 7Error: The configuration section 'configProtectedData' cannot be read because it is missing a section declaration
---------------------------
Yes No
---------------------------


Error Opening Event Viewer

Attempting to open the Event Viewer MMC results in:


MMC could not create the snapin. The snap in may not have been installed correctly
CLSID: FX b05566ad-fe9c-4363-be05-7a4cbb7cb510

↑ Back to the top


Resolution

To resolve this problem, please take the following steps:

  1. On the WFF Controller server, disable Platform and Application Provisioning for the WFF farm.
  2. Remove the affected server(s) from the WFF farm.
  3. On all primary and secondary machines in the WFF farm, verify if Web Deploy 3.0 is installed or if the Web Deploy Agent Service is listed as 3.0. To check the version of Web Deploy manually, do one of the following:
    • Under Control Panel --> Programs and Features, check if Web Deploy 3.0 is present. If yes, proceed to step 4 below.
    • Check the Web Deploy file version at C:\Program files\IIS\Microsoft Web Deploy\. Web Deploy 2.0 will have the following file versions:

      Microsoft.Web.Deployment.dll = 7.1.620.0
      MsDepSvc.exe = 7.1.1070.1

      If either of the above file versions are not present, proceed to step 4 below.


    To check the file versions of the Web Deploy components using a script, please consider the follow sample PowerShell script:

    $bV3Installed = $false
    $bV2Installed = $false
    $strSvcVersion = ""

    $RegLoc = Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall
    $Programs = $RegLoc | foreach {Get-ItemProperty $_.PsPath}

    Foreach ($name in $Programs)
    {
    if($name.DisplayName -eq "Microsoft Web Deploy 3.0")
    {
    $bV3Installed = $true
    }

    if($name.DisplayName -eq "Microsoft Web Deploy 2.0")
    {
    $bV2Installed = $true
    }
    }

    $RegLoc = Get-ItemProperty HKLM:\System\CurrentControlSet\Services\MSDEPSVC
    $strSvcVersion = $RegLoc.Description

    if($bV3Installed -eq $true -and $bV2Installed -eq $true)
    {
    "Please uninstall Microsoft Web Deploy 2.0 and Microsoft Web Deploy 3.0 and reinstall Microsoft Web Deploy 2.0 from here: http://www.microsoft.com/en-us/download/details.aspx?id=25230"
    }
    elseif($bV3Installed -eq $true -and $bV2Installed -eq $false)
    {
    "Please uninstall Microsoft Web Deploy 3.0 and install Microsoft Web Deploy 2.0 from here: http://www.microsoft.com/en-us/download/details.aspx?id=25230"
    }
    elseif($bV3Installed -eq $false -and $bV2Installed -eq $true -and $strSvcVersion -eq "Remote agent service for the Microsoft Web Deploy 3.0.")
    {
    "Please uninstall Microsoft Web Deploy 2.0 and reinstall Microsoft Web Deploy 2.0 from here: http://www.microsoft.com/en-us/download/details.aspx?id=25230"
    }
    elseif($bV3Installed -eq $false -and $bV2Installed -eq $true -and $strSvcVersion -eq "Remote agent service for the Microsoft Web Deploy 2.0.")
    {
    "Microsoft Web Deploy 2.0 is installed correctly"
    }
    else
    {
    "Microsoft Web Deploy is not installed, it can be installed from here: http://www.microsoft.com/en-us/download/details.aspx?id=25230"
    }
  4. From Control Panel --> Programs and Features, remove all versions of Web Deploy if installed.
  5. Reinstall Web Deploy 2.0. The Web Deploy 2.0 installation files are available at http://www.microsoft.com/en-us/download/details.aspx?id=25230
  6. Repair the affected Secondary WFF server using the following steps (NOTE: This assumed you don't need to recover any settings since this server will be synchronized with the Primary WFF server):
    • Rename the following 4 files to .Old, for example Machine.Config.OLD:

      C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Machine.Config
      C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Web.Config
      C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG\Machine.Config
      C:\Windows\Microsoft.Net\Framework64\v2.050727\CONFIG\Web.Config
    • Make copies of the following files in each location so you keep the original .default files:

      C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Machine.Config.default
      C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Web.Config.default
      C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG\Machine.Config.default
      C:\Windows\Microsoft.Net\Framework64\v2.050727\CONFIG\Web.Config.default
    • Rename the copies (i.e. machine.config - Copy.default ) as machine.config and web.config for each location. At this point, IIS Manager and the Event Viewer should open and the server is ready to be added to farm.

  7. Re-enable Platform and Application provisioning on the Controller and add the affect machines back to the farm

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2772386
Revision : 1
Created on : 1/7/2017
Published on : 12/19/2012
Exists online : False
Views : 116