{"record":{"id":"5a2b87615a35cda6","repo":"dotnet/wpf","slug":"rop-data-size-was-not-found","errorCode":null,"errorMessage":"ROP data size was not found","messagePattern":"ROP data size was not found","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/InkSerializedFormat/DrawingAttributeSerializer.cs","lineNumber":177,"sourceCode":"                {\n                    cb = SerializationHelper.Decode(stream, out dw);\n                    penStyle = (PenStyle)dw;\n                    maximumStreamSize -= cb;\n                }\n                else if (KnownIds.DrawingFlags == guid)\n                {\n                    // Encode the drawing flags with considerations for v2 model\n                    cb = SerializationHelper.Decode (stream, out dw);\n                    DrawingFlags flags = (DrawingFlags)dw;\n                    da.DrawingFlags = flags;\n                    maximumStreamSize -= cb;\n                }\n                else if (KnownIds.RasterOperation == guid)\n                {\n                    uint ropSize = GuidList.GetDataSizeIfKnownGuid(KnownIds.RasterOperation);\n                    if (ropSize == 0)\n                    {\n                        throw new InvalidOperationException(StrokeCollectionSerializer. ISFDebugMessage(\"ROP data size was not found\"));\n                    }\n\n                    byte[] data = new byte[ropSize];\n                    stream.ReadExactly(data);\n\n                    if (data != null && data.Length > 0)\n                    {\n                        //data[0] holds the allowable values of 0-255\n                        rasterOperation = Convert.ToUInt32(data[0]);\n                    }\n\n                    maximumStreamSize -= ropSize;\n                }\n                else if (KnownIds.CurveFittingError == guid)\n                {\n                    cb = SerializationHelper.Decode (stream, out dw);\n                    da.FittingError = (int)dw;\n                    maximumStreamSize -= cb;","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/InkSerializedFormat/DrawingAttributeSerializer.cs#L159-L195","documentation":"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.","triggerScenarios":"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.","commonSituations":"Custom or partial GuidList implementations; modified guid tables missing known-id sizes; regression from refactoring serializer tables.","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"],"exampleFix":"// before\ncustomList.Remove(KnownIds.RasterOperation); // size lookup now returns 0\n// after\n// keep known ids intact\nguidList = GuidList.CopyWithCustomEntries(userGuids); // standard table + custom additions","handlingStrategy":"try-catch","validationCode":"if (GuidList.GetDataSizeIfKnownGuid(KnownIds.RasterOperation) == 0) throw new InvalidOperationException(\"guid size table incomplete\");","typeGuard":null,"tryCatchPattern":"try { DecodeAsISF(stream, guidList, maxSize); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"ROP\")) { /* bug report / fix table */ }","preventionTips":["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"],"tags":["wpf","ink","isf","invariant","guid"],"backgroundTag":"internal-invariant-violation","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}