-
Notifications
You must be signed in to change notification settings - Fork 821
Description
Current behavior π
Using Uno SDK version 6.4.0-dev.50.
Webview2 is not able to load the mapped urls and returns a ERR_NAME_NOT_RESOLVED.
It seems this is due to EnsureCoreWebView2Async not really completing the initialization of view. In fact given this code:
await MyWebView.EnsureCoreWebView2Async();
//await Task.Delay(1000);
var folder = Path.Combine(AppContext.BaseDirectory, "Assets");
MyWebView.CoreWebView2.SetVirtualHostNameToFolderMapping(
"appassets.local",
folder,
CoreWebView2HostResourceAccessKind.Allow);
MyWebView.Source = new Uri("https://appassets.local/testpage.html");
The webview loads correctly when uncommeting the one second delay while it doesn't work otherwise.
Expected behavior π―
Webview loads correctly
How to reproduce it (as minimally and precisely as possible) π¬
Use webview2 with the sdk version in the description. Map a folder and load a page from the mapped folder.
Workaround π οΈ
NA
Renderer π¨
- Skia
- Native
Affected platforms π±π»π₯οΈ
Windows
Uno.Sdk version (and other relevant versions) π¦
6.4.0-dev.50.
IDE version π§βπ»
Microsoft Visual Studio Enterprise 2022 (2) (64 bit) - Current
Version 17.14.18 (October 2025)
Anything else we need to know? π¬
Found Edge WebView2 version 141.0.3537.99