Open kuba1 opened 1 year ago
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
+1, having the same issue with .NET MAUI Blazor (Hybrid). The existing workarounds for Blazor with Forms/WPF (such as #10772 ) don't work for the MAUI Blazor app.
SDK/Runtime Version: .NET 7.0.400 Platform: Windows Windows SDK: 10.0.22621.0
Until this problem gets fixed properly, there is a workaround by setting the appropriate environment variable before the webview even starts initializing, so for example in the page's constructor:
public MainPage()
{
InitializeComponent();
Environment.SetEnvironmentVariable("WEBVIEW2_USER_DATA_FOLDER", "C:\\path\\to\\preferred\\folder");
}
Until this problem gets fixed properly, there is a workaround by setting the appropriate environment variable before the webview even starts initializing, so for example in the page's constructor:
public MainPage() { InitializeComponent(); Environment.SetEnvironmentVariable("WEBVIEW2_USER_DATA_FOLDER", "C:\\path\\to\\preferred\\folder"); }
You just saved my day! No news from the dotnet devs about a fancier way to proceed?
Description
I cannot set UserDataFolder using BlazorWebViewInitializing event handler in Blazor WPF application with set to None.
The folder used is still the same as .exe (app build folder).
Steps to Reproduce
Expected outcome: user data for WebView2 is written to folder set on BlazorWebViewInitializingEventArgs Actual outcome: user data for WebView2 is written to the default (?) location - application folder (same as where the .exe file is)
This is a problem when installing in 'Program Files' or 'Program Files (x86)'.
Link to public reproduction project repository
https://github.com/kuba1/maui-bug
Version with bug
7.0 Release Candidate 2
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
Windows SDK 10.0.19041.0
Did you find any workaround?
No response
Relevant log output
No response