Uses the .NET SDK (dotnet CLI). Key files:
Sentry.slnx— full solution (all platforms/samples)... rarely used directlyglobal.json— pins .NET SDK and Workload versionsDirectory.Build.props/Directory.Build.targets— shared MSBuild properties across all projects
Use solution filters instead of the full Sentry.slnx:
| Filter | Use when |
|---|---|
SentryNoMobile.slnf |
General development (no Android/iOS build toolchain needed for quicker builds) |
Sentry-CI-Build-macOS.slnf |
All macOS projects |
Sentry-CI-Build-Windows.slnf |
All Windows projects |
Sentry-CI-Build-Linux.slnf |
All Linux projects |
Do not edit
*.slnffiles directly. They are generated byscripts/generate-solution-filters.ps1fromscripts/generate-solution-filters-config.yml.
# Full build (operating system specific - run one only)
dotnet build Sentry-CI-Build-macOS.slnf
# Quick build (no mobile targets)
dotnet build SentryNoMobile.slnf
# Build a specific project
dotnet build src/Sentry/Sentry.csproj
# Run all tests
dotnet test Sentry-CI-Build-macOS.slnf
# Run all tests (non-mobile)
dotnet test SentryNoMobile.slnf
# Run tests for a specific project
dotnet test test/Sentry.Tests/Sentry.Tests.csproj
# Run a single test by name
dotnet test test/Sentry.Tests/ --filter "FullyQualifiedName~CaptureEvent_"
# Run android device tests (Android emulator must be running)
pwsh scripts/device-test.ps1 android
# Run ios device tests (iOS simulator must be running)
pwsh scripts/device-test.ps1 ios
# Format code
dotnet format Sentry.slnx --no-restore --exclude ./modules --exclude ./**/*OptionsSetup.cs --exclude ./test/Sentry.Tests/AttributeReaderTests.cssrc/ # Source for all Sentry packages
test/ # Test projects (mirror src/ naming: Sentry.X.Tests)
samples/ # Sample applications
benchmarks/ # Performance benchmarks
integration-test/ # Pester-based integration tests (CLI, AOT, runtime, etc.)
modules/ # Native SDK submodules (sentry-native, Ben.Demystifier, etc.)
scripts/ # Build and maintenance scripts
- Use
SentryNoMobile.slnf— no extra toolchain needed. - Targets:
net9.0,net10.0,netstandard2.0,netstandard2.1,net462.
- Requires
JAVA_HOMEset and Java installed. - Built on all platforms (Linux, macOS, Windows).
Sentry.Bindings.Androidwraps the native Android SDK.
- macOS only. Requires Xcode.
Sentry.Bindings.Cocoawraps the native Cocoa SDK.- Device tests run in CI only.
- Requires MAUI workloads:
sudo dotnet workload restore(macOS/Linux) ordotnet workload restore(Windows). - Combine mobile toolchain requirements above.
Sentry.AspNetCore.Blazor.WebAssembly.PlaywrightTestsuses Playwright — seeplaywright-blazor-wasm.ymlfor CI setup.
- Separate CI pipeline (
alpine.yml). Do not attempt Alpine-specific builds outside that environment.
- Framework: xUnit
- Mocking: nsubstitute
- Test project naming:
<SourceProjectName>.Tests(e.g.Sentry.AspNetCore.Tests) - Test naming convention:
Method_Context_Expectation(e.g.,CaptureEvent_ActiveScope_AppliesScopeData) - Snapshot tests use Verify — commit updated
*.verified.*files when API surface changes - Device tests (
Sentry.Maui.Device.TestApp,AndroidTestApp); requires a connected emulator to run locally - Integration tests in
integration-test/use Pester (PowerShell) — require a local nuget pack or CI-built packages
dotnet test
pwsh ./scripts/accept-verifier-changes.ps1
# Repeat if needed — dotnet test stops after N failuresPublic API diffs are stored as Verify snapshot files. After any public API change:
- Run tests locally — they will fail with a diff
- Accept the diff:
pwsh ./scripts/accept-verifier-changes.ps1 - Commit the updated
*.verified.*snapshot files
- If the change is not user-facing, add
#skip-changelogto the PR description - Otherwise generated automatically from Commit message conventions
# Get PR number for current branch
gh pr view --json number -q '.number'- New features must be opt-in — extend
SentryOptionsor relevant options class with getters/setters - Maintain backwards compatibility — avoid breaking public API without strong justification
- Platform-specific code lives in
src/Sentry/Platforms/and is conditionally compiled
AI commits MUST include:
Co-Authored-By: <Agent Name> <agent-email-or-noreply@example.com>