bugsnag/bugsnag-dotnet

2.0 Upgrade Issue (Unable to access WebAPI client outside of request lifecycle)

tynorton opened this issue · 2 comments

Related to #93 ...

We used to configure all our clients programtically in Global.asax.cs, but ran into issue with the 2.0 upgrade.

We used to be able to set config values, and delegates on the global client instance like so:

WebMVCClient.Config.XXX = xxx;
WebAPIClient.Config.XXX = xxx;

Now we have:

// NOTE: All config values are read-only now
Bugsnag.AspNet.Client.Current.XXX = xxx;

// Request is null ...
Request.Bugsnag().XXX = xxx;

Was not mentioned in the update docs.

@tynorton thanks for the feedback. I'm going to close this one as it is a duplicate of #93, feel free to let me know if you think this is not the case

Not a duplicate. Related.

The way you have Request.Bugsnag() implemented, there is no way to configure it from a global scope, even if the properties weren't read-only.