"Installation of one or more roles, role services, or features failed. Error: 0x800f0922" when installing IIS 8.0 Application Initialization.

The other day I got a case where customer was trying to install the Application Initialization feature on a Windows 2012 / IIS 8.0 machine. 

IIS 8.0 Application Initialization
https://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-application-initialization

However, this failed for customer. And it showed that it failed for me too.
When attempting to install it from the Server Manager, the error looked like this: 

 

When attempting to install it from a PowerShell command prompt, the error looked like this: 

Windows PowerShell
Copyright (C) 2012 Microsoft Corporation. All rights reserved.

 

PS C:\Windows\system32> Import-Module ServerManager
PS C:\Windows\system32> Add-WindowsFeature Web-AppInit
Add-WindowsFeature : The request to add or remove features on the specified server failed.
Installation of one or more roles, role services, or features failed. Error: 0x800f0922
At line:1 char:1
+ Add-WindowsFeature Web-AppInit
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (@{Vhd=; Credent...Name=localhost}:PSObject) [Install-WindowsFeature], Exception
    + FullyQualifiedErrorId : DISMAPI_Error__Failed_To_Enable_Updates,Microsoft.Windows.ServerManager.Commands.AddWindowsFeatureCommand
Success Restart Needed Exit Code Feature Result

------- -------------- --------- --------------
False No Failed {}

When researching on this, I didn’t find much (hence this post).
When investigating the IIS.log I noticed that there were some Accessed Denied (0x80070005)

 

[<date time>] [ ***** IIS 8.0 Component Based Setup ***** ]
[<date time>] "C:\Windows\System32\inetsrv\iissetup.exe" /launch C:\Windows\System32\inetsrv\appcmd.exe reset config -section:system.webServer/applicationInitialization
[<date time>] Launching command C:\Windows\System32\inetsrv\appcmd.exe, with params C:\Windows\System32\inetsrv\appcmd.exe reset config -section:system.webServer/applicationInitialization
[<date time>] < !!FAIL!! > LaunchCommand result=0x80070005
[<date time>] [ End of IIS 8.0 Component Based Setup ]

Some further testing showed that I (and customer) had Shared Configuration enabled on the machine.
And, in short, the installer runs with an identity that normally do not have access to the share where the shared configuration applicationhost.config is located.
And, equally short, the solution here was to disable Shared Configuration during the installation of the Application Initialization feature.

So if you see the error above when installing the Application Initialization feature then check if Shared Configuration is enabled.
If yes, disable Shared Configuration, perform an IISReset, run the “Add-WindowsFeature Web-AppInit” command from PowerShell (or install it from the Server Manager).

 

Hope this helps.

Installing IIS Modules in Shared Configuration Environments
https://www.iis.net/learn/manage/provisioning-and-managing-iis/installing-iis-modules-in-shared-configuration-environments

Comments

  • Anonymous
    September 08, 2014
    THANKS!!!! I have been spending hours trying to get past this error. Now it works as a charm. Thanks again, Hugo

  • Anonymous
    October 28, 2014
    How can you disable Shared Configuration when IIS Manager is not installed?

  • Anonymous
    November 26, 2014
    Hi All, I ran into a similar issue and cannot find an easy answer, after lot of search and at last I found this KB update (KB2957390) and that helped. I already on my build image had the KB2919355 because of which the IIS was not uninstalling. Here are the steps below if you have issue uninstalling IIS 7 or 8 from Server 2012 R2 Ensure Shared Configuration on IIS is disable (follow this to disable technet.microsoft.com/.../cc755255%28v=ws.10%29.aspx) Ensure all the Services related to IIS and WWW Publishing is stopped and set to Manual Check you have KB2919355 installed on your Server Download the KB2957390 from here: www.microsoft.com/.../details.aspx Find more info here - support.microsoft.com/.../en-us Hope it helps and saves time for everyone. Regards, Ali

  • Anonymous
    January 15, 2015
    The comment has been removed

  • Anonymous
    September 02, 2015
    Thank the Gods that this existed.  I never even considered taking the shared config setting off.  I owe you a life of gratitude and debt to pay!

  • Anonymous
    September 16, 2015
    Thanks!!!!! I was trying to the Essential experience on 2012r2 keep failing. Required IIS to be installed so I installed that separately and than turned off the sharing started the Essential role again success.