Webview Error on .net 9 using interop (SetParent)
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
- Create a new Maui project
- Create a new window, with a WebView
- 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
This is also happening here. Tried to open the URL after the page was loaded (Still got the exception).
Is this different from this issue https://github.com/dotnet/maui/issues/20253 ?
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).
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.
I'm experiencing the same issue. This is critical for my application and is currently blocking us from upgrading to .NET 9.
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
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.
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).
- are you able to reproduce on a WinUI App outside of MAUI? Using a WebView2
@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) :
Breaking version (1.6.240807006-preview1):
Sample: winui3Sample (1).zip
Any position regarding this issue? I have a migration project from .NET 9 on hold waiting for this solution.
Same here, we're at .net 7 and this bug is blocking our upgrade.
Any update or workaround on this issue?
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.
Hi team,is there a known workaround, or can this be escalated? This is holding back our migration to Net9.
Hey guys, any update on this?
Hey guys, any news about this issue?
Hey Buddy’s, any updates on this ?
Hi guys, still happening on Maui 9.0.100, SDK 9.0.304 and Windows SDK 10.0.26100.0.
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.
Hey guys, any update on this?
Hi,
Same error on 10.0.100-rc.2.25502.107.
Morning guys, still not working on .net 10.0.101, any updates?