cefsharp/CefSharp · error · NotImplementedException

Not currently supported.

Error message

Not currently supported.

What it means

The base class DevToolsDomainBase provides two ToBase64String overloads. The single-dimension byte[] overload works; the jagged byte[][] overload throws NotImplementedException. Generated DevTools domain entities (and user subclasses) inherit these helpers. Any code path that calls ToBase64String on a jagged byte array will fail because the conversion for arrays-of-binary-blobs was never implemented.

Source

Thrown at CefSharp.Core/DevTools/DevToolsDomainBase.cs:144

        {
            foreach (var val in values)
            {
                var memInfo = val.GetType().GetMember(val.ToString());
                var dataMemberAttribute = (EnumMemberAttribute)Attribute.GetCustomAttribute(memInfo[0], typeof(EnumMemberAttribute), false);

                yield return dataMemberAttribute.Value;
            }
        }
#endif

        protected string ToBase64String(byte[] bytes)
        {
            return Convert.ToBase64String(bytes);
        }

        protected string ToBase64String(byte[][] bytes)
        {
            throw new NotImplementedException("Not currently supported.");
        }
    }
}

View on GitHub (pinned to 16bc6e0711)

Solutions

  1. Avoid the jagged overload: serialise each byte[] separately and combine with a delimiter, or flatten into a single byte[] before calling ToBase64String(byte[]).
  2. Override ToBase64String(byte[][]) in your subclass and implement the join (e.g. Concat + Convert.ToBase64String).
  3. If a generated entity triggers it, report the field/method to CefSharp so the overload is implemented upstream.
  4. As a stopgap, Base64-encode the jagged array manually and store the string instead of the byte[][].

Example fix

// before (throws NotImplementedException)
protected string Encode(byte[][] chunks) => ToBase64String(chunks);

// after - implement in subclass
protected new string ToBase64String(byte[][] chunks)
{
    using var ms = new System.IO.MemoryStream();
    foreach (var c in chunks) ms.Write(c, 0, c.Length);
    return Convert.ToBase64String(ms.ToArray());
}
Defensive patterns

Strategy: validation

Validate before calling

// Avoid the jagged overload; flatten before encoding.
static string SafeBase64(byte[][] chunks)
{
    using var ms = new System.IO.MemoryStream();
    foreach (var c in chunks) ms.Write(c, 0, c.Length);
    return Convert.ToBase64String(ms.ToArray());
}

Type guard

public static bool IsSupportedToBase64 overload => chunks is byte[] single; // only single-dim is supported

Try / catch

try { return ToBase64String(jagged); }
catch (NotImplementedException) { /* flatten and retry */ return SafeBase64(jagged); }

Prevention

When it happens

Trigger: Subclassing DevToolsDomainBase and overriding/serializing a property typed as byte[][]; a generated DevTools entity that exposes a binary stream field serialised via the jagged overload; calling ToBase64String(new byte[][] { ... }) directly from custom domain code.

Common situations: Custom DevTools domain entity that needs to send multiple binary chunks; upgrading to a CefSharp version whose generated code now exercises the jagged overload for a previously-unused protocol field.

Related errors


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