WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

[Problem/Bug]: WPF Webview2compositioncontrol load but doesnt render while WV2 works fine

Open ZMPeterZhang opened this issue 9 months ago • 2 comments

What happened?

Hello

This bug is related to a plugin I am working on with a MVVM wpf UI I am developing for the Autodesk Building information modeling software Revit. I am trying to use the webview2 compositioncontrol instead of webview2 to solve the airspace issue as documented inside https://github.com/MicrosoftEdge/WebView2Feedback/issues/286 Within the same application and the same view, Webview 2 works as intended, but webview2compositioncontrol doesn't render. Right-clicking tells me the webpage is loaded and navigation is completed. I can inspect or even screenshot the webpage in my webview2compositioncontrol. My mouse recognizes the button on the webpage, but it doesn't render. within revit 2025 and net8, I was getting the same error as https://github.com/MicrosoftEdge/WebView2Feedback/issues/5163 but I resolved it by specifying the target platform to "net8.0-windows10.0.22000.0" and ensure NET8 SDK is 8.0.407. after that the same WV2composition control render bug as Revit 2024 and net48 still persist it is also worth noting this example here functions on my machine https://github.com/MicrosoftEdge/WebView2Samples/tree/main/SampleApps/WebView2WpfCompositionControl

Thank you for looking at my issue

Image

Importance

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

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

134.0.3124.93

SDK Version

1.0.3171-prerelease

Framework

WPF

Operating System

Windows 11

OS Version

10.0.22621 Build 22621

Repro steps

Please note the uploaded MRE cannot be debugged outside of the API context of Autodesk Revit. I was able to reproduce this bug on 3 different developer's machine, all with very similar if not identical system enviroment

  1. download the repo
  2. makesure you have the some version of Autodesk revit downloadedm Trial will do, I prefer 2024(net 48) and 2025(net 8) for debugging, this issue is reproducible in both
  3. select the debug matching your revit version (debug R24 for revit 2024)
  4. launch the "show modeless window" under the "RevitAddIn" tab in revit UI

Upload of MRE zip failed so here is a onedrive link https://corganone-my.sharepoint.com/:u:/g/personal/peter_zhang_corgan_com/EQXjRXeercFEpVGC2C1lUz8BcYRVvIyKWdfHlBicgTI20Q?e=lXIe4e

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

ZMPeterZhang avatar Apr 01 '25 15:04 ZMPeterZhang

I agree this is a real issue and is not machine-specific. There would be real business value for BIM tech developers if Microsoft can resolve this bug.

KJSloan2 avatar Apr 01 '25 16:04 KJSloan2

Update: Tried both explicit initialization and implicit initialization of the composition control via Environment.SetEnvironmentVariable("WEBVIEW2_USER_DATA_FOLDER", userDataFolder); didnt seem to make any difference.

I wonder, since composition control is rendered using GraphicsCaptureSession that is what went wrong and why I can't seem to find any exceptions in the initialization and navigation process, but I don't have any good means of checking that

ZMPeterZhang avatar Apr 01 '25 19:04 ZMPeterZhang

renderoption can't set to software

acidmeat avatar May 08 '25 16:05 acidmeat

Unfortunately Composition Control isn't ready for production as well. It also has HDR problems while rendering (overlighted on some pages, colors are vary on page content) while HwndHost is fine. Something like HDR screen's effect is applied to the browser's rendered content twice. It also slower while rendering on WPF.

aepot avatar Jul 30 '25 13:07 aepot