maui icon indicating copy to clipboard operation
maui copied to clipboard

Webview Error on .net 9 using interop (SetParent)

Open danielancines opened this issue 6 months ago • 4 comments

Description

Upgrading to .net 9, my project using Pinvoke.SetParent to create a new MDI Window with a webView is crashing. External windows is working like a charm.

Steps to Reproduce

  1. Create a new Maui project
  2. Create a new window, with a WebView
  3. Open a window and SetParent using interop

Link to public reproduction project repository

https://github.com/danielancines/maui-webview-interop-issue

Version with bug

9.0.40 SR4

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

7.0.101

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output


danielancines avatar Jun 16 '25 17:06 danielancines

This is also happening here. Tried to open the URL after the page was loaded (Still got the exception).

rodirigos avatar Jun 16 '25 17:06 rodirigos

Is this different from this issue https://github.com/dotnet/maui/issues/20253 ?

PureWeen avatar Jun 16 '25 19:06 PureWeen

Is this different from this issue #20253 ?

Yes, the problem on this repo is only about WebView control on MDI Child window. My app is crashing when WebView is the content of a MDI Child window (SetParent method).

danielancines avatar Jun 17 '25 08:06 danielancines

This issue has been verified in Visual Studio 17.14.5 Preview 1.0 with .NET MAUI versions (9.0.80, 9.0.70, 9.0.60, 9.0.50, 9.0.40, and 9.0.0). It does not occur in MAUI version 8.0.100. The issue is reproducible on the Windows platform.

Image

NafeelaNazhir avatar Jun 17 '25 12:06 NafeelaNazhir

I'm experiencing the same issue. This is critical for my application and is currently blocking us from upgrading to .NET 9.

fpedrolucas95 avatar Jun 18 '25 12:06 fpedrolucas95

I'm going through the same problem, before migrating to NET 9 it worked as expected, now after updating it started having this problem, I would like an adjustment to be able to release the most updated version

Elwilton avatar Jun 18 '25 12:06 Elwilton

Same issue here. It worked fine before migrating to .NET 9, but now it's breaking and blocking our release. We need a fix to move forward.

leo7medeiros avatar Jun 18 '25 13:06 leo7medeiros

Is this different from this issue #20253 ?

Yes, the problem on this repo is only about WebView control on MDI Child window. My app is crashing when WebView is the content of a MDI Child window (SetParent method).

  1. are you able to reproduce on a WinUI App outside of MAUI? Using a WebView2

PureWeen avatar Jun 18 '25 20:06 PureWeen

@PureWeen The same issue can be reproduced in a native WinUI application.

  • The issue does not occur in Windows App SDK 1.5.x (e.g., 1.5.250108004, 1.5.241107002).
  • It first appears in 1.6.0-preview1 (1.6.240807006-preview1) and persists across all later versions, including 1.6.x, 1.7.x, and 1.8.x.

Last working version (1.6.240701003-experimental2) : Image

Breaking version (1.6.240807006-preview1): Image

Sample: winui3Sample (1).zip

sheiksyedm avatar Jun 19 '25 12:06 sheiksyedm

Any position regarding this issue? I have a migration project from .NET 9 on hold waiting for this solution.

Elwilton avatar Jun 30 '25 13:06 Elwilton

Same here, we're at .net 7 and this bug is blocking our upgrade.

danielancines avatar Jul 04 '25 18:07 danielancines

Any update or workaround on this issue?

rodirigos avatar Jul 07 '25 13:07 rodirigos

Any workaround guys? We're completing a full upgrade to .net 9, but since we're using Interop to create child windows, this issue is blocking our update.

danielancines avatar Jul 15 '25 09:07 danielancines

Hi team,is there a known workaround, or can this be escalated? This is holding back our migration to Net9.

lfmouradasilva avatar Jul 16 '25 10:07 lfmouradasilva

Hey guys, any update on this?

danielancines avatar Jul 30 '25 08:07 danielancines

Hey guys, any news about this issue?

danielancines avatar Aug 09 '25 20:08 danielancines

Hey Buddy’s, any updates on this ?

Elwilton avatar Aug 09 '25 20:08 Elwilton

Hi guys, still happening on Maui 9.0.100, SDK 9.0.304 and Windows SDK 10.0.26100.0.

danielancines avatar Aug 23 '25 17:08 danielancines

I tested with WindowsAppSDK version 1.8.250702007-experimental4 on .NET MAUI 9.0.100 and SDK 9.0.304, but the issue persists.

Testing with WindowsAppSDK version 1.5.240802000 on .NET Maui 8.0.100 and SDK 8.0.413 and works fine.

danielancines avatar Aug 31 '25 12:08 danielancines

Hey guys, any update on this?

danielancines avatar Sep 30 '25 22:09 danielancines

Hi,

Same error on 10.0.100-rc.2.25502.107.

danielancines avatar Oct 19 '25 20:10 danielancines

Morning guys, still not working on .net 10.0.101, any updates?

danielancines avatar Dec 15 '25 14:12 danielancines