06-10-2023, 07:21 PM
Hi, I'm trying to run the example for WebView2 from the Cookbook. I get this error:
I've tried changing the cache directory with the code commented out in the code box below, but when I uncomment those lines I get the following error:
I've tried placing the offending line most places in the script, but I always get the 'event loop' error.
Thanks very much for your help!
Regards,
burque505
Quote:We couldn't create the data directory
Microsoft Edge can't read and write to its data directory:
C:\Program Files\LibreAutomate\Au.Task.exe.WebView2\EBWebView
I've tried changing the cache directory with the code commented out in the code box below, but when I uncomment those lines I get the following error:
Quote:System.InvalidOperationException: EnsureCoreWebView2Async cannot be used before the application's event loop has started running.
/*/ nuget -\Microsoft.Web.WebView2; /*/
using Microsoft.Web.WebView2.Wpf;
using System.Windows;
using System.Windows.Controls;
using Microsoft.Web.WebView2.Core;
var b = new wpfBuilder("Window").WinSize(700, 600);
//var env = await CoreWebView2Environment.CreateAsync(null, @"C:\Temp", null);
b.Row(-1).Add(out WebView2 k);
k.Source = new("https://www.google.com");
b.R.AddSeparator();
b.R.AddOkCancel();
b.End();
//await k.EnsureCoreWebView2Async(env);
if (!b.ShowDialog()) return;
Thanks very much for your help!
Regards,
burque505