Skip to content

Running Executable as Admin fails. Including MinimalExample. #5135

@ThatCanadianGuy

Description

@ThatCanadianGuy

Is there an existing issue for this?

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

CefSharp Version

138.0.17

Operating System

Windows 11

Architecture

x64

.Net Version

.Net 6.0

Implementation

WPF

Reproduction Steps

Reproducing this one is pretty quick. You:

  1. Download the MinimalExample,
  2. Run Visual Studio as Administrator
  3. Set the Wpf.NetCore project as startup
  4. Try running the project in Debug and AnyCPU

A popup should show up:
Image

The debug.log file contains:
[0715/210235.940:ERROR:third_party\crashpad\crashpad\client\crashpad_client_win.cc:548] CreateProcess: The system cannot find the file specified. (0x2) [0715/210235.943:INFO:cef\libcef\common\crash_reporting.cc:209] Crash reporting enabled for process: browser

Running VS (or the .exe directly) with normal permissions doesn't exhibit the issues.

Expected behavior

That the app should run regardless of elevation.

I've noticed that in the minimal example, setting the CachePath to null will work, but that's an in-memory cache and doesn't work for my larger app. Are there any allowed paths or steps that should be used to handle situations where an elevated user might start the application or use the "Run as administrator" option?

Actual behavior

The dialog described above is shown, and the app exits. An output line states:

The program '[117920] CefSharp.MinimalExample.Wpf.netcore.exe' has exited with code 2147483651 (0x80000003).

Regression?

I don't have a specific version of CefSharp to point to that was working as I'm encountering this issue today. From my own source control it may be as far back as 131.3.1. Apologies if there's a breaking change, I was hopeful that the minimal example would help clear things up.

To add: Reverted all the way to 129.0.110 and the problem is gone. The package is market vulnerable, though, so probably not a good version to keep.

Known Workarounds

If the app size is very small (like the minimal example), setting the CachePath to null seems to work. For anything larger, this will still fail. For using an on-disk cache, what would be the steps when elevated permissions are detected? Or is there a catch-all location for the cache that should work anywhere?

Does this problem also occur in the CEF Sample Application

No

Other information

No additional information at this time, but I can definitely provide anything additional if needed!

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstreamThese issues require fixing in the Chromium Embedded Framework(CEF) or Chromium.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions