Skip to content

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

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

Open
ZMPeterZhang opened this issue Apr 1, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ZMPeterZhang
Copy link

ZMPeterZhang commented Apr 1, 2025

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 #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 #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 ZMPeterZhang added the bug Something isn't working label Apr 1, 2025
@KJSloan2
Copy link

KJSloan2 commented Apr 1, 2025

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.

@ZMPeterZhang
Copy link
Author

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

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

3 participants