Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't configure programatically in MVC or WebApi #93

Open
ChadBurggraf opened this issue Apr 20, 2018 · 12 comments
Open

Can't configure programatically in MVC or WebApi #93

ChadBurggraf opened this issue Apr 20, 2018 · 12 comments
Labels
needs discussion Requires internal analysis/discussion

Comments

@ChadBurggraf
Copy link

All of the configuration sections' properties are read-only.

@martin308
Copy link
Contributor

@ChadBurggraf we did take a shortcut here to get this out, are you able to explain a bit more to me about how you would expect to use/configure the bugsnag client in this scenario? You can post in here or email me [email protected]. Thanks!

@ChadBurggraf
Copy link
Author

I would like to set the API key, release stage and app version at runtime. I would also like to dynamically disable/enable reporting at runtime, but I think that's possible through the middleware system.

@martin308
Copy link
Contributor

Would you be entirely configuring the client programmatically or would you also be using the web.config?

You can ignore reports using the middleware system. What would be the conditions that you would be using to disable/enable reporting?

@ChadBurggraf
Copy link
Author

I'm okay with doing either (a combination of programatically and web.config, or just programatically).

Yes, thank you, I did see that I can use the middleware system to disable reporting.

@tynorton
Copy link

I just tried upgrading our BugSnag libraries to 2.0 and ran smack into this as well.

We need to ability to set global configuration for the MVC/WebAPI clients programatically.

@martin308
Copy link
Contributor

@ChadBurggraf @tynorton thanks for letting us know that you want to use Bugsnag like this, we have added this to our backlog of things that we really want to add. I'll keep you up to date with our progress on it

@AndyMDoyle
Copy link

I've upgraded and hit the same issue too.

We dynamically set the app version at runtime based on the assembly version of our site; and the release stage depending on if the site is running in development, staging, or production.

@martin308
Copy link
Contributor

Hi everyone, unfortunately I don't have any progress to report on this issue at the moment.

The only work around I can suggest right now is to use the core Bugsnag nuget package only and take a look at the code in the other packages as it's quite minimal to see how it hooks into the ASP.NET lifecycle. I'll update this issue when I can jump back onto implementing this

@AndyMDoyle
Copy link

I have been playing with some ways of making this possible, and I hope you don't mind but I've submitted an example PR (#108) with what I've come up with to make this possible.

It may be rubbish. It may be completely unsuitable. But it's what I might for the time being to get around the configuration constraints in one of our web apps.

@tynorton
Copy link

tynorton commented Oct 4, 2018

Any update on this? It's been nearly half a year since this issue was reported.

@tynorton
Copy link

tynorton commented Dec 4, 2018

@martin308 - Any update on whether this item has made it out of your backlog yet?

@kfreestone
Copy link

I really need to be able to set at least the appVersion programmatically as well.

@mattdyoung mattdyoung added the needs discussion Requires internal analysis/discussion label Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion Requires internal analysis/discussion
Projects
None yet
Development

No branches or pull requests

6 participants