Custom Properties
From RedGateWiki
C#
- protected override void OnReportException(ReportExceptionEventArgs e)
- {
- // Get the .NET Framework version
- string dotNetVersion = String.Format("v{0}.{1}.{2}", System.Environment.Version.Major,
- System.Environment.Version.Minor,
- System.Environment.Version.Build);
- // Add the Framework version to the exception report
- e.AddCustomProperty("FrameworkVersion", dotNetVersion);
- for (int i=0; i<3; i++)
- {
- if (e.SendReport()) break;
- }
- e.TryToContinue = true;
- }
VB
- Protected Overrides Sub OnReportException(e As ReportExceptionEventArgs)
- ' Get the .NET Framework version
- Dim dotNetVersion As String = [String].Format("v{0}.{1}.{2}", System.Environment.Version.Major, System.Environment.Version.Minor, System.Environment.Version.Build)
- ' Add the Framework version to the exception report
- e.AddCustomProperty("FrameworkVersion", dotNetVersion)
- For i As Integer = 0 To 2
- If e.SendReport() Then
- Exit For
- End If
- Next
- e.TryToContinue = True
- End Sub