cefsharp/CefSharp · error · Exception

{settingName} now requires an absolute path, the path provid

Error message

{settingName} now requires an absolute path, the path provided is non-absolute. You can use System.IO.Path.GetFullPath to obtain an absolute path. Current value:{path}

What it means

Thrown by PathCheck.AssertAbsolute when a non-empty path setting is not absolute according to Chromium's FilePath::IsAbsolute rule (a drive letter followed by a separator, or two leading separators). Relative paths, single-leading-separator paths like \programfiles, and unprefixed relative names are rejected. Validation is skipped when the path is null/empty or EnableAssert is false.

Source

Thrown at CefSharp/Internals/PathCheck.cs:67

        /// <summary>
        /// Throw exception if the path provided is non-asbolute
        /// CEF now explicitly requires absolute paths
        /// https://github.com/chromiumembedded/cef/issues/2916
        /// Empty paths are ignored
        /// </summary>
        /// <param name="path">path</param>
        /// <param name="settingName">string to appear at the start of
        /// the exception, e.g. CefSettings.BrowserSubProcessPath</param>
        public static void AssertAbsolute(string path, string settingName)
        {
            //Don't validate empty paths
            if (!string.IsNullOrEmpty(path) && EnableAssert)
            {
                //IsPathRooted will return true for paths that start with a single slash, e.g. \programfiles
                if (!IsAbsolute(path))
                {
                    throw new Exception(settingName + " now requires an absolute path, the path provided is non-absolute. You can use System.IO.Path.GetFullPath to obtain an absolute path. Current value:" + path);
                }
            }
        }

        /// <summary>
        /// Valid path is absolute, based on Chromium implementation.
        /// </summary>
        /// <param name="path">path</param>
        public static bool IsAbsolute(string path)
        {
            //Based on Chromium FilePath::IsAbsolute
            //https://source.chromium.org/chromium/chromium/src/+/master:base/files/file_path.cc;drc=1c097f5f790782b2ad0b897cd9e2921ce9713585;l=97?q=IsAbsolute&ss=chromium&originalUrl=https:%2F%2Fcs.chromium.org%2F
            var pos = FindDriveLetter(path);
            if (pos != -1)
            {
                // Look for a separator right after the drive specification.
                return path.Length > (pos + 1) && IsDirectorySeparator(path[pos + 1]);
            }

View on GitHub (pinned to 16bc6e0711)

Solutions

  1. Build absolute paths with System.IO.Path.GetFullPath or Path.Combine(baseDir, relative) before assigning.
  2. Anchor paths to the app base directory (AppContext.BaseDirectory) explicitly.
  3. Verify the resolved path begins with a drive+separator (Windows) or two separators / leading slash as appropriate.
  4. Leave a setting null/empty if you want the default, rather than passing a relative string.

Example fix

// before
settings.BrowserSubProcessPath = "CefSharp.BrowserSubprocess.exe";

// after
var baseDir = AppContext.BaseDirectory;
settings.BrowserSubProcessPath = Path.Combine(baseDir, "CefSharp.BrowserSubprocess.exe");
Defensive patterns

Strategy: validation

Validate before calling

static string ToAbsolute(string p) =>
    string.IsNullOrEmpty(p) ? p : Path.GetFullPath(p);
settings.BrowserSubProcessPath = ToAbsolute(settings.BrowserSubProcessPath);
settings.LocalesDirPath = ToAbsolute(settings.LocalesDirPath);

Try / catch

try { settings.BrowserSubProcessPath = value; }
catch (Exception ex) when (ex.Message.Contains("absolute path"))
{ settings.BrowserSubProcessPath = Path.GetFullPath(value); }

Prevention

When it happens

Trigger: Assigning a relative path to CefSettings properties such as BrowserSubProcessPath, LocalesDirPath, ResourcesDirPath, CachePath, UserDataPath, orLogFile. Paths rooted with a single backslash are also rejected because they are not absolute by the Chromium rule.

Common situations: Using AppDomain.CurrentDomain.BaseDirectory-relative strings without combining to an absolute path; deploying with relative paths that worked in older versions; cross-platform path differences.

Related errors


AI-assisted analysis of cefsharp/CefSharp@16bc6e0711 (2026-08-13). Data as JSON: /api/errors/55f0c7c0f81ed53a. Report an issue: GitHub.