diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index accfdf12ba..fb22cd31c7 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -109,7 +109,13 @@ runs: - name: Install .NET Workloads shell: bash run: | + set -euo pipefail pwd dotnet workload restore \ --temp-dir "${{ runner.temp }}" \ --skip-sign-check + dotnet workload restore test/AndroidTestApp/AndroidTestApp.csproj \ + --temp-dir "${{ runner.temp }}" \ + --skip-sign-check + # Restore the Android test app explicitly to ensure runtime packs are available + dotnet restore test/AndroidTestApp/AndroidTestApp.csproj -r android-x64 --nologo || true diff --git a/samples/Sentry.Samples.Android/Sentry.Samples.Android.csproj b/samples/Sentry.Samples.Android/Sentry.Samples.Android.csproj index a9eacd63be..c7e2e59664 100644 --- a/samples/Sentry.Samples.Android/Sentry.Samples.Android.csproj +++ b/samples/Sentry.Samples.Android/Sentry.Samples.Android.csproj @@ -1,6 +1,6 @@ - net9.0-android35.0 + net10.0-android36.0 21 Exe enable diff --git a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/App.razor b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/App.razor index 6f67a6ea61..57757a2952 100644 --- a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/App.razor +++ b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/App.razor @@ -1,10 +1,6 @@ - + + - - -

Sorry, there's nothing at this address.

-
-
diff --git a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Pages/Catcher.razor b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Pages/Catcher.razor index ee655def14..2c9711c18b 100644 --- a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Pages/Catcher.razor +++ b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Pages/Catcher.razor @@ -29,6 +29,6 @@ private static class OtherStuffThrower { public static void DoSomething() => Thrower(); - private static void Thrower() => throw null; + private static void Thrower() => throw null!; } } diff --git a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Pages/NotFound.razor b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Pages/NotFound.razor new file mode 100644 index 0000000000..091b6b8bc5 --- /dev/null +++ b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Pages/NotFound.razor @@ -0,0 +1,5 @@ +@page "/not-found" +@layout MainLayout + +

Not Found

+

Sorry, the content you are looking for does not exist.

diff --git a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Pages/Thrower.razor b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Pages/Thrower.razor index a31da9150f..bcf18a6511 100644 --- a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Pages/Thrower.razor +++ b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Pages/Thrower.razor @@ -30,6 +30,6 @@ private static class StuffThrower { public static void DoSomething() => Thrower(); - private static void Thrower() => throw null; + private static void Thrower() => throw null!; } } diff --git a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Program.cs b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Program.cs index 77092780bd..a66e46099c 100644 --- a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Program.cs +++ b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Program.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Sentry.Samples.AspNetCore.Blazor.Wasm; @@ -7,20 +8,28 @@ 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. + // You must specify a DSN. On browser platforms, this should be done in code here. // See https://docs.sentry.io/product/sentry-basics/dsn-explainer/ options.Dsn = SamplesShared.Dsn; +#else + // To make things easier for the SDK maintainers we have a custom build target that writes the + // SENTRY_DSN environment variable into an EnvironmentVariables class that is available for WASM + // targets. This allows us to share one DSN defined in the ENV across desktop and mobile samples. + // Generally, you won't want to do this in your own WASM applications - you should set the DSN + // in code as above + options.Dsn = EnvironmentVariables.Dsn; #endif options.Debug = true; }); builder.RootComponents.Add("#app"); + builder.RootComponents.Add("head::after"); builder.Logging.SetMinimumLevel(LogLevel.Debug); builder.Services.AddScoped(_ => new HttpClient { - BaseAddress = new(builder.HostEnvironment.BaseAddress) + BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); await builder.Build().RunAsync(); } diff --git a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Properties/launchSettings.json b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Properties/launchSettings.json index 9d30e4b522..fcd43ff6d7 100644 --- a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Properties/launchSettings.json +++ b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Properties/launchSettings.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/launchsettings.json", "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, @@ -18,7 +19,7 @@ }, "Sentry.Samples.AspNetCore.Blazor.Wasm": { "commandName": "Project", - "dotnetRunMessages": "true", + "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "applicationUrl": "https://localhost:5001;http://localhost:5000", diff --git a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Sentry.Samples.AspNetCore.Blazor.Wasm.csproj b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Sentry.Samples.AspNetCore.Blazor.Wasm.csproj index 22d6f53b09..43a4f7a35d 100644 --- a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Sentry.Samples.AspNetCore.Blazor.Wasm.csproj +++ b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Sentry.Samples.AspNetCore.Blazor.Wasm.csproj @@ -1,8 +1,11 @@  - net9.0 - true + net10.0 + enable + enable + true + @@ -15,8 +18,9 @@ - - + + + diff --git a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Shared/MainLayout.razor b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Shared/MainLayout.razor index 1dc46026d8..89abb56df1 100644 --- a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Shared/MainLayout.razor +++ b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Shared/MainLayout.razor @@ -5,7 +5,9 @@ -
- @Body -
+
+
+ @Body +
+
diff --git a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/_Imports.razor b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/_Imports.razor index 5ec42db600..6183979d81 100644 --- a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/_Imports.razor +++ b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/_Imports.razor @@ -3,6 +3,7 @@ @using Microsoft.AspNetCore.Components.Forms @using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Components.Web.Virtualization @using Microsoft.AspNetCore.Components.WebAssembly.Http @using Microsoft.JSInterop @using Sentry.Samples.AspNetCore.Blazor.Wasm diff --git a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/wwwroot/app.css b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/wwwroot/app.css index a0435feb7f..690ad2303b 100644 --- a/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/wwwroot/app.css +++ b/samples/Sentry.Samples.AspNetCore.Blazor.Wasm/wwwroot/app.css @@ -1,4 +1,7 @@ -/* styles all tags within