Skip to content
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
70147ec
Sentry.Samples.Android
jamescrosswell Dec 1, 2025
de0dd5f
Sentry.Samples.GenericHost
jamescrosswell Dec 2, 2025
3e928ae
Sentry.Samples.Ios
jamescrosswell Dec 2, 2025
d5f67da
Sentry.Samples.MacCatalyst
jamescrosswell Dec 2, 2025
9c66c76
Sentry.Samples.MacOS
jamescrosswell Dec 2, 2025
807bdf1
Sentry.Samples.Maui
jamescrosswell Dec 2, 2025
3271051
Sentry.Samples.ME.Logging
jamescrosswell Dec 2, 2025
3f650f1
Sentry.Samples.OpenTelemetry.AzureFunctions
jamescrosswell Dec 2, 2025
a9062c0
update WASM sample
Flash0ver Dec 2, 2025
73914a6
update Mac Catalyst sample
Flash0ver Dec 2, 2025
1e8c46e
Install workloads for test app
jamescrosswell Dec 2, 2025
db7e45f
Merge remote-tracking branch 'origin/update-sample-tfms' into update-…
jamescrosswell Dec 2, 2025
62cd06a
.
jamescrosswell Dec 2, 2025
d591f4d
Merge branch 'main' into update-sample-tfms
jamescrosswell Dec 2, 2025
9148ca9
Merge branch 'main' into update-sample-tfms
Flash0ver Dec 4, 2025
a6a1f06
disable Blazor WebAssembly ahead-of-time compilation
Flash0ver Dec 4, 2025
ea3ffe8
... and comment why
Flash0ver Dec 4, 2025
53cb7d9
... and update WASM DSN
Flash0ver Dec 4, 2025
395a8d2
Updated for consistency with mobile samples
jamescrosswell Dec 4, 2025
c065213
fix pragma
jamescrosswell Dec 4, 2025
1d62bc8
Merge remote-tracking branch 'origin/main' into update-sample-tfms
jamescrosswell Dec 5, 2025
6722643
Testing something insane...
jamescrosswell Dec 8, 2025
0533bae
Format code
getsentry-bot Dec 8, 2025
8004d7e
Revert "Testing something insane..."
jamescrosswell Dec 8, 2025
3931889
Update samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Program.cs
jamescrosswell Dec 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/actions/environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0-android35.0</TargetFramework>
<TargetFramework>net10.0-android36.0</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
Expand Down
8 changes: 2 additions & 6 deletions samples/Sentry.Samples.AspNetCore.Blazor.Wasm/App.razor
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<Router AppAssembly="@typeof(Program).Assembly">
<Router AppAssembly="@typeof(App).Assembly" NotFoundPage="typeof(Pages.NotFound)">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing @ prefix in Razor attribute expression

The NotFoundPage attribute value is missing the @ prefix for the C# expression. The value typeof(Pages.NotFound) is being treated as a string literal instead of a type expression. Compare with AppAssembly="@typeof(App).Assembly" and DefaultLayout="@typeof(MainLayout)" on the same component which correctly use the @ prefix. This will cause the Router to not properly recognize the NotFound page type.

Fix in Cursor Fix in Web

<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
Original file line number Diff line number Diff line change
Expand Up @@ -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!;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@page "/not-found"
@layout MainLayout

<h3>Not Found</h3>
<p>Sorry, the content you are looking for does not exist.</p>
Original file line number Diff line number Diff line change
Expand Up @@ -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!;
}
}
10 changes: 6 additions & 4 deletions samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Sentry.Samples.AspNetCore.Blazor.Wasm;

Expand All @@ -6,21 +7,22 @@
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.
#if SENTRY_DSN_DEFINED_IN_ENV
// A DSN is required. You can set here in code. Web browsers cannot read environment variables.
// See https://docs.sentry.io/product/sentry-basics/dsn-explainer/
options.Dsn = SamplesShared.Dsn;
options.Dsn = EnvironmentVariables.Dsn;
#endif
options.Debug = true;
});

builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("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();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<RunAOTCompilation>true</RunAOTCompilation>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
<!--<RunAOTCompilation>true</RunAOTCompilation>--><!--see https://github.com/dotnet/runtime/issues/121975-->
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
Expand All @@ -15,8 +18,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.8"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.8" PrivateAssets="all"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.0"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.0" PrivateAssets="all"/>
<ProjectReference Include="..\..\src\Sentry.AspNetCore.Blazor.WebAssembly\Sentry.AspNetCore.Blazor.WebAssembly.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<NavMenu />
</div>

<div>
@Body
</div>
<main>
<article class="content">
@Body
</article>
</main>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
134 changes: 111 additions & 23 deletions samples/Sentry.Samples.AspNetCore.Blazor.Wasm/wwwroot/app.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* styles all <a> tags within <nav> tags */
html, body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

nav {
width: 100%;
background-color: #7428d2;
Expand All @@ -11,37 +14,122 @@ nav a {
font-family: sans-serif;
padding: 1.0em;
border-style: none;
display: inline-block; /* makes the links align horizontally */
display: inline-block;
}

/* styles for hovered <a> tags within <nav> tags */
nav a:hover {
background-color: #d37e05;
color: #f0f0f0;
}

button {
h1:focus {
outline: none;
}

a, .btn-link {
color: #0071c1;
}

.btn-primary {
color: #fff;
background-color: #cf7209;
display: inline-block;
font-weight: 400;
background-color: #1b6ec2;
border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
outline: 1px solid #26b050;
}

.invalid {
outline: 1px solid red;
}

.validation-message {
color: red;
}

#blazor-error-ui {
color-scheme: light only;
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
box-sizing: border-box;
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}

#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}

.blazor-error-boundary {
background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzM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2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
padding: 1rem 1rem 1rem 3.7rem;
color: white;
}

.blazor-error-boundary::after {
content: "An error has occurred."
}

.loading-progress {
position: absolute;
display: block;
width: 8rem;
height: 8rem;
inset: 20vh 0 auto 0;
margin: 0 auto 0 auto;
}

.loading-progress circle {
fill: none;
stroke: #e0e0e0;
stroke-width: 0.6rem;
transform-origin: 50% 50%;
transform: rotate(-90deg);
}

.loading-progress circle:last-child {
stroke: #1b6ec2;
stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
position: absolute;
text-align: center;
vertical-align: middle;
cursor: pointer;
user-select: none;
padding: .375rem .75rem;
font-size: 1rem;
line-height: 1.5;
border: 1px solid transparent;
border-radius: .25rem;
transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

button:hover {
color: #fff;
background-color: #d37e05;
font-weight: bold;
inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
content: var(--blazor-load-percentage-text, "Loading");
}

code {
color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
color: var(--bs-secondary-color);
text-align: end;
}

button:focus {
box-shadow: 0 0 0 0.2rem rgba(241, 185, 144, 0.5);
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
text-align: start;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 23 additions & 13 deletions samples/Sentry.Samples.AspNetCore.Blazor.Wasm/wwwroot/index.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
<!DOCTYPE html>
<html>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>BlazorApp1</title>
<link href="app.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sentry.Samples.AspNetCore.Blazor.Wasm</title>
<base href="/" />
<link rel="preload" id="webassembly" />
<link rel="stylesheet" href="app.css" />
<link rel="icon" type="image/png" href="favicon.png" />
<link href="Sentry.Samples.AspNetCore.Blazor.Wasm.styles.css" rel="stylesheet" />
<script type="importmap"></script>
</head>

<body>
<div id="app">Loading...</div>
<div id="app">
<svg class="loading-progress">
<circle r="40%" cx="50%" cy="50%" />
<circle r="40%" cx="50%" cy="50%" />
</svg>
<div class="loading-progress-text"></div>
</div>

<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>

<script src="_framework/blazor.webassembly.js"></script>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="." class="reload">Reload</a>
<span class="dismiss">🗙</span>
</div>
<script src="_framework/blazor.webassembly#[.{fingerprint}].js"></script>
</body>

</html>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion samples/Sentry.Samples.Ios/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public override UIWindow? Window
set;
}

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
public override bool FinishedLaunching(UIApplication application, NSDictionary? launchOptions)
{
// Init the Sentry SDK
SentrySdk.Init(options =>
Expand Down Expand Up @@ -55,8 +55,10 @@ public override bool FinishedLaunching(UIApplication application, NSDictionary l
};
});

#pragma warning disable CA1422 // Validate platform compatibility
// create a new window instance based on the screen size
Window = new UIWindow(UIScreen.MainScreen.Bounds);
#pragma warning restore CA1416

// determine control colours (SystemBackground requires iOS >= 13.0)
var backgroundColor = UIDevice.CurrentDevice.CheckSystemVersion(13, 0)
Expand Down
4 changes: 2 additions & 2 deletions samples/Sentry.Samples.Ios/Sentry.Samples.Ios.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0-ios18.0</TargetFramework>
<TargetPlatformVersion>18</TargetPlatformVersion>
<TargetFramework>net10.0-ios26.0</TargetFramework>
<TargetPlatformVersion>26</TargetPlatformVersion>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
Expand Down
Loading
Loading