Options

Confused about adding a custom property to reporting

billg1955billg1955 Posts: 4
edited April 13, 2015 2:17PM in SmartAssembly
i am a little confused about adding a custom property to SmartAssembly Error Reporting.

I have the following property, CommonUser.CurrentUser.Name. This property is the name of the user currently logged into my application. When an error is reported, I would like the users name to be displayed in the Error Report. I don't want to change the UI that the user sees when the exception occurs. I don't need them to see this custom property. I just want it passed over automatically and behind the scenes when the exception is sent to us. How do I do this?

Comments

  • Options
    Jessica RJessica R Posts: 1,319 Rose Gold 4
    Hi Bill,

    I'm afraid that getting the local variables at the time of reporting isn't exactly supported. :/

    You may be able to use Reflection in the error reporting SDK code to get the value of CommonUser.CurrentUser.Name and then add it as a custom property in the report. However, if you've enabled obfuscation and/or pruning, those options could break the ability to use Reflection.

    Alternatively, you could also dump the username to a file and attach that file to the error report. The simplest way to get the username though is indeed to just add a textbox to the dialog box to allow the user to manually enter her/his username to include in the error report.

    Apologies there isn't an easier way to get the local variables!

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


Sign In or Register to comment.