Skip to content

Runtime error when closing external window with WPF Webview Control #32944

@musictopia2

Description

@musictopia2

Description

After using the latest WPF Webview control, i created a sample where it opens a popup and i have something to close it. however, it gives a runtime error. The error message was
"System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.'"
and this
"COMException: The group or resource is not in the correct state to perform the requested operation. (0x8007139F)
" showed the code that caused it "

CheckArguments(parametersSpan, copyOfArgs, shouldCopyBack, binder, culture, invokeAttr);

 if (_invokeFunc_ObjSpanArgs is not null)
 {
     try
     {
         ret = _invokeFunc_ObjSpanArgs(obj, copyOfArgs);
     }
     catch (Exception e) when ((invokeAttr & BindingFlags.DoNotWrapExceptions) == 0)
     {
         throw new TargetInvocationException(e);
     }
 }

when invoking it.

This did not happen if using the .net 9 version or below.

Steps to Reproduce

  1. Go to my repository here "https://github.com/musictopia2/WebviewControlBug" and run it. click the button that opens a pop window (that was fine)
  2. Close the popup.
    This will always produce the bug.

Link to public reproduction project repository

https://github.com/musictopia2/WebviewControlBug

Version with bug

10.0.11

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

9.0.120 SR12

Affected platforms

Windows

Affected platform versions

Windows 10

Did you find any workaround?

The workaround was to use the .net 9 version of the component (still works in a .net 10 project).

Relevant log output

Metadata

Metadata

Labels

area-blazorBlazor Hybrid / Desktop, BlazorWebViewi/regressionThis issue described a confirmed regression on a currently supported versionpartner/syncfusionIssues / PR's with Syncfusion collaborationregressed-in-10-rc2s/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions