dotnet/wpf · error · InvalidOperationException
ROP data size was not found
Error message
ROP data size was not found
What it means
For the RasterOperation guid, DecodeAsISF expects a known fixed data size via GuidList.GetDataSizeIfKnownGuid(KnownIds.RasterOperation). If that returns 0, the internal guid-size table is missing the entry, and an InvalidOperationException is thrown — an internal invariant violation rather than bad user data.
Solutions
- Use the standard GuidList with all known ids registered
- Restore the size table entry for KnownIds.RasterOperation
- Verify you are calling the serializer's public surface rather than reimplementing table lookups
- Report as a bug if it occurs with the stock library and valid ISF
Example fix
// before customList.Remove(KnownIds.RasterOperation); // size lookup now returns 0 // after // keep known ids intact guidList = GuidList.CopyWithCustomEntries(userGuids); // standard table + custom additions
Defensive patterns
Strategy: try-catch
Validate before calling
if (GuidList.GetDataSizeIfKnownGuid(KnownIds.RasterOperation) == 0) throw new InvalidOperationException("guid size table incomplete"); Try / catch
try { DecodeAsISF(stream, guidList, maxSize); }
catch (InvalidOperationException ex) when (ex.Message.Contains("ROP")) { /* bug report / fix table */ } Prevention
- Never remove or alter known-id entries in GuidList
- Add a startup self-test asserting known guid sizes are non-zero
- Use the stock serializer tables; extend rather than replace
- Treat this exception as a code bug, not user input error
When it happens
Trigger: Decoding ISF containing a RasterOperation drawing attribute while the guid/size table lookup returns 0 — practically only when the guid table is incomplete, custom-built, or the code path is fed an unexpected table.
Common situations: Custom or partial GuidList implementations; modified guid tables missing known-id sizes; regression from refactoring serializer tables.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- Drawing Attribute tag embedded in ISF stream does not match…
- Global Custom Attribute tag embedded in ISF stream does not…
- Cannot initialize compressor.
- Decompression of packet data failed.
- GUID cannot be empty.
AI-assisted analysis of dotnet/wpf@81131a70a4 (2026-09-14).
Data as JSON: /api/errors/5a2b87615a35cda6.
Report an issue: GitHub.
Appendix: source
Thrown at src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/InkSerializedFormat/DrawingAttributeSerializer.cs:177
{
cb = SerializationHelper.Decode(stream, out dw);
penStyle = (PenStyle)dw;
maximumStreamSize -= cb;
}
else if (KnownIds.DrawingFlags == guid)
{
// Encode the drawing flags with considerations for v2 model
cb = SerializationHelper.Decode (stream, out dw);
DrawingFlags flags = (DrawingFlags)dw;
da.DrawingFlags = flags;
maximumStreamSize -= cb;
}
else if (KnownIds.RasterOperation == guid)
{
uint ropSize = GuidList.GetDataSizeIfKnownGuid(KnownIds.RasterOperation);
if (ropSize == 0)
{
throw new InvalidOperationException(StrokeCollectionSerializer. ISFDebugMessage("ROP data size was not found"));
}
byte[] data = new byte[ropSize];
stream.ReadExactly(data);
if (data != null && data.Length > 0)
{
//data[0] holds the allowable values of 0-255
rasterOperation = Convert.ToUInt32(data[0]);
}
maximumStreamSize -= ropSize;
}
else if (KnownIds.CurveFittingError == guid)
{
cb = SerializationHelper.Decode (stream, out dw);
da.FittingError = (int)dw;
maximumStreamSize -= cb;View on GitHub (pinned to 81131a70a4)