Skip to content

MinimalExample.WPF.HwndHost crash on startup when using x64 build configuration #5177

@quantum1976

Description

@quantum1976

Is there an existing issue for this?

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

CefSharp Version

139.0.280

Operating System

Windows 10

Architecture

x64

.Net Version

.NET Framework 4.8

Implementation

WPF HwndHost

Reproduction Steps

I downloaded CefSharp.MinimalExample.Wpf.HwndHost.net472 and built it using the x64 configuration, it runs correctly on the computer with Visual Studio 2022. But when I copy the application to the target platform (Windows 10 LTSC 1809, .NET Framework 4.8, Visual C++ 2015-2022 redistributable x86/x64), the window popups up for split second and immediately closes.

To troubleshoot, I changed the build configuration to Any CPU and rebuilt it. When I copy the application to the target platform, it runs correctly.

I then enabled additional logging in App.xaml.cs and changed back to the x64 configuration.

var cachePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Cache");
var settings = new CefSettings()
{
    CachePath = cachePath,
    RootCachePath = cachePath,
    LogSeverity = LogSeverity.Verbose,
    LogFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "CefSharp.log"),
};

var errorLogPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "error.log");
AppDomain.CurrentDomain.UnhandledException += (s, e) => File.AppendText(errorLogPath).WriteLine($"AppDomain.CurrentDomain.UnhandledException:\r\n{e.ExceptionObject}");
DispatcherUnhandledException += (s, e) => File.AppendText(errorLogPath).WriteLine($"DispatcherUnhandledException:\r\n{e.Exception}");
Dispatcher.UnhandledException += (s, e) => File.AppendText(errorLogPath).WriteLine($"Dispatcher.UnhandledException:\r\n{e.Exception}");
TaskScheduler.UnobservedTaskException += (s, e) => File.AppendText(errorLogPath).WriteLine($"TaskScheduler.UnobservedTaskException:\r\n{e.Exception}");

After the crash, the CefSharp.log was created however no error.log was created. Additionally, I navigated to \AppDate\Local\CefSharp.MinimalExample\User Data\Crashpad\reports and collected the dump file. Loading the dump file into Visual Studio gave the following exception:
Unhandled exception at 0x00007FFF2A9249B9 (KERNELBASE.dll) in 222a5c27-52e8-4564-9272-118e2fdba9d8.dmp: 0xC06D007E: Module not found (parameters: 0x000000C048DFDCC0).

CefSharp.log
debug.log
222a5c27-52e8-4564-9272-118e2fdba9d8.dmp

Reviewing CefSharp.log, I noticed errors regarding the GPU. I made the following updates to disable GPU and sandbox, however the crash remains on the target platform.

settings.CefCommandLineArgs.Add("disable-gpu", "1");
settings.CefCommandLineArgs.Add("disable-gpu-compositing", "1");
settings.CefCommandLineArgs.Add("disable-sandbox", "1");

CefSharp2.log

Expected behavior

CefSharp.MinimalExample.Wpf.HwndHost.net472 builds using the Any CPU and x64 configuration will run on the target platform (Windows 10 LTSC 1809, .NET Framework 4.8, Visual C++ 2015-2022 redistributable x86/x64)

Actual behavior

Any CPU runs correctly but x64 crashes on startup

Regression?

No response

Known Workarounds

No response

Does this problem also occur in the CEF Sample Application

No

Other information

Running both x86 and x64 cefclient.exe on the target platform ran correctly.

I would prefer to use the x64 build configuration for CefSharp as the Any CPU build configuration is double the size.

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