Message 1 of 4
Loading & upgrading a family via doc.LoadFamily from a WPF WebView2 based application breaks the WebView2 control
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am experiencing strange behavior with a WebView2 based application performing family loads using the API command:
Document.LoadFamily()
It only occurs when a family upgrade is required, triggered from inside the WPF application. Non-upgrade family loading is unaffected.
- The WebView2 remains active and is functional (can use the debug console, refresh the page etc.) but any subsequent calls to window.chrome.webview.postmessage do not get received.
- Upon closing the add-in and re-starting it, the WebView2 host will not initialize, it hangs indefinitely on the below call until Revit is re-booted.
await webView.EnsureCoreWebView2Async()
- I am able to trigger the family upgrade from the WebView2 control successfully once, but not afterwards.
- Subscribing to the ProcessFailed event on the WebView2 never triggers either, so it appears the CoreWebView2 instance never "crashes".
- Family Load & upgrades separate to the WPF application (i.e. through the UI "Load Family" or drag & drop) do not impact the WebView2 and it continues to function as expected.
I've tried this with multiple versions of Revit and the behavior is consistent. Seems to me like there's an incompatibility somewhere. The only way to fix is to re-boot Revit.