# XmlErrorEventArgs.Reason Property

> Gets the reason for the error.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > XmlErrorEventArgs.Reason Property
- **299 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/reason-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/reason-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/reason-property/llms-full.txt

---

### Description

Gets the reason for the error.

### Syntax

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

```vbnet
Public ReadOnly Property Reason As String
```

### Examples

The following example uses `XmlErrorEventArgs.Reason` while handling `XmlNotWellFormed`.

```csharp
textControl.XmlNotWellFormed += (_, e) =>
{
    Console.WriteLine($"Reason: {e.Reason}");
};
```

```vbnet
AddHandler textControl.XmlNotWellFormed,
    Sub(sender, e)
        Console.WriteLine($"Reason: {e.Reason}")
    End Sub
```

### Limitations

Read only.

---

## Nearby

- **Previous:** [XmlErrorEventArgs.LinePosition Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/lineposition-property/llms-full.txt)
- **Next:** [XmlErrorEventArgs.URL Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/url-property/llms-full.txt)
