Getting started with Attaching files to error reports

Leigh WardleLeigh Wardle Posts: 6 Bronze 1
edited March 3, 2015 3:45AM in SmartAssembly
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

Comments

  • Hi Leigh,

    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
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • Alex BAlex B Posts: 1,131 Diamond 4
    Hi Leigh,

    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
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
Sign In or Register to comment.