Skip to content

Version mismatch between CefSharp and Microsoft Edge WebView2 Runtime #4946

@maaz-astera

Description

@maaz-astera

Is there an existing issue for this?

  • I have searched both open/closed issues, no issue already exists.

CefSharp Version

128.4.90

Operating System

Windows 10

Architecture

x64

.Net Version

.Net 8

Implementation

WPF

Reproduction Steps

I've added my project references like this:

<PackageReference Include="CefSharp.Wpf.NETCore" Version="128.4.90" />
	<PackageReference Include="chromiumembeddedframework.runtime" Version="128.4.90" />
	<PackageReference Include="chromiumembeddedframework.runtime.win-arm64" Version="128.4.90" />
	<PackageReference Include="chromiumembeddedframework.runtime.win-x64" Version="128.4.90" />
	<PackageReference Include="chromiumembeddedframework.runtime.win-x86" Version="128.4.90" />

My code to initialize CefSharp:

private static void LoadBrowserApp()
    {
        var settings = new CefSettings()
        {
            //@noloc
            CachePath = FilePath.Combine(AsteraAppContext.Paths.SystemFilePath, @"CefSharp\Cache"),
            LogSeverity = LogSeverity.Verbose,
            LogFile = FilePath.Combine(AsteraAppContext.Paths.SystemFilePath, "cefsharp.log")
        };
        //@noloc
        settings.CefCommandLineArgs.Add("enable-media-stream");
        //@noloc
        settings.CefCommandLineArgs.Add("disable-gpu", "1");
        //@noloc
        settings.CefCommandLineArgs.Add("disable-gpu-vsync", "1");
        //@noloc
        settings.CefCommandLineArgs.Add("disable-gpu-compositing", "1");
        CefSharpSettings.ShutdownOnExit = true;
        CefSharpSettings.SubprocessExitIfParentProcessClosed = true;
        if (Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null))
        {
            BrowserControlWPF.CefSharpSupport = true;
        }
        else
        {
            InfoBoxWPF.ShowError("CefSharp Browser failed to initialize.");
            BrowserControlWPF.CefSharpSupport = false;
        }
    }

Expected behavior

CefSharp is supposed to initialize fine with no errors.

Actual behavior

Running the project gives me CefSharp Browser failed to initialize error.

Regression?

No response

Known Workarounds

Having been facing the issue for quite a while. I keep updating the CefSharp library version and it'd work fine but only for a few weeks.
Now, it's in latest version and still facing this issue.

Does this problem also occur in the CEF Sample Application

Yes using WPF/OffScreen command line args

Other information

I've read a while ago that if there is a version mismatch between CefSharp and Microsoft Edge Webview2, it'd create issues.
Currently, the CefSharp version is 128.4.90 and WebView2 version is 129.0
Is there any way to fix this issue without keep updating my CefSharp version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions