Skip to content

feat: support .NET 10 / PowerShell 7.6 (bump sentry-dotnet to 6.5.0) - #133

Merged
jamescrosswell merged 4 commits into
mainfrom
feat/dotnet10-pwsh76
May 28, 2026
Merged

jamescrosswell merged 4 commits into
mainfrom
feat/dotnet10-pwsh76

Conversation

@jamescrosswell

@jamescrosswell jamescrosswell commented May 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds .NET 10 / PowerShell 7.6 support by bumping the bundled sentry-dotnet assembly from 5.16.1 to 6.5.0 and wiring Get-SentryAssembliesDirectory to pick net10.0 on pwsh ≥ 7.6.

  • dependencies/Sentry.properties → 6.5.0
  • dependencies/download.ps1 → adds a net10.0 Download line
  • Get-SentryAssembliesDirectory.ps1 → adds a 7.6 → net10.0 branch (and a comment-block entry)

Motivation

5.x tops out at net9.0, so on PowerShell 7.6 (which runs on .NET 10) the module currently loads the net9.0 Sentry assembly into a .NET 10 runtime — producing CS1701 warnings and, on some hosts, a fatal Add-Type failure.

Breaking-change audit (5.16.1 → 6.5.0)

Grepped the module / samples / tests for every breaking change in the 6.0.0 changelog. Only three sites needed fixing — all in tests/samples, no public PowerShell surface changed:

  1. SentrySdk.CaptureUserFeedback removed. tests/out-sentry.tests.ps1 now uses CaptureFeedback(message, contactEmail, name, replayId, url, associatedEventId) and asserts on the new feedback envelope-item shape (SentryEvent with Contexts.Feedback) instead of the legacy user_report payload.
  2. SentryOptions.Experimental.{EnableLogs,SetBeforeSendLog} graduated to stable. tests/write-sentrylog.tests.ps1 and samples/send-logs.ps1 now call $_.EnableLogs / $_.SetBeforeSendLog(...) directly. This is the only user-visible behavior change in this PR — documented under "Breaking changes" in the changelog.
  3. SentryLog.Template is now null when no parameters are supplied (the raw string moves to Message). Adjusted the one assertion that relied on the old behavior.

No usages found for the other 6.0 breaking changes (BreadcrumbLevel.Critical, ScopeExtensions.Populate, MAUI / UWP / Azure Functions surfaces, etc.).

Verification

  • pwsh ./dependencies/download.ps1 regenerates modules/Sentry/lib/{net8.0,net9.0,net10.0,net462} at 6.5.0
  • Module imports cleanly on pwsh 7.6.1 with no CS1701 warnings (previously emitted 5 per import)

Closes #125

🤖 Generated with Claude Code

jamescrosswell and others added 2 commits May 27, 2026 19:59
- Bumps `dependencies/Sentry.properties` from 5.16.1 to 6.5.0
- Adds a `net10.0` download entry to `dependencies/download.ps1`
- Routes PowerShell 7.6+ to the `net10.0` Sentry assembly in `Get-SentryAssembliesDirectory`

Sentry Logs APIs are no longer experimental in sentry-dotnet 6.x; updated
the sample and tests to call `$_.EnableLogs` / `$_.SetBeforeSendLog(...)`
directly on `SentryOptions`. The `CaptureUserFeedback` API was also removed
in 6.x; the corresponding test now uses `CaptureFeedback` and asserts on
the new `feedback` envelope item shape (a `SentryEvent` with
`Contexts.Feedback`).

Closes #125

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

github-actions Bot commented May 27, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against e294841

Comment thread modules/Sentry/private/Get-SentryAssembliesDirectory.ps1
jamescrosswell and others added 2 commits May 28, 2026 11:28
…h 7.6 explicitly

Windows PowerShell 5.1 (net462) was failing to resolve [Sentry.SentryOptions]
because Sentry 6.x's net462 build references System.Text.Json 8.x types while
we were still flattening v6.0.10 into the module's lib/net462 folder. Bump the
affected transitive packages to versions that match the Sentry 6.5.0 nuspec:

- System.Text.Json: 6.0.10 -> 8.0.5
- Microsoft.Bcl.AsyncInterfaces: 6.0.0 -> 8.0.0
- System.Text.Encodings.Web: 6.0.0 -> 8.0.0
- Adds System.Runtime.InteropServices.RuntimeInformation 4.3.0 (new dep in 6.x)

Also add an explicit pwsh 7.6 target to the test matrix
(tests/test-pwsh-7.6.props + build.yml) per @vaind's review suggestion, so
.NET 10 compatibility is verified directly instead of relying on whatever
'latest' happens to point at.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
sentry-dotnet 6.5.0's net462 build (via System.Text.Json 8.0.5) binds
against System.Memory assembly 4.0.1.2; we were shipping 4.0.1.1 (package
4.5.4), which broke WinPS module load with:

    Could not load file or assembly 'System.Memory, Version=4.0.1.2'

Bumping the package to 4.5.5 ships the matching 4.0.1.2 assembly. This
also unblocks the three Windows integration tests that spawn powershell.exe
as a subprocess.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jamescrosswell

Copy link
Copy Markdown
Collaborator Author

For the net462 TFM Sentry 6.x references more recent versions of various assemblies. I had to bump some of the dependencies in sentry-powershell as well, to get it to build.

@jamescrosswell
jamescrosswell marked this pull request as ready for review May 28, 2026 00:04
@jamescrosswell
jamescrosswell merged commit 7c23d54 into main May 28, 2026
22 checks passed
@jamescrosswell
jamescrosswell deleted the feat/dotnet10-pwsh76 branch May 28, 2026 01:23
vaind added a commit that referenced this pull request Sep 7, 2026
Write-SentryLog (#131) and the move of its options off Experimental
(#133) both land in this same unreleased cycle, so no released version
ever exposed $_.Experimental.SetBeforeSendLog through the module. There
is nothing for a user upgrading from 0.4.0 to migrate.

Reaching past the module into the bundled SDK's options object was the
only way to touch it from 0.4.0, and the Dependencies entry for the
5.16.1 -> 6.10.0 bump already covers that surface.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
vaind added a commit that referenced this pull request Sep 7, 2026
#133 moved the Logs options off Experimental and updated the sample and
tests accordingly, so it shaped the logging surface users see. Its
attribution lived in the breaking-change entry that was just removed;
fold it into the feature entry rather than losing it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
vaind added a commit that referenced this pull request Sep 7, 2026
* chore: update dependencies/Sentry.properties to 6.10.0

* docs: Drop the Logs opt-in from the send-logs sample

sentry-dotnet 6.10.0 removed the EnableLogs gate on SentrySdk.Logger,
which is what Write-SentryLog calls. Setting $_.EnableLogs = $true no
longer has any bearing on whether Write-SentryLog emits, so the sample's
"opt in to Logs" guidance now teaches something untrue.

Verified against the bundled 6.10.0 assembly: a log envelope item reaches
the transport with EnableLogs both set and unset, where 6.5.0 emitted
only when it was set. No test covers the disabled path, which is why the
change was invisible to CI.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Configure Sentry client with DSN and debug mode

* docs: Fold the Logs opt-in note into the Write-SentryLog entry

Write-SentryLog and the SDK bump that removed the EnableLogs gate both
land in the same unreleased cycle, so describing the removal as its own
entry documents a change no released version ever exposed. Readers of the
next release only need to know the cmdlet exists, so reference #137 from
the entry that introduced it instead.

Drop the EnableLogs half of the breaking-changes entry for the same
reason: it directed readers to set $_.EnableLogs, which is no longer
required for Write-SentryLog to emit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: Drop the Experimental breaking-change entry

Write-SentryLog (#131) and the move of its options off Experimental
(#133) both land in this same unreleased cycle, so no released version
ever exposed $_.Experimental.SetBeforeSendLog through the module. There
is nothing for a user upgrading from 0.4.0 to migrate.

Reaching past the module into the bundled SDK's options object was the
only way to touch it from 0.4.0, and the Dependencies entry for the
5.16.1 -> 6.10.0 bump already covers that surface.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: Credit #133 on the Write-SentryLog entry

#133 moved the Logs options off Experimental and updated the sample and
tests accordingly, so it shaped the logging surface users see. Its
attribution lived in the breaking-change entry that was just removed;
fold it into the feature entry rather than losing it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: GitHub <noreply@github.com>
Co-authored-by: Ivan Dlugos <dlugos.ivan@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Ivan Dlugos <6349682+vaind@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump sentry-dotnet SDK to add .NET 10 / PowerShell 7.6 support

2 participants