# OpcTypeDecodingFailedEventArgs Members

> Reference: Provides the event data for events of the delegate type OpcTypeDecodingFailedEventHandler.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcTypeDecodingFailedEventArgs</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Inherits members from [EventArgs](https://learn.microsoft.com/dotnet/api/system.eventargs).

## Properties

### Data

Gets the data which is tried to decode.

<div class="api-signature" data-lang="csharp">

```csharp
public object Data { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Data As Object
```

</div>

**Property value**

[Object](https://learn.microsoft.com/dotnet/api/system.object)

An [object](https://learn.microsoft.com/dotnet/api/system.object) instance which depends on the decoder used.

### Encoding

Gets the type of encoding supported by the decoder used.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEncodingType Encoding { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Encoding As OpcEncodingType
```

</div>

**Property value**

[OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/)

One of the members defined by the [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) enumeration.

### Exception

Gets the [Exception](https://learn.microsoft.com/dotnet/api/system.exception) created or caught during the decoding process.

<div class="api-signature" data-lang="csharp">

```csharp
public Exception Exception { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Exception As Exception
```

</div>

**Property value**

[Exception](https://learn.microsoft.com/dotnet/api/system.exception)

An instance of the [Exception](https://learn.microsoft.com/dotnet/api/system.exception) class or a null reference (Nothing in Visual Basic) in case there the conditions under which the decoding failed are in advance determined and reported.

### FieldName

Gets the name of the field of an [Instance](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#instance) which is about to get decoded.

<div class="api-signature" data-lang="csharp">

```csharp
public string FieldName { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property FieldName As String
```

</div>

**Property value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

The name of the field to decode or a null reference (Nothing in Visual Basic) if there is no field name known by the decoder for the current decode failure.

### FieldType

Gets the type of the field being decoded.

<div class="api-signature" data-lang="csharp">

```csharp
public Type FieldType { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property FieldType As Type
```

</div>

**Property value**

[Type](https://learn.microsoft.com/dotnet/api/system.type)

The [Type](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#type) of the field to decode or a null reference (Nothing in Visual Basic) if there is no [Type](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#type) known by the decoder for the current decode failure.

### Instance

Gets the [object](https://learn.microsoft.com/dotnet/api/system.object) instance its data is being decoded.

<div class="api-signature" data-lang="csharp">

```csharp
public object Instance { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Instance As Object
```

</div>

**Property value**

[Object](https://learn.microsoft.com/dotnet/api/system.object)

An [object](https://learn.microsoft.com/dotnet/api/system.object) instance or a null reference (Nothing in Visual Basic) in case there the decoder is not about to decode an instance.

### Message

Gets the description of the decoding failure.

<div class="api-signature" data-lang="csharp">

```csharp
public string Message { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Message As String
```

</div>

**Property value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

The description of the decoding failure or a null reference (Nothing in Visual Basic) in the case there the decoding failure indicates an exception which was handled using a generic exception handler.

### Type

Gets the type information used to decode the data of the [Instance](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#instance).

<div class="api-signature" data-lang="csharp">

```csharp
public Type Type { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Type As Type
```

</div>

**Property value**

[Type](https://learn.microsoft.com/dotnet/api/system.type)

The [Type](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#type) of the [Instance](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#instance) being decoded or a null reference (Nothing in Visual Basic) if the decoding failure occured in a context where an instance type is either not used or unknown.

### TypeId

Gets the identifier of the type being decoded.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcNodeId TypeId { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property TypeId As OpcNodeId
```

</div>

**Property value**

[OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/)

An instance of the [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) class which identifies the type being decoded or a null reference (Nothing in Visual Basic) if the decoding failed in a context there a type identifier does not apply to the decoding operation performed.

### TypeIdAbsolute

Gets the absolute [TypeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#typeid) (if available).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcNodeId TypeIdAbsolute { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property TypeIdAbsolute As OpcNodeId
```

</div>

**Property value**

[OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/)

The absolute [TypeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#typeid) in case there the [TypeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#typeid) has been resolved or a null reference (Nothing in Visual Basic) if the [TypeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#typeid) hasn't been resolved.

## Methods

### Dispose

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [Dispose()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#dispose-noparams) | Releases all resources used by the [OpcTypeDecodingFailedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/). |
| [Dispose(bool)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#dispose-system-boolean)<span class="api-meta">protected · virtual</span> | Releases the unmanaged resources used by the [OpcTypeDecodingFailedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/) and optionally releases the managed resources. |

#### Dispose()

Releases all resources used by the [OpcTypeDecodingFailedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/).

<div class="api-signature" data-lang="csharp">

```csharp
public void Dispose()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Dispose()
```

</div>

**Implements**

[Dispose()](https://learn.microsoft.com/dotnet/api/system.idisposable.dispose)

#### Dispose(bool)

<span class="api-meta">protected · virtual</span>

Releases the unmanaged resources used by the [OpcTypeDecodingFailedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/) and optionally releases the managed resources.

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void Dispose(bool disposing)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub Dispose(disposing As Boolean)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `disposing` | [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) | The value true to release both managed and unmanaged resources; otherwise the value false to release only unmanaged resources. |

### GetData

Retrieves a copy of the binary data in the [Stream](https://learn.microsoft.com/dotnet/api/system.io.stream) used by the decoder to decode the data.

<div class="api-signature" data-lang="csharp">

```csharp
public byte[] GetData()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function GetData() As Byte()
```

</div>

**Returns**

[Byte](https://learn.microsoft.com/dotnet/api/system.byte)[]

An array of [byte](https://learn.microsoft.com/dotnet/api/system.byte) values with the data the decoder uses for decoding.

**Remarks**

In case there [GetStream](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#getstream) is used as well and the [Stream](https://learn.microsoft.com/dotnet/api/system.io.stream) instance is modified, the array offered by [GetData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#getdata) is modified as well.

### GetStackTrace

Retrieves an instance which summarizes the stack within the decoder until the failure has been produced. The [OpcEncodingStackTrace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingstacktrace/) returned contains [OpcEncodingStackFrame](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingstackframe/) entries only in case there [IsEnabled](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingstacktrace/members#isenabled) is equals true (this influences the overall performance while encoding / decoding).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEncodingStackTrace GetStackTrace()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function GetStackTrace() As OpcEncodingStackTrace
```

</div>

**Returns**

[OpcEncodingStackTrace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingstacktrace/)

An instance of the [OpcEncodingStackTrace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingstacktrace/) class which summarizes the stack within the decode until the failure has been produced. The instance returned provides an empty stack trace if [IsEnabled](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingstacktrace/members#isenabled) is equals false (the default value).

### GetStream

Retrieves a copy of the [Stream](https://learn.microsoft.com/dotnet/api/system.io.stream) used by the decoder to decode the data.

<div class="api-signature" data-lang="csharp">

```csharp
public Stream GetStream()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function GetStream() As Stream
```

</div>

**Returns**

[Stream](https://learn.microsoft.com/dotnet/api/system.io.stream)

An instance of the [Stream](https://learn.microsoft.com/dotnet/api/system.io.stream) which represents a copy of the [Stream](https://learn.microsoft.com/dotnet/api/system.io.stream) used by the decoder to decode the data.

**Remarks**

The [Stream](https://learn.microsoft.com/dotnet/api/system.io.stream) provided allows reading, writing and seeking; but modifying or disposing the instance will influcence the instance provided by subsequent calls to [GetStream](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#getstream) of the current [OpcTypeDecodingFailedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/).

### ToString

<span class="api-meta">override</span>

Returns a [string](https://learn.microsoft.com/dotnet/api/system.string) representing the [Message](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#message) or the [Message](https://learn.microsoft.com/dotnet/api/system.exception.message) of the [Exception](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#exception) of the current [OpcTypeDecodingFailedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/).

<div class="api-signature" data-lang="csharp">

```csharp
public override string ToString()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Overrides Function ToString() As String
```

</div>

**Returns**

[String](https://learn.microsoft.com/dotnet/api/system.string)

A [string](https://learn.microsoft.com/dotnet/api/system.string) representing the [Message](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#message) or the [Message](https://learn.microsoft.com/dotnet/api/system.exception.message) of the [Exception](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/members#exception) of the current [OpcTypeDecodingFailedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypedecodingfailedeventargs/).

**Overrides**

[ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)
