Add extensions for IHostBuilder
See original GitHub issueThe current implementation for MS’s DI is for IWebHostBuilder
, but given the new Generic Hosts, I think more and more will use the IHostBuilder
builder.
Please add a .UseSentry()
for IHostBuilder
. 😃
Issue Analytics
- State:
- Created 4 years ago
- Reactions:16
- Comments:29 (16 by maintainers)
Top Results From Across the Web
How to create an IHostBuilder extension?
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureAppConfiguration((context, config) => { ...
Read more >IHostBuilder Interface (Microsoft.Extensions.Hosting)
Extension Methods ; ConfigureHostOptions(IHostBuilder, Action<HostBuilderContext,HostOptions>). Adds a delegate for configuring the HostOptions of the IHost.
Read more >How to add add Microsoft extensions hosting manually in . ...
How to add add Microsoft extensions hosting manually in . ... Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.
Read more >The ASP.NET Core Generic Host: namespace clashes and ...
This extension method sets up the default configuration providers and logging providers for your app. The UseStartup<T>() extension sets the ...
Read more >NServiceBus.Extensions.Hosting
Place UseNServiceBus() on the host builder before registering any hosted service (e.g. services.AddHostedService< ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m migrating a console app over to the new generic host and in order to use
appsettings.json
for my config with theILoggingBuilder.AddSentry()
method I needed to adjust my setup like so:To make this more reusable I’ve added a helper function:
And then I use it just like the asp.net core integration:
Yes. I picked this up again a couple of weeks ago, starting with reviving #1015. There’s a lot of work still to do, and I’m not sure exactly when it will be completed, but I will update this issue when it’s ready.
In the meantime, you can use the current release as follows:
When using ASP.NET Core with the Web Host:
When using ASP.NET Core with the Generic Host:
When using the Generic Host without ASP.NET Core:
The first two require
Sentry.AspNetCore
, but you only needSentry.Extensions.Logging
for the last one.