-
-
Notifications
You must be signed in to change notification settings - Fork 230
Expand file tree
/
Copy pathProgram.cs
More file actions
32 lines (29 loc) · 910 Bytes
/
Program.cs
File metadata and controls
32 lines (29 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Sentry.Samples.AspNetCore.Blazor.Wasm;
try
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.UseSentry(options =>
{
#if !SENTRY_DSN_DEFINED_IN_ENV
// A DSN is required. You can set here in code, or you can set it in the SENTRY_DSN environment variable.
// See https://docs.sentry.io/product/sentry-basics/dsn-explainer/
options.Dsn = SamplesShared.Dsn;
#endif
options.Debug = true;
});
builder.RootComponents.Add<App>("#app");
builder.Logging.SetMinimumLevel(LogLevel.Debug);
builder.Services.AddScoped(_ =>
new HttpClient
{
BaseAddress = new(builder.HostEnvironment.BaseAddress)
});
await builder.Build().RunAsync();
}
catch (Exception e)
{
SentrySdk.CaptureException(e);
await SentrySdk.FlushAsync();
throw;
}