

Only migrating from nuget nfig to PackageReference (as described here: )Ĭaused the dll to be copied to the output dir (bin\Debug). Specifying the Platform target (to x86) was not enough, the dll was still in runtimes only. It has to be in the output directory itself. It turns out that Outlook is not able to get the WebView2Loader.dll from inside the runtimes folders, The native dlls are in the bin\Debug\runtimes folders,īut I still get 'WebView2Loader.dll': The specified module could not be found' in InitializeCoreWebView2Async()

WebView2Environment = await CoreWebView2Environment.CreateAsync(null, webCacheDir, options) Īwait wv.EnsureCoreWebView2Async(webView2Environment) Public async Task InitializeCoreWebView2Async(WebView2 wv, string webCacheDir)ĬoreWebView2EnvironmentOptions options = null ĬoreWebView2Environment webView2Environment = null

Inside the FormRegion I placed the WebView2 control, and initialized it: private async void FormRegionWebView2_FormRegionShowing(object sender, System.EventArgs e)Īwait InitializeCoreWebView2Async(webView2Ctrl, = new Uri("") I read allot about the WebView2Loader.dll - file not found issue, but couldn't solve the problem in my case:Ī simple Outlook VSTO add-in with FormRegion,
