[release-notes] C# in .NET 11 Preview 5#10426
Draft
danroth27 wants to merge 2 commits into
Draft
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
BillWagner
reviewed
Jun 3, 2026
Comment on lines
+70
to
+82
| In this preview, projects that declare unions need the compiler support types available to the compilation: | ||
|
|
||
| ```csharp | ||
| namespace System.Runtime.CompilerServices; | ||
|
|
||
| [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false)] | ||
| public sealed class UnionAttribute : Attribute { } | ||
|
|
||
| public interface IUnion | ||
| { | ||
| object? Value { get; } | ||
| } | ||
| ``` |
Member
There was a problem hiding this comment.
Tagging @eiriktsarpalis
I had a notification that these types are now in the .NET 11 Preview 5 libraries, and projects no longer need to provide polyfills. Can you confirm or correct?
Related: Is System.Runtime.CompilerServices the correct namespace after API review (for both UnionAttribute and IUnion).
BillWagner
reviewed
Jun 3, 2026
Comment on lines
+35
to
+42
| In this preview, projects that define closed classes also need the compiler support attribute available to the compilation: | ||
|
|
||
| ```csharp | ||
| namespace System.Runtime.CompilerServices; | ||
|
|
||
| [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] | ||
| public sealed class ClosedAttribute : Attribute { } | ||
| ``` |
Member
There was a problem hiding this comment.
My understanding is that this hasn't gone through API review yet, so this polyfill is necessary. Can you confirm?
This is the first preview where we're talking about unsafe evolution. Talk about the feature, and then add only the changes in preview 5.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
C# release notes for .NET 11 Preview 5.
This component PR targets the base milestone branch
release-notes/11.0-preview5(umbrella PR: #10421). Review and edit the markdown here in isolation — when this PR merges into the base branch, the changes roll up into the umbrella PR.Draft generated with the
release-notesskill in this repo. Verify feature selection, code samples, API names, and contributor attributions before marking ready for review.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com