Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Problem/Bug]: "System.Runtime.InteropServices.COMException(HRESULT: 0x887A002D)" issue when using WebView2CompositionControl on older Windows 10 versions. #4755

Closed
Jang-Haemin opened this issue Aug 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Jang-Haemin
Copy link

What happened?

Hello?

I'm really happy to see that you have released a WebView2CompositionControl to solve the Z-Index problem in WPF WebView2.

However, I was wondering if you could confirm the conditions for running the pre-release build.

My program is built with .NET 4.6.2, WPF, x86 and I use WebView2 1.0.2730-prerelease to deploy WebView2CompositionControl.

When I run this program on a developer PC, it works fine, but on some PCs, I get the following error

Error stack:
System.Runtime.InteropServices.COMException: The application requested an operation that depends on a missing or mismatched SDK component. (Exception in HRESULT: 0x887A002D)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.Web.WebView2.Wpf.Direct3DHelper.CreateDevice(ID3D11Device& device, ID3D11DeviceContext& deviceContext)
at Microsoft.Web.WebView2.Wpf.GraphicsItemD3DImage..ctor(IntPtr mainWindowHandle, Image image, Int32 fpsDivider)
at Microsoft.Web.WebView2.Wpf.WebView2CompositionControl.WebView2CompositionControl_Loaded(Object sender, RoutedEventArgs e)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
at System.Windows.Interop.HwndTarget.OnResize()
at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

The components on the PC that caused this error were

  • Windows 10 21H2 (LTSC)
  • DirectX 12
  • .NET Framework 4.8
  • WebView2 Runtime 127.x (x86, x64)

ℹ️ This PC is being used as a kiosk PC and uses Windows 10 LTSC.
This makes it difficult to update the Windows version.

What can I do to resolve this issue?
For reference, I did not encounter this issue when using the WPF WebView2 control on the same WebView2 version.

Thanks.

  • This article was written with a translator, so the content may not be smooth. Thank you for your understanding.

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Prerelease (Edge Canary/Dev/Beta)

Runtime Version

127.0.2651.105

SDK Version

1.0.2730-prerelease

Framework

WPF

Operating System

Windows 10

OS Version

19044.4651

Repro steps

  1. install the Microsoft.Web.WebView2 1.0.2730-prerelease Nuget package, place and build the WebView2CompositionControl in your .NET 4.6.2, x86, WPF app.

  2. When you run the app, you will receive the following error: System.Runtime.InteropServices.COMException: The application requested an operation that depends on a missing or mismatched SDK component. (Exception in HRESULT: 0x887A002D)
    An error occurs.

  3. However, if you use a WebView2 control instead of a WebView2CompositionControl in the same Nuget package, this issue does not occur and it runs fine.

  • This article was written with a translator, so the content may not be smooth. Thank you for your understanding.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

@Jang-Haemin Jang-Haemin added the bug Something isn't working label Aug 20, 2024
@retmas-dv
Copy link

To resolve this issue add Windows optional feature "Graphic tools".
For example using the following PowerShell command:

dism /Online /Add-Capability /CapabilityName:Tools.Graphics.DirectX~~~~0.0.1.0

The correct version of the package can be found using the following PowerShell command:

dism.exe /Online /Get-Capabilities /Format:Table | Select-String "Tools.Graphics.DirectX"

@Jang-Haemin
Copy link
Author

To resolve this issue add Windows optional feature "Graphic tools". For example using the following PowerShell command:

dism /Online /Add-Capability /CapabilityName:Tools.Graphics.DirectX~~~~0.0.1.0

The correct version of the package can be found using the following PowerShell command:

dism.exe /Online /Get-Capabilities /Format:Table | Select-String "Tools.Graphics.DirectX"

As you said, after installing the "Graphic tools", I confirmed that the program runs well.
Thank you so much!!!! 😊😊😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants