Skip to content

[Problem/Bug]: FixedVersion webview2 and windows 11 webview2 #5236

Open
@DotNet-Fan

Description

@DotNet-Fan

What happened?

In our UWP app , We have a feature that allows a user to switch between fixed version of webview2 and the windows 11 default version of webview2.

This works well with the default option of using webview2 that comes with windows 11 - 136.0.3240.64.

If there are any issues with the default version , then user has the option to switch to the tested version available from the server.
We don't want to bundle the fixed version of webview2 libraries to the UWP app installation as the package size becomes huge and users won't install the app. We already has a bundled version in the store and we have to move away from the huge UWP package bundled with webview2.
So we have the tested version 135.0.3179.98 copied to the server as a single zip file. When user selects the fixed version option from the settings,
the webview2 zip file will be streamed and downloaded from the server and the zip file is extracted and copied to the Appdata folder.
And during the start of the app, the environment would be pointed to that folder where it is copied.

string AppPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, _companyName, _appName);

System.Environment.SetEnvironmentVariable("WEBVIEW2_USER_DATA_FOLDER", AppPath);
string fixedPath = Path.Combine(AppPath, "FixedWebView2");
Environment.SetEnvironmentVariable("WEBVIEW2_BROWSER_EXECUTABLE_FOLDER", fixedPath);

In a working environment we would be having multiple instances of webview2 runs at the same time. But in the ondemand fixedversion downloaded , webview2 instances doesn't navigated to the urls and it crashes the app after sometime and is black. I have compared the files downloaded from the server with the files in the Microsoft actual packages and all are same.

Any idea how to fix this fixed version issue?

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

135.0.3179.98

SDK Version

Microsoft.UI.Xaml -2.8.6

Framework

WinUI2/UWP

Operating System

Windows 11

OS Version

No response

Repro steps

  1. Create a UWP app with page have multiple panels hosting the webview2 controls. Each webview2 control instances navigate to different urls.
  2. Download the 135.0.3179.98 version of fixed version from microsoft server and extract to the app's path
    Windows.Storage.ApplicationData.Current.LocalFolder.Path
  3. Point the webview2 environment in the mainpage when the app gets loaded .
    string AppPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, _companyName, _appName);

System.Environment.SetEnvironmentVariable("WEBVIEW2_USER_DATA_FOLDER", AppPath);
string fixedPath = Path.Combine(AppPath, "FixedWebView2");
Environment.SetEnvironmentVariable("WEBVIEW2_BROWSER_EXECUTABLE_FOLDER", fixedPath);

  1. Build the app and see the webview2 instances are navigating to the Urls.
  2. In the taskmanger observer the app and its child webview2 process.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions