[release-notes] C# in .NET 11 Preview 5#10426
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| 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; } | ||
| } | ||
| ``` |
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).
There was a problem hiding this comment.
yeah, no need to declare this anymore since .NET 11 preview 4
drafted a PR to fix this #10449
| 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 { } | ||
| ``` |
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?
There was a problem hiding this comment.
We got it approved last week: dotnet/runtime#128161 (comment)
I would recommend removing mention of closed types in the Preview 5 article until their implementation has been finalized.
There was a problem hiding this comment.
Preview 5 will need polyfill of ClosedAttribute.
We renamed to IsClosedTypeAttribute (and API review approved that name) after shipping preview 5, and are now working on some adjustments to the metadata representation to try and get in for preview 6.
At that point I would consider it fairly stable from end user POV.
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.
* Add .NET 11 Preview 5 release-notes scaffold (README, changes.json, build-metadata.json, features.json) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add F# release notes for .NET 11 Preview 5 (#10427) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * [release-notes] EF Core in .NET 11 Preview 5 (#10428) Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> * [release-notes] ASP.NET Core in .NET 11 Preview 5 (#10422) * [release-notes] Libraries in .NET 11 Preview 5 (#10424) * Add Libraries release notes for .NET 11 Preview 5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update libraries preview 5 notes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Editorial pass: fix EqualityComparer sample, add X25519 + OptionsBuilder.Validate sections After validating every sample and prose claim against SDK 11.0.100-preview.5.26302.115: - Bump verification comment from .26276.113 to .26302.115 (the actually-shipped build). - Update table of contents to include the two new sections below and the tuple-Joins coverage. - Fix CS8602 in the EqualityComparer.Create sample by using `user!.Email` (the delegate parameter type is `T?`, so the inferred lambda parameter is nullable). - Add a paragraph to the FullJoin section covering the new tuple-returning overloads of Join/LeftJoin/RightJoin/GroupJoin on Enumerable, Queryable, and AsyncEnumerable (dotnet/runtime#121998). - Add a new H2 section for X25519DiffieHellman + X25519DiffieHellmanCng / X25519DiffieHellmanOpenSsl and the new CryptographicOperations.FixedTimeEquals byte-value overload (dotnet/runtime#127248, #127826). - Add a new H2 section for OptionsBuilder<TOptions>.Validate<TValidateOptions>() (dotnet/runtime#127264). All code samples build clean and produce the documented output against Microsoft.NETCore.App 11.0.0-preview.5.26302.115. Markdownlint clean. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Rich Lander <rich@lander.ca> Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com> * [release-notes] .NET MAUI in .NET 11 Preview 5 (#10433) * Add .NET MAUI release notes for .NET 11 Preview 5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * [release-notes] .NET MAUI in .NET 11 Preview 5 Replace the placeholder stub with the Preview 5 release notes covering: * The April 14th reliability candidate landing in net11.0 (dozens of customer-reported fixes across CollectionView/CarouselView/Shell/gestures/ layout/RTL/SearchHandler/TabBar/Label/GraphicsView/SwipeView/HybridWebView/ Entry/Editor/Picker/BoxView and more) * New CancellationToken-aware *ToAsync animation overloads (and deprecation of the original FadeTo/RotateTo/TranslateTo/ScaleTo/LayoutTo) * BoxView.Fill property accepting any Brush * Windows Maps now implemented against WinUI 3 MapControl (Azure Maps backed) * Material 3 handlers and helpers becoming public * BackButtonAccessibilityLabel on NavigationPage and Shell * .NET MAUI Android minimum SDK raised to API 24 * .NET for Android: API 37 graduated to Stable, EnableOnBackInvokedCallback, CoreCLR diagnostic-lib exclusion, runtime crash reporting improvements * .NET for Apple: Xcode 26.5 bindings, Debug-on-device R2R stripping, partial Xcode-less builds, sharpie x64 error message * Apple Intelligence (Microsoft.Maui.Essentials.AI) APIs graduating from unshipped to shipped on iOS, Mac Catalyst, and macOS Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * [release-notes] Refine .NET for Android section for Preview 5 - Drop "adds new CLI capabilities" from the heading and TOC; nothing in the section actually described a CLI capability. - Add a "Minimum API level unified to 24" subsection covering dotnet/android #11331, which unified the floor across Mono, CoreCLR, and NativeAOT. - Replace the vague TrimmableTypeMap bullet with a real subsection citing the user-facing PRs that landed this preview. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: David Ortinau <daortin@microsoft.com> * [release-notes] WPF in .NET 11 Preview 5 (#10432) * [release-notes] NuGet in .NET 11 Preview 5 (#10430) * Add NuGet release notes for .NET 11 Preview 5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Apply suggestion from @baronfel --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Chet Husk <baronfel@users.noreply.github.com> * [release-notes] MSBuild in .NET 11 Preview 5 (#10429) * Add MSBuild release notes for .NET 11 Preview 5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add note about MT mode performance --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Chet Husk <baronfel@users.noreply.github.com> * [release-notes] Windows Forms in .NET 11 Preview 5 (#10431) * [release-notes] C# in .NET 11 Preview 5 (#10426) * Add C# release notes for .NET 11 Preview 5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Expand on unsafe evolution 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. * fix lint. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Bill Wagner <wiwagn@microsoft.com> * [release-notes] .NET SDK in .NET 11 Preview 5 (#10425) * Add .NET SDK release notes for .NET 11 Preview 5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update SDK release notes for Preview 5 Added details about NativeAOT CLI fast path and breaking changes in Preview 5. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Chet Husk <baronfel@users.noreply.github.com> * [release-notes] Runtime in .NET 11 Preview 5 (#10423) * Add Runtime release notes for .NET 11 Preview 5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update runtime preview 5 notes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Jan Kotas <jkotas@microsoft.com> * Add 'Try browser CoreCLR' instructions to runtime notes Addresses jkotas's review comment on PR #10423 asking for instructions on how to try the new browser CoreCLR runtime. Steps are based on the instructions @pavelsavara posted on the PR: - Use the .NET 11 Preview 5 SDK and target net11.0. - Set <UseMonoRuntime>false</UseMonoRuntime> in the WebAssembly client project (or pass /p:UseMonoRuntime=false on the command line). Works for both Blazor WASM and projects using Microsoft.NET.Sdk.WebAssembly. - Verify at runtime via globalThis.getDotnetRuntime(0).INTERNAL.GetDotNetRuntimeHeap() in the browser console; CoreCLR returns a memory dump, Mono does not. - Note that a native WASM toolchain/workload for CoreCLR doesn't exist yet, so AOT/native still requires Mono in Preview 5. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Apply suggestion from @danroth27 * Tighten browser CoreCLR verification wording When verifying the instructions against 11.0.100-preview.5.26302.115, INTERNAL.GetDotNetRuntimeHeap() existed on the CoreCLR runtime and returned a Uint8Array, but the buffer was byteLength=0 in the steady state (the related INTERNAL.GetDotNetRuntimeContractDescriptor() did return a non-zero pointer). The presence of the hook is what disambiguates CoreCLR from Mono; the contents are not a guaranteed 'memory dump' today. Reword the doc so readers don't expect non-empty output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Rich Lander <rich@lander.ca> Co-authored-by: Jan Kotas <jkotas@microsoft.com> * [release-notes] Containers in .NET 11 Preview 5 (#10434) * Add Containers release notes for .NET 11 Preview 5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Apply suggestion from @danroth27 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Remove author-note HTML comments from Preview 5 release notes The release-notes skill embeds two kinds of author-only notes as HTML comments in the generated markdown: 'Filtered features' blocks (listing work that didn't meet the editorial bar with rationale) and 'Verified against ... package@version from <feed>' provenance lines for API checks. These are useful during drafting but shouldn't ship to readers of the published release notes. Strip both kinds from the six Preview 5 component files that contained them: csharp.md, fsharp.md, libraries.md, msbuild.md, nuget.md, and runtime.md. Inline XAML comments inside dotnetmaui.md code samples are left untouched since they're part of the rendered code snippets, not author notes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix Preview 5 release-notes lint failures Markdown: - Restore the blank line my previous comment-removal commit (609ec5f) collapsed between the TOC link and the first ## heading in libraries.md and runtime.md (MD032/MD022). - Trim the trailing double blank line at the end of nuget.md (MD012). Gitleaks: - Add .github/linters/.gitleaks.toml allowlisting the auto-generated release-notes data files (changes.json, features.json, build-metadata.json). changes.json contains thousands of 40-char hex VMR commit SHAs; ones starting with 'eaaa' match the square-access-token rule's EAAA[A-Za-z0-9_-]{60+} regex. Allowlisting by path is the correct scope since the file is tool-generated. [extend] useDefault = true preserves the upstream gitleaks default rules (a custom config otherwise silently disables every built-in rule). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Drop @Copilot from MAUI contributors; exclude bots in skill The @Copilot entry in dotnetmaui.md linked to https://github.com/Copilot, which 404s (the Copilot bot has no user profile page) and was failing markdown-link-check on the umbrella PR. Bot/automation accounts aren't community contributors, so remove the entry and update editorial-rules.md to explicitly exclude Copilot, dependabot, github-actions, and *[bot] accounts so this doesn't recur in future releases. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> Co-authored-by: Rich Lander <rich@lander.ca> Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com> Co-authored-by: David Ortinau <daortin@microsoft.com> Co-authored-by: Chet Husk <baronfel@users.noreply.github.com> Co-authored-by: Bill Wagner <wiwagn@microsoft.com> Co-authored-by: Jan Kotas <jkotas@microsoft.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Rahul Bhandari <rbhanda@microsoft.com>
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