{"record":{"id":"e69e541ead17d865","repo":"XINCGer/Unity3DTraining","slug":"messageset-format-is-not-supported","errorCode":null,"errorMessage":"MessageSet format is not supported.","messagePattern":"MessageSet format is not supported\\.","errorType":"validation","errorClass":"DescriptorValidationException","httpStatus":null,"severity":"error","filePath":"NetWorkAndResources/Socket_Protobuff/Assets/Plugins/Google.Protobuf/Reflection/FieldDescriptor.cs","lineNumber":361,"sourceCode":"                {\n                    throw new DescriptorValidationException(this, \"Field with primitive type has type_name.\");\n                }\n            }\n            else\n            {\n                if (fieldType == FieldType.Message || fieldType == FieldType.Enum)\n                {\n                    throw new DescriptorValidationException(this, \"Field with message or enum type missing type_name.\");\n                }\n            }\n\n            // Note: no attempt to perform any default value parsing\n\n            File.DescriptorPool.AddFieldByNumber(this);\n\n            if (ContainingType != null && ContainingType.Proto.Options != null && ContainingType.Proto.Options.MessageSetWireFormat)\n            {\n                throw new DescriptorValidationException(this, \"MessageSet format is not supported.\");\n            }\n            accessor = CreateAccessor();\n        }\n\n        private IFieldAccessor CreateAccessor()\n        {\n            // If we're given no property name, that's because we really don't want an accessor.\n            // (At the moment, that means it's a map entry message...)\n            if (propertyName == null)\n            {\n                return null;\n            }\n            var property = ContainingType.ClrType.GetProperty(propertyName);\n            if (property == null)\n            {\n                throw new DescriptorValidationException(this, \"Property \" + propertyName + \" not found in \" + ContainingType.ClrType);\n            }\n            return IsMap ? new MapFieldAccessor(property, this)","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/XINCGer/Unity3DTraining/blob/016f98412ea5e11756b286736f479b66ab6216d5/NetWorkAndResources/Socket_Protobuff/Assets/Plugins/Google.Protobuf/Reflection/FieldDescriptor.cs#L343-L379","documentation":"Google.Protobuf does not support the proto2 MessageSet wire format option. CrossLink checks the containing type's MessageSetWireFormat option and throws DescriptorValidationException if it is true, because message-set fields cannot be represented by this runtime.","triggerScenarios":"A message in the descriptor has options.message_set_wire_format = true (e.g. compatibility descriptors ported from C++/Java code that uses MessageSet, like extensions of google.protobuf.MessageSet or old exproto/LogCollector formats).","commonSituations":"Porting legacy proto2 schemas that used message sets for extensibility; sharing descriptor files with systems that rely on MessageSet wire format.","solutions":["Remove `option message_set_wire_format = true;` from the message and use ordinary fields or groups instead.","Regenerate code/descriptors with protoc after removing the option.","If MessageSet is required, use a runtime that supports it; the C# Google.Protobuf port intentionally does not.","Rewrite MessageSet-style extension usage as regular repeated fields."],"exampleFix":"// before (proto)\nmessage LegacyEvent { option message_set_wire_format = true; }\n// after (proto)\nmessage LegacyEvent { repeated ExtendedData data = 1; } // drop message_set_wire_format","handlingStrategy":"validation","validationCode":"bool MessageSetFree(FileDescriptorProto f) => f.MessageType.All(m => m.Options == null || !m.Options.MessageSetWireFormat);","typeGuard":null,"tryCatchPattern":"try { BuildFrom(...); } catch (DescriptorValidationException e) when (e.Message.Contains(\"MessageSet\")) { throw new NotSupportedException(\"MessageSet format is unsupported in Google.Protobuf (C#)\"); }","preventionTips":["Never enable message_set_wire_format in .proto files targeting C#.","Document MessageSet incompatibility when sharing schemas with C++/Java teams.","Prefer ordinary repeated fields for extensibility."],"tags":["protobuf","descriptor","unsupported-feature","proto2"],"backgroundTag":"unsupported-operation","analyzedSha":"016f98412ea5e11756b286736f479b66ab6216d5","analyzedAt":"2026-09-12T01:08:58.711Z","contentChangedAt":"2026-09-12T01:08:58.711Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}