Skip to content

Fix application crash issue with webview#4692

Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit intomainfrom
WebViewCtrash
May 5, 2026
Merged

Fix application crash issue with webview#4692
Gabriel Dufresne (GabrielDuf) merged 1 commit intomainfrom
WebViewCtrash

Conversation

@GabrielDuf
Copy link
Copy Markdown
Contributor

@GabrielDuf Gabriel Dufresne (GabrielDuf) commented May 5, 2026

We received a few error report that had an UnauthorizedAccessException on first launch. The WinUI app already redirected WebView2 to
%TEMP%\UniGetUI\WebView via WEBVIEW2_USER_DATA_FOLDER — the Avalonia app was missing that same setup.

WebView2 user-data folder redirection:

  • Added a new SetUpWebViewUserDataFolder method in App.axaml.cs that creates a temporary directory for WebView2 user data and sets the WEBVIEW2_USER_DATA_FOLDER environment variable to this path, ensuring the app doesn't crash due to permission issues on startup.
  • Called SetUpWebViewUserDataFolder during Windows-specific initialization to apply this fix early in the app lifecycle.

Minor codebase updates:

  • Added using System.IO; and using UniGetUI.Core.Logging; to support the new logic and logging.

@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit eeed2b9 into main May 5, 2026
1 check passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the WebViewCtrash branch May 5, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants