Windows Forms Webview2 Runtime Not Found Exception Although It Is Installed

I am trying to initialize a WebView2 component in a Windows Forms using .Net4.8 getting the below error:

Microsoft.Web.WebView2.Core.WebView2RuntimeNotFoundException: 'Couldn't find a compatible Webview2 Runtime installation to host WebViews.'

FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

It happens on this line:

await PowerBi_web.EnsureCoreWebView2Async(await CoreWebView2Environment.CreateAsync(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "WebView2")));

What could be the problem ?

5
Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article