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
- Avoid the jagged overload: serialise each byte[] separately and combine with a delimiter, or flatten into a single byte[] before calling ToBase64String(byte[]).
- Override ToBase64String(byte[][]) in your subclass and implement the join (e.g. Concat + Convert.ToBase64String).
- If a generated entity triggers it, report the field/method to CefSharp so the overload is implemented upstream.
- 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
- Never call ToBase64String(byte[][]) in DevTools entities - it is a stub
- Implement the join in a subclass if your entity genuinely needs jagged binary blobs
- Report any generated entity that reaches the jagged overload upstream
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
- {prop.Name} is required
- IBrowser
- Unable to add MessageId {0} to queuedCommandResults Concurre
- Unable to invoke ExecuteDevToolsMethod on CEF UI Thread.
- Failed to execute dev tools method {0}.
AI-assisted analysis of cefsharp/CefSharp@16bc6e0711 (2026-08-13).
Data as JSON: /api/errors/5395dd8799ac088f.
Report an issue: GitHub.