I've seen how to integrate Sentry with a .Net web app and with a console app. But for a service worker, where the bootstrapping of the app is done with
IHost host = Host.CreateDefaultBuilder(args)
.UseWindowsService(...)
.ConfigureServices(...)
instead of
IHost host = Host.CreateHostBuilder(args)
.ConfigureWebHostDefaults(webBuilder=>
{
webBuilder.UseSentry();
webBuilder.UseStartup<Startup>();
});
I have tried using the Sentry.AspNetCore package and the Sentry package, and boostrapping Sentry with different methods, including .ConfigureWebHostDefaults but that leads to the service not working (I get this error: No application configured. Please specify an application via IWebHostBuilder.UseStartup, IWebHostBuilder.Configure, or specifying the startup assembly via StartupAssemblyKey in the web host configuration.)
I've seen also this question but the answer given is not a service worker anymore.
So the question is: how can I use Sentry in a Service Worker app (that will become a Windows Service) ?
Thanks.