Skip to content

ASP.NET Core - be able to use Bugsnag in singleton services and static contexts #130

Open
@LoremFooBar

Description

@LoremFooBar

Description

I would like to add Bugsnag to a reverse proxy project (.NET Core 3.1). Since this is not a classic MVC/WebAPI project, there are no controllers, and most of the code runs in a static context. The Bugsnag.AspNet.Core package adds the Bugsnag client as scoped service, which makes it difficult to use in static contexts (from singleton services for example).

Describe the solution you'd like

Be able to register Bugsnag client as singleton service and use IHttpContextAccessor to access request information where needed.

Describe alternatives you've considered

  1. Manually setup Bugsnag without the Bugsnag.AspNet.Core package - not great for me because I would like Bugsnag integration to be as easy as possible in all of our projects.
  2. Create and publish my own package - this will probably be my temporary solution, eventually I would be happy to contribute my work back to this project.

Update - I created a package where the only change is adding Bugsnag.IClient as a singleton instead of a scoped service, and looks like everything just works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogWe hope to fix this feature/bug in the futurefeature requestRequest for a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions