Error when trying to use WebView2 in a Revit command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm trying to use WebView2 in my own Revit command to open an HTML file that I have in a local directory. I'm new to Revit, and I don't understand why I'm getting an error when executing the following instruction:
private async void InitWebPage() { await this.webView21.EnsureCoreWebView2Async(null); string localPath = Path.Combine(Application.StartupPath, "..\..\HerramientaAuditoriaModelo\web\index.html"); }
The error occurs at the EnsureCoreWebView2Async(null) instruction and it is as follows: 'Unable to load DLL 'WebView2Loader.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)'
I have installed the latest version of Microsoft.Web.WebView2 (1.0.1823.32), and I'm using the Revit 2023 API. I have tried installing older versions that work for other users in their projects, such as version 1.0.818.41, but I still get the same error. I have also tested using WebView2 in individual projects that don't use the Revit API, and I can use WebView2 without any errors.