WebView2 doesn't work in Rhino


I am trying to adding WebView2 (edge with chromium) control to Rhino to see if WebAssembly stuffs could work within Rhino.

I have tested WebWiew2 with both WPF and WinForm. It works fine as an independent application (https://docs.microsoft.com/en-us/microsoft-edge/webview2/gettingstarted/wpf). However, it doesn’t work when I add WebView2 to this Rhino’s WPF sample: https://github.com/mcneel/rhino-developer-samples/tree/6/rhinocommon/cs/SampleCsWpf.

What I found the issue is:
WebWiew2.CoreWebView2 is never initiated and remains null in Rhino, couldn’t figure out why it doesn’t work within Rhino. There are several places mentioned that need to add await webView.EnsureCoreWebView2Async(null);, but it doesn’t work in this case.
I have uploaded my test sample here: https://github.com/MingboPeng/ExperimentalProjects/tree/master/RhinoWebView2

Any insight would be really helpful.

cc @dale


Notes for testing WebWiew2:

  1. Have to use .net framework 4.6+ (I am using 4.7.2)

  2. Microsoft Edge (Chromium) Canary channel

  3. Use prerelease version (this is important!)

Hi @mingo1214,

I wrote a sample, years ago, based on CefSharp.


Maybe that is of interest?

– Dale

Hi @dale, thanks, I tested CefSharp a while ago, and it has an issue with 4k screen, but I will use CefSharp for now as the temporary solution.

Maybe I will test the WebView2 a couple months later. I noticed that ETO is also trying to add WebView2 https://github.com/picoe/Eto.Toolkit/issues/28, it would be great if @curtisw could get it work within ETO.