Getting started with Attaching files to error reports
Leigh Wardle
Posts: 6 Bronze 1
Hi Team:
I have studied the documentation article Attaching files to error reports.
Sorry if I have missed this in the documentation, but what code do I need to trigger the code that would start with "Save the file(s) in a temporary location."?
Regards,
Leigh
I have studied the documentation article Attaching files to error reports.
Sorry if I have missed this in the documentation, but what code do I need to trigger the code that would start with "Save the file(s) in a temporary location."?
Regards,
Leigh
Comments
I believe it is indicating that you need to programmatically save a file if you are creating one (as demonstrated in the next code segment on that page for attaching a screenshot - it creates a new screenshot and saves it to a temp location and then attaches it).
If you were going to attach an existing file you would want to copy it to a temp location (How to: Copy, Delete, and Move Files and Folders (C# Programming Guide)) and then attach it using the code provided.
Kind regards,
Alex
Have you visited our Help Center?
I've already responded to you via the support ticket, but I am putting the answer here for others on the forum:
When you build your project with Smart Assembly it wraps it in global error handling; all you should need to do is to override the OnReportException class as shown in the documentation and it will attach the file for you. If you need to have the user browse for a file you may need to make a custom error report UI with browse functionality. There are various examples that are installed with Smart Assembly located at C:Program FilesRed GateSmartAssembly 6SDK, you will want the Exception Reporting folder for several examples related to that.
Kind regards,
Alex
Have you visited our Help Center?