# Class InvalidProtocolBufferException (3.27.1)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [3.27.1 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.InvalidProtocolBufferException)
- [3.23.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/3.23.0/Google.Protobuf.InvalidProtocolBufferException)
- [3.15.8](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/3.15.8/Google.Protobuf.InvalidProtocolBufferException)

    public sealed class InvalidProtocolBufferException : IOException, ISerializable

Thrown when a protocol message being parsed is invalid in some way,
e.g. it contains a malformed varint or a negative byte length.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [Exception](https://learn.microsoft.com/dotnet/api/system.exception) \> [SystemException](https://learn.microsoft.com/dotnet/api/system.systemexception) \> [IOException](https://learn.microsoft.com/dotnet/api/system.io.ioexception) \> InvalidProtocolBufferException

## Implements

[ISerializable](https://learn.microsoft.com/dotnet/api/system.runtime.serialization.iserializable)

## Inherited Members

[Exception.GetBaseException()](https://learn.microsoft.com/dotnet/api/system.exception.getbaseexception) [Exception.GetObjectData(SerializationInfo, StreamingContext)](https://learn.microsoft.com/dotnet/api/system.exception.getobjectdata) [Exception.GetType()](https://learn.microsoft.com/dotnet/api/system.exception.gettype) [Exception.ToString()](https://learn.microsoft.com/dotnet/api/system.exception.tostring) [Exception.Data](https://learn.microsoft.com/dotnet/api/system.exception.data) [Exception.HelpLink](https://learn.microsoft.com/dotnet/api/system.exception.helplink) [Exception.HResult](https://learn.microsoft.com/dotnet/api/system.exception.hresult) [Exception.InnerException](https://learn.microsoft.com/dotnet/api/system.exception.innerexception) [Exception.Message](https://learn.microsoft.com/dotnet/api/system.exception.message) [Exception.Source](https://learn.microsoft.com/dotnet/api/system.exception.source) [Exception.StackTrace](https://learn.microsoft.com/dotnet/api/system.exception.stacktrace) [Exception.TargetSite](https://learn.microsoft.com/dotnet/api/system.exception.targetsite) [object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)

## Namespace

[Google.Protobuf](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf)

## Assembly

Google.Protobuf.dll