[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eVersion\u003c/code\u003e class represents the version number of the protocol compiler, implementing interfaces such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt has constructors, including a default and a copy constructor, and allows specifying major, minor, patch, and suffix fields for the compiler's version, with the ability to set and get them individually.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods to manipulate, such as merging, cloning, and clearing version fields, and has methods to calculate the message size and to write the message to a stream.\u003c/p\u003e\n"],["\u003cp\u003eFields such as \u003ccode\u003eMajorFieldNumber\u003c/code\u003e, \u003ccode\u003eMinorFieldNumber\u003c/code\u003e, \u003ccode\u003ePatchFieldNumber\u003c/code\u003e, and \u003ccode\u003eSuffixFieldNumber\u003c/code\u003e are available to define each corresponding version number, which are all int types, except for the Suffix which is a string.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eVersion\u003c/code\u003e class also implements methods inherited from \u003ccode\u003eobject\u003c/code\u003e, such as \u003ccode\u003eEquals\u003c/code\u003e and \u003ccode\u003eGetHashCode\u003c/code\u003e, along with extension methods for interacting with streams and byte arrays.\u003c/p\u003e\n"]]],[],null,["# Class Version (3.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [3.27.1 (latest)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Compiler.Version)\n- [3.23.0](/dotnet/docs/reference/Google.Protobuf/3.23.0/Google.Protobuf.Compiler.Version)\n- [3.15.8](/dotnet/docs/reference/Google.Protobuf/3.15.8/Google.Protobuf.Compiler.Version) \n\n public sealed class Version : IMessage\u003cVersion\u003e, IEquatable\u003cVersion\u003e, IDeepCloneable\u003cVersion\u003e, IBufferMessage, IMessage\n\nThe version number of protocol compiler. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Version \n\nImplements\n----------\n\n[IMessage](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1)[Version](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Compiler.Version), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Version](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Compiler.Version), [IDeepCloneable](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1)[Version](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Compiler.Version), [IBufferMessage](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage), [IMessage](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage) \n\nInherited Members\n-----------------\n\n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Protobuf.Compiler](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Compiler)\n\nAssembly\n--------\n\nGoogle.Protobuf.dll\n\nConstructors\n------------\n\n### Version()\n\n public Version()\n\n### Version(Version)\n\n public Version(Version other)\n\nFields\n------\n\n### MajorFieldNumber\n\n public const int MajorFieldNumber = 1\n\nField number for the \"major\" field.\n\n### MinorFieldNumber\n\n public const int MinorFieldNumber = 2\n\nField number for the \"minor\" field.\n\n### PatchFieldNumber\n\n public const int PatchFieldNumber = 3\n\nField number for the \"patch\" field.\n\n### SuffixFieldNumber\n\n public const int SuffixFieldNumber = 4\n\nField number for the \"suffix\" field.\n\nProperties\n----------\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### HasMajor\n\n public bool HasMajor { get; }\n\nGets whether the \"major\" field is set\n\n### HasMinor\n\n public bool HasMinor { get; }\n\nGets whether the \"minor\" field is set\n\n### HasPatch\n\n public bool HasPatch { get; }\n\nGets whether the \"patch\" field is set\n\n### HasSuffix\n\n public bool HasSuffix { get; }\n\nGets whether the \"suffix\" field is set\n\n### Major\n\n public int Major { get; set; }\n\n### Minor\n\n public int Minor { get; set; }\n\n### Parser\n\n public static MessageParser\u003cVersion\u003e Parser { get; }\n\n### Patch\n\n public int Patch { get; set; }\n\n### Suffix\n\n public string Suffix { get; set; }\n\nA suffix for alpha, beta or rc release, e.g., \"alpha-1\", \"rc2\". It should\nbe empty for mainline stable releases.\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\nCalculates the size of this message in Protocol Buffer wire format, in bytes.\n\n### ClearMajor()\n\n public void ClearMajor()\n\nClears the value of the \"major\" field\n\n### ClearMinor()\n\n public void ClearMinor()\n\nClears the value of the \"minor\" field\n\n### ClearPatch()\n\n public void ClearPatch()\n\nClears the value of the \"patch\" field\n\n### ClearSuffix()\n\n public void ClearSuffix()\n\nClears the value of the \"suffix\" field\n\n### Clone()\n\n public Version Clone()\n\nCreates a deep clone of this object.\n\n### Equals(Version)\n\n public bool Equals(Version other)\n\n### Equals(object)\n\n public override bool Equals(object other)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### MergeFrom(CodedInputStream)\n\n public void MergeFrom(CodedInputStream input)\n\nMerges the data from the specified coded input stream with the current message.\n\n**Remarks** \nSee the user guide for precise merge semantics.\n\n### MergeFrom(Version)\n\n public void MergeFrom(Version other)\n\nMerges the given message into this one.\n\n**Remarks** \nSee the user guide for precise merge semantics.\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### WriteTo(CodedOutputStream)\n\n public void WriteTo(CodedOutputStream output)\n\nWrites the data to the given coded output stream.\n\nExtension Methods\n-----------------\n\n[MessageExtensions.IsInitialized(IMessage)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_IsInitialized_Google_Protobuf_IMessage_) \n[MessageExtensions.MergeDelimitedFrom(IMessage, Stream)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeDelimitedFrom_Google_Protobuf_IMessage_System_IO_Stream_) \n[MessageExtensions.MergeFrom(IMessage, ByteString)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeFrom_Google_Protobuf_IMessage_Google_Protobuf_ByteString_) \n[MessageExtensions.MergeFrom(IMessage, ReadOnlySequence\\\u003cbyte\\\u003e)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeFrom_Google_Protobuf_IMessage_System_Buffers_ReadOnlySequence_System_Byte__) \n[MessageExtensions.MergeFrom(IMessage, byte\\[\\])](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeFrom_Google_Protobuf_IMessage_System_Byte___) \n[MessageExtensions.MergeFrom(IMessage, byte\\[\\], int, int)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeFrom_Google_Protobuf_IMessage_System_Byte___System_Int32_System_Int32_) \n[MessageExtensions.MergeFrom(IMessage, Stream)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeFrom_Google_Protobuf_IMessage_System_IO_Stream_) \n[MessageExtensions.MergeFrom(IMessage, ReadOnlySpan\\\u003cbyte\\\u003e)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeFrom_Google_Protobuf_IMessage_System_ReadOnlySpan_System_Byte__) \n[MessageExtensions.ToByteArray(IMessage)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_ToByteArray_Google_Protobuf_IMessage_) \n[MessageExtensions.ToByteString(IMessage)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_ToByteString_Google_Protobuf_IMessage_) \n[MessageExtensions.WriteDelimitedTo(IMessage, Stream)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_WriteDelimitedTo_Google_Protobuf_IMessage_System_IO_Stream_) \n[MessageExtensions.WriteTo(IMessage, IBufferWriter\\\u003cbyte\\\u003e)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_WriteTo_Google_Protobuf_IMessage_System_Buffers_IBufferWriter_System_Byte__) \n[MessageExtensions.WriteTo(IMessage, Stream)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_WriteTo_Google_Protobuf_IMessage_System_IO_Stream_) \n[MessageExtensions.WriteTo(IMessage, Span\\\u003cbyte\\\u003e)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_WriteTo_Google_Protobuf_IMessage_System_Span_System_Byte__)"]]