diff --git a/Mindscape.Raygun4Net4/RaygunClient.cs b/Mindscape.Raygun4Net4/RaygunClient.cs index 9db61847..c5356f31 100644 --- a/Mindscape.Raygun4Net4/RaygunClient.cs +++ b/Mindscape.Raygun4Net4/RaygunClient.cs @@ -440,6 +440,7 @@ private void StripAndSend(Exception exception, IList tags, IDictionary u { var requestMessage = BuildRequestMessage(); IList breadcrumbs = BuildBreadCrumbList(); + var contextId = GetContextId(); foreach (var e in StripWrapperExceptions(exception)) { @@ -447,6 +448,7 @@ private void StripAndSend(Exception exception, IList tags, IDictionary u { x.Details.Request = requestMessage; x.Details.Breadcrumbs = breadcrumbs; + x.Details.ContextId = contextId; })); } } @@ -455,6 +457,7 @@ private void StripAndSendInBackground(Exception exception, IList tags, I { var requestMessage = BuildRequestMessage(); IList breadcrumbs = BuildBreadCrumbList(); + var contextId = GetContextId(); foreach (var e in StripWrapperExceptions(exception)) { @@ -462,6 +465,7 @@ private void StripAndSendInBackground(Exception exception, IList tags, I { x.Details.Request = requestMessage; x.Details.Breadcrumbs = breadcrumbs; + x.Details.ContextId = contextId; })); } } @@ -600,7 +604,6 @@ protected RaygunMessage BuildMessage(Exception exception, IList tags, ID .SetVersion(ApplicationVersion) .SetTags(tags) .SetUserCustomData(userCustomData) - .SetContextId(GetContextId()) .SetUser(userInfoMessage ?? UserInfo ?? (!string.IsNullOrEmpty(User) ? new RaygunIdentifierMessage(User) : null)) .Customise(customise) .Build(); @@ -668,7 +671,7 @@ protected IEnumerable StripWrapperExceptions(Exception exception) } } - private static string GetContextId() + private string GetContextId() { return HttpContext.Current?.Session?.SessionID; }