Date: Thu, 28 Mar 2024 08:19:07 +0000 (GMT) Message-ID: <1520044550.375.1711613947396@ip-172-31-38-4.eu-west-1.compute.internal> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_374_1934566572.1711613947384" ------=_Part_374_1934566572.1711613947384 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The information on this page applies to SmartAssembly Professional only.=
You can attach a file (such as a log file o= r screenshot) to an error report.
The total size of the attached files must be less than 4MB.
To attach a log file:
Call AttachFile =
in your custom template, for example:
using= System; using System.IO; using SmartAssembly.SmartExceptionsCore; ... public class MyExceptionHandler : UnhandledExceptionHandler { protected override void OnReportException(ReportExceptionEventArgs e) { //Attaching the file e.AttachFile("File Description", tempFileName); //Calling the form (new ExceptionReportingForm(this, e)).ShowDialog(); } //Other methods for the class }
Using a custom template, you can attach a screensho= t to an error report. To do this:
Call AttachFile =
to add the screenshot to the error report, for example:
using= System; using System.Drawing; using System.Drawing.Imaging; using SmartAssembly.SmartExceptionsCore; ... public class MyExceptionHandler : UnhandledExceptionHandler { =09protected override void OnReportException(ReportExceptionEventArgs e) =09{ =09=09using (ExceptionReportingForm form =3D new ExceptionReportingForm(thi= s, e)) =09=09{ =09=09screenshotBitmap =3D new Bitmap(Screen.PrimaryScreen.Bounds.Width= , Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb); =09=09Graphics screenshotGraphics =3D Graphics.FromImage(screenshotBit= map); =09=09screenshotGraphics.CopyFromScreen(Screen.PrimaryScreen.Bounds.X,= Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, Cop= yPixelOperation.SourceCopy); =09=09screenshotGraphics.Dispose(); =09=09screenshotBitmap.Save(@"C:\temp\scr.png", System.Drawing.Imaging= .ImageFormat.Png); =09=09e.AttachFile("Screenshot", @"C:\temp\scr.png"); =09=09form.ShowDialog(); =09=09} =09} =09//Other methods for the class }
If a file is attached to the error report, a paperc= lip icon, , is displayed next= to it in the report list.
When you open the error report, the list of attache= d files is shown.
To save the attachment, right-click it and select <= strong class=3D"tcbold">Save File As...