MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[WinForms] NewBrowserVersionAvailable is not firing

Open
#2,098 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Description
NewBrowserVersionAvailable is not firing when new version of runtime installed.

Version
SDK: 1.0.1072.54
Runtime: 97.0.1072.62 -> 97.0.1072.69
Framework: WinForms
OS: Win10

Repro Steps

We have 2 Evergreen Standalone Installers. 97.0.1072.62 and 97.0.1072.69 versions.

Install 97.0.1072.62 and run some sample WinForms app with code like below:

_webView2.CoreWebView2InitializationCompleted += _webView2_CoreWebView2Ready;
_webView2.Source = new Uri("about:blank");

private async void _webView2_CoreWebView2Ready(object sender, CoreWebView2InitializationCompletedEventArgs e)
{
    if (!e.IsSuccess)
    {
        _logger.Error(e.InitializationException, "WebView2 Initialization Exception");
        return;
    }

    _logger.Info($"WebView2 ready, RuntimeVersion {_webView2.CoreWebView2.Environment.BrowserVersionString}.");
    _webView2.CoreWebView2.Environment.NewBrowserVersionAvailable += Environment_NewBrowserVersionAvailable;
}

private void Environment_NewBrowserVersionAvailable(object sender, object e)
{
    _logger.Warn($"NewBrowserVersionAvailable: current {_webView2.CoreWebView2.Environment.BrowserVersionString}; new {CoreWebView2Environment.GetAvailableBrowserVersionString()}");
}

In log you will see: WebView2 ready, RuntimeVersion 97.0.1072.62.
Install 97.0.1072.69 - Environment_NewBrowserVersionAvailable will never fire. If we close (deinit) window with WebView2, wait several seconds and open it again, we will see WebView2 ready, RuntimeVersion 97.0.1072.69. in log.

Also, can some one explain the meaning of this phrase (from docs), it eludes me:

The event is only raised for new version from the same WebView2 Runtime from which the code is running. When not running with installed WebView2 Runtime, no event is raised.

AB#37952354

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the WinForms scenario using the two Evergreen Standalone Installer versions and the shown NewBrowserVersionAvailable subscription. Read the linked API documentation and compare the event behavior before and after runtime installation. Done means the runtime behavior is corrected or the documented conditions are clarified and verified against the reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.