Affected user not showing in .Net MVC

Andreas

Posted on
Nov 28 2015

Hi.

User data will not show on error detail page. I look at the Raw data tab, and no user data is there. In an event handler function for SendingMessage I set both ApplicationVersion and User with code below. ApplicationVersion is shown, but User is not. Am I missing something?

e.Message.Details.Version = "a.b.c.d";

((RaygunClient)sender).User = "test-user";


Jason Fauchelle

Raygun

Posted on
Nov 30 2015

Hi Andreas,

Thanks for contacting us, and apologies for the trouble here. To get this working, you'll want to set the user information directly on e.Message.Details.User.FirstName etc, just like how you're setting the version.

The SendingMessage event handler gets called just before the message is serialized and sent to Raygun. This is after the RaygunClient has done anything it needs to do to build the message - such as using the User or UserInfo property to set that information into the message. Think of the SendingMessage handler as a final place for you to tweak the message, or cancel them, which the RaygunClient will not interfere with.

I'd also like to point out that another approach for setting the version and user info would be to set the ApplicationVersion and either the User or UserInfo properties of the RaygunClient outside the SendingMessage handler. In an MVC app/site, you'd do this by creating your own RaygunClient instance that you can set options on, and then make that available to the Raygun http module for it to use to send messages. https://raygun.io/docs/languages/net/asp

I hope that helps explain it better. Please let me know if you have any further questions about Raygun4Net and I'll help you out.

-Jason Fauchelle


Reply