Confused about adding a custom property to reporting
![billg1955](https://us.v-cdn.net/6029854/uploads/defaultavatar/nZUSABQN8JEE0.jpg)
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?
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
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?