ADD-IN ERROR (due to corrupted Legacy Edge)

Sometimes the ADD-IN ERROR may persist, even after checking all settings according to this article.

This situation is caused by a corrupted Legacy Edge runtime.

IMPORTANT: MS Edge Chromium will be installed to practically all Win 10 versions (1803 or later) as part of a Security update in April 2021. Legacy Edge will be automatically uninstalled, however the EdgeHTML runtime should stay ”intact”.
Read more: Which Windows 10 versions will be impacted?

 

ADD-IN ERROR
This add-in could not be started. Close this dialog to ignore the problem or click "Restart" to try again.

add-in_error5.png

 

Occurs in: Windows desktop Outlook client (Microsoft 365/MSO/Click-to-Run, Outlook 2016, 2019)

Doesn't occur: Web Outlook (OWA), any web browser

References:
- https://github.com/OfficeDev/office-js/issues/1620
- https://answers.microsoft.com/en-us/windows/forum/all/get-error-code-0x80004005-when-trying-to-setup/6b574527-fbf0-4e5a-8827-0e26bf2a572b

 

Details: Win32WebViewHost.exe crashes and causes ADD-IN error to appear. Event Viewer may present the error in various ways:

Variant 1:

in Event Viewer > Windows Logs > Application:
Faulting application name: Win32WebViewHost.exe
Faulting module name: KERNELBASE.dll
Faulting application path: C:\Windows\SystemApps\Microsoft.Win32WebViewHost_cw5n1h2txyewy\Win32WebViewHost.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll

Variant 2:

in Event Viewer > Windows Logs > Application:
Faulting application name: Win32WebViewHost.exe
Faulting module name: edgemanager.dll
Faulting application path: C:\Windows\SystemApps\Microsoft.Win32WebViewHost_cw5n1h2txyewy\Win32WebViewHost.exe
Faulting module path: C:\WINDOWS\System32\edgemanager.dll

Variant 3:

in Event Viewer > Applications and Services Logs > Microsoft Office Alerts:

with code 0x80004005.

 

Known steps that may lead to the error scenario:

  • Installing Chromium Edge (WebView2) over Legacy Edge corrupts Legacy Edge’s runtime engine (Edge HTML, WebView).
    AND

  • User’s Office version/build is high enough to use Edge HTML (lower than 16.0.13530.20424) but not high enough to use Edge Chromium (16.0.13530.20424 or higher).

Recommended fix:

  1. Close all Office applications (especially Outlook).
  2. Rename this folder:
    %userprofile%\AppData\Local\Packages\Microsoft.Win32WebViewHost_cw5n1h2txyewy\
  3. Execute the following Powershell (with user's permissions):
    Get-AppxPackage "Microsoft.Win32WebViewHost" | foreach {Add-AppPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

If the fix worked, you can remove the renamed folder from Step 1.
If the fix didn't work, move to the alternative fix below.

 

Alternative fix:
(kudos to DB-ADM!)

The permissions for WebView's AppData folder might have gotten corrupted or overwritten. Here's how to tell if that's the case:

  1. Navigate to %localappdata%\Packages\Microsoft.Win32WebViewHost_cw5n1h2txyewy
  2. In that directory, grant "ALL APPLICATION PACKAGES" full control of that folder, subfolders, and files (If domain-joined, make sure the local machine is selected for the location when searching for the group).
  3. Now try launching the add-in. If it works, great!

You'll want to apply the correct permissions now.

  1. Remove the permissions that were given above.
  2. Run the following from an elevated command prompt:
icacls "%localappdata%\Packages\Microsoft.Win32WebViewHost_cw5n1h2txyewy\AC" /grant "*S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646:(F)" /T
icacls "%localappdata%\Packages\Microsoft.Win32WebViewHost_cw5n1h2txyewy\AC\#!123" /grant "*S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646-3829197285-1050560373-949424154-522343454:(F)" /T
icacls "%localappdata%\Packages\Microsoft.Win32WebViewHost_cw5n1h2txyewy\LocalCache" /grant "*S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646:(F)" /T
icacls "%localappdata%\Packages\Microsoft.Win32WebViewHost_cw5n1h2txyewy\LocalState" /grant "*S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646:(F)" /T
icacls "%localappdata%\Packages\Microsoft.Win32WebViewHost_cw5n1h2txyewy\RoamingState" /grant "*S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646:(F)" /T
icacls "%localappdata%\Packages\Microsoft.Win32WebViewHost_cw5n1h2txyewy\Settings" /grant "*S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646:(F)" /T
icacls "%localappdata%\Packages\Microsoft.Win32WebViewHost_cw5n1h2txyewy\TempState" /grant "*S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646:(F)" /T

After granting those permissions, add-in should now work.

Notes from AD-ABM:
The SID ended in 6646 is the Win32WebViewHost Application Container. I'm not certain what the longer version of this SID belongs to, but I found it present on my test workstation so I added it in as well. I had to go through and manually enumerate the permissions in these directories so I'm hoping I'm not missing anything.

 

 

Additional reports of this issue:

Was this article helpful?

14 out of 16 found this helpful

Have more questions? Submit a request