v3.0 (WebService)
Breaking Changes
There is one main breaking change we couldn't avoid:
- the Enum
ExceptionReportInfo.MailMethod- changes to
ReportSendMethod SendMethod { get; set; } = ReportSendMethod.None;
This was necessary due to the addition of the WebService option.
NB the enum now has a default of None so even if you didn't use this, you might need to set it to SimpleMAPI if you relied on the previous enum default
It also fixes the annoying fact that the old enum was inside the ExceptionReporterInfo class requiring EmailMethod = ExceptionReporterInfo.SimpleMAPI
The only other breaking changes are for users who explicitly used the class ExceptionReportGenerator:
ExceptionReportGeneratorhas been renamed to justReportGeneratorand the public methodCreateExceptionReport()has been renamed to justGenerate()- the old method has been set as[Obsolete]to help with refactoring- The method
ExceptionReportGenerator.SendReportByEmail()is removed - and replaced byExeptionReporter.Send() IEmailSendEventchanges toIReportSendEvent(though it's unlikely anyone used this) - this is the event that can be implemented and passed to theSend()method to receive the complete/error events on the calling thread
New Features
Send to WebService - issue #8
- A JSON HTTP "POST" is sent to the new URL configuration property
WebServiceUrl - The JSON properties are determined by a new
DataContractclass namedReportPacket- consisting of
{
"AppName" : "my app",
"AppVersion": "1.0.1",
"ExceptionMessage" : "a message",
"ExceptionReport" : "report here..."
}
- There is also configuration for a timeout
WebServiceTimeout- which defaults to 15 seconds - The requirements for the WebService are illustrated by the new .NET Core project in the solution called
WebService.ExceptionReporter- which is fully functioning and consumes reports sent to it by ExceptionReporter - Configuration to setup the new WebService option is:
exceptionReporter.Config.SendMethod = ReportSendMethod.WebService; exceptionReporter.Config.WebServiceUrl = "http://localhost:24513/api/er";
Silent Sending of Reports - issue #21
- A report could already be sent silently by using the class
ExceptionReportGenerator... However it is now condensed and combined with WebService option into a new method on theExceptionReporterclass:
public void Send(params Exception[] exceptions)
which sits aside the similar existing method:
public void Show(params Exception[] exceptions)
Sendwill use the configuredReportSendMethod(ie SMTP/WebService)
New configuration ExceptionDateKind
Whether to report the date/time of the exception in local time or Coordinated Universal Time (UTC)
public DateTimeKind ExceptionDateKind { get; set; } = DateTimeKind.Utc;
New configuration UseDefaultCredentials
This allows an SMTP email to be sent with the credentials of the logged in user
New configuration SmtpMailPriority
Sets the equivalent property on SmtpClient sender: MailPriority
Fixes
Cater for ClickOnce when retrieving AppVersion
The population of the AppVersion property now checks to see if the app is a ClickOnce application, and if so, retrieves the published version
SMTP Port now defaults to port 25 (not 0) if not set
Just frees the user from having to set the port if the default is required - technically we just don't set the port and the SmtpClient class uses it's own knowledge of the default port.
Less Detailed Mode issues fixed - issue #24
Fixed the Less Detail mode able to be resized (because there is a dialog underneath and it doesn't really work) Also some odd pixels were showing through (bottom left) was fixed as well (positioning)
API Changes (backward compatible)
ExceptionReportInfo and classes exposed to users move from namespace ExceptionReporting.Core into ExceptionReporting
This won't break any code of itself, because the latter namespace is already required for ExceptionReporter class.
The Using statement using ExceptionReporting.Core; can be deleted from all user code (ie it was an accident that using ExceptionReporter required the importing/using of 2 separate namespaces)
Anything set as [Obsolete] will be removed in the next major release - v4.0 - in keeping with SemVer principles.