Skip to content

ThrowVsThrowEx: retarget net10.0, add ExceptionDispatchInfo rethrow sample - #2126

Merged
vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/60043-difference-between-throw-vs-throwex-csharp
Aug 24, 2026
Merged

ThrowVsThrowEx: retarget net10.0, add ExceptionDispatchInfo rethrow sample#2126
vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/60043-difference-between-throw-vs-throwex-csharp

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Retargets exception-handling/ThrowVsThrowEx from net6.0 to net10.0 and adds a fourth NUnit test that rethrows a captured exception from outside the catch block using ExceptionDispatchInfo, showing that the original stack trace survives.

All four tests pass on SDK 10.0.302. The three existing hard-coded expected traces are untouched and still match (the project sets <DebugType>None</DebugType>, so the traces carry no file or line information).

…ample

Retargets the sample from net6.0 to net10.0 and adds a fourth NUnit test
showing how to rethrow a captured exception from outside the catch block
with ExceptionDispatchInfo, preserving the original stack trace.
@vladimir-pecanac-main
vladimir-pecanac-main merged commit 7eab8fc into CodeMazeBlog:main Aug 24, 2026
3 checks passed
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.

1 participant