From f7e5e80c3d6726bdbdb5078e17aa1b9f499ff18f Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Sat, 26 Sep 2026 12:38:37 -0700 Subject: [PATCH 1/4] [release-notes] Draft sdk notes for .NET 11 RC 2 Add component release guidance and any maintained feature-validation fixtures for owner review. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 637615df-deba-4407-bf00-9a3bd4e569b5 --- release-notes/11.0/preview/rc2/sdk.md | 22 ++++++++++++++++++++++ release-notes/11.0/samples/sdk/Program.cs | 13 +++++++++++++ release-notes/11.0/samples/sdk/README.md | 3 +++ 3 files changed, 38 insertions(+) create mode 100644 release-notes/11.0/preview/rc2/sdk.md create mode 100644 release-notes/11.0/samples/sdk/Program.cs create mode 100644 release-notes/11.0/samples/sdk/README.md diff --git a/release-notes/11.0/preview/rc2/sdk.md b/release-notes/11.0/preview/rc2/sdk.md new file mode 100644 index 0000000000..7035d0f6e5 --- /dev/null +++ b/release-notes/11.0/preview/rc2/sdk.md @@ -0,0 +1,22 @@ +# SDK in .NET 11 RC 2 - Release Notes + +.NET 11 RC 2 improves file-based program configuration: + +- [Quoted file-level directive values](#quoted-file-level-directive-values) + +## Quoted file-level directive values + +File-based programs can use quoted values containing spaces in `#:property` directives. The SDK also accepts additional property directives, so a single C# file can carry more of its own build configuration ([dotnet/sdk #55960](https://github.com/dotnet/sdk/pull/55960)). + +```csharp +#:property Company="RC2 Validation Team" + +using System.Reflection; +Console.WriteLine(Assembly.GetExecutingAssembly() + .GetCustomAttribute()?.Company); +// RC2 Validation Team +``` + +Run the file with `dotnet run Program.cs`. The quoted value becomes the generated assembly's `Company` metadata. + +See the [file-based apps documentation](https://learn.microsoft.com/dotnet/core/sdk/file-based-apps) for supported directives and the broader workflow. diff --git a/release-notes/11.0/samples/sdk/Program.cs b/release-notes/11.0/samples/sdk/Program.cs new file mode 100644 index 0000000000..267778a004 --- /dev/null +++ b/release-notes/11.0/samples/sdk/Program.cs @@ -0,0 +1,13 @@ +#:property Company="RC2 Validation Team" +#:property AssemblyTitle="RC2 Directive Validation" + +using System.Reflection; + +string? company = Assembly.GetExecutingAssembly() + .GetCustomAttribute()?.Company; +if (company != "RC2 Validation Team") +{ + throw new Exception($"Expected quoted Company property; got '{company}'."); +} + +Console.WriteLine("Quoted file-level property was applied."); diff --git a/release-notes/11.0/samples/sdk/README.md b/release-notes/11.0/samples/sdk/README.md new file mode 100644 index 0000000000..bc1c1aaad4 --- /dev/null +++ b/release-notes/11.0/samples/sdk/README.md @@ -0,0 +1,3 @@ +# SDK release-note validation + +Run `dotnet run Program.cs` from this directory with SDK `11.0.100-rc.2.26475.137`. The file-based app checks that a quoted file-level property becomes generated assembly metadata. An exception signals an unexpected result. From fb0fdea8353310a0eff12936518858e7e84e30ce Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Sat, 26 Sep 2026 14:40:42 -0700 Subject: [PATCH 2/4] [release-notes] Link SDK in the RC2 index Add the component link alongside its matching release note. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 637615df-deba-4407-bf00-9a3bd4e569b5 --- release-notes/11.0/preview/rc2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/11.0/preview/rc2/README.md b/release-notes/11.0/preview/rc2/README.md index c9d38cad8a..80890d01e0 100644 --- a/release-notes/11.0/preview/rc2/README.md +++ b/release-notes/11.0/preview/rc2/README.md @@ -4,7 +4,7 @@ Component notes are being reviewed in separate draft pull requests. Links will b - Libraries - Runtime -- SDK +- [SDK](./sdk.md) - MSBuild - NuGet From 8c15d8a7bd7a59de25f4c525d2248821c9c36494 Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Fri, 2 Oct 2026 11:26:53 -0500 Subject: [PATCH 3/4] Document SDK RC2 launch profile expansion Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- release-notes/11.0/preview/rc2/sdk.md | 9 +++++++-- release-notes/11.0/samples/sdk/README.md | 4 +++- release-notes/11.0/samples/sdk/launch-profile/Program.cs | 8 ++++++++ .../11.0/samples/sdk/launch-profile/Program.run.json | 8 ++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 release-notes/11.0/samples/sdk/launch-profile/Program.cs create mode 100644 release-notes/11.0/samples/sdk/launch-profile/Program.run.json diff --git a/release-notes/11.0/preview/rc2/sdk.md b/release-notes/11.0/preview/rc2/sdk.md index 7035d0f6e5..43bfe23b52 100644 --- a/release-notes/11.0/preview/rc2/sdk.md +++ b/release-notes/11.0/preview/rc2/sdk.md @@ -1,12 +1,13 @@ # SDK in .NET 11 RC 2 - Release Notes -.NET 11 RC 2 improves file-based program configuration: +.NET 11 RC 2 improves file-based program configuration and launch-profile arguments: - [Quoted file-level directive values](#quoted-file-level-directive-values) +- [MSBuild properties in launch-profile arguments](#msbuild-properties-in-launch-profile-arguments) ## Quoted file-level directive values -File-based programs can use quoted values containing spaces in `#:property` directives. The SDK also accepts additional property directives, so a single C# file can carry more of its own build configuration ([dotnet/sdk #55960](https://github.com/dotnet/sdk/pull/55960)). +File-based programs can use quoted values containing spaces in `#:property` directives. The `#:package`, `#:project`, and `#:ref` directives also accept trailing `Name=Value` tokens for MSBuild item metadata ([dotnet/sdk #55960](https://github.com/dotnet/sdk/pull/55960)). ```csharp #:property Company="RC2 Validation Team" @@ -20,3 +21,7 @@ Console.WriteLine(Assembly.GetExecutingAssembly() Run the file with `dotnet run Program.cs`. The quoted value becomes the generated assembly's `Company` metadata. See the [file-based apps documentation](https://learn.microsoft.com/dotnet/core/sdk/file-based-apps) for supported directives and the broader workflow. + +## MSBuild properties in launch-profile arguments + +`dotnet run` now expands MSBuild properties in a launch profile's `commandLineArgs` using the evaluated project. For example, a profile argument such as `--name $(AssemblyName)` receives the project's assembly name when you run `dotnet run --launch-profile ` ([dotnet/sdk #56064](https://github.com/dotnet/sdk/pull/56064)). diff --git a/release-notes/11.0/samples/sdk/README.md b/release-notes/11.0/samples/sdk/README.md index bc1c1aaad4..6771c09187 100644 --- a/release-notes/11.0/samples/sdk/README.md +++ b/release-notes/11.0/samples/sdk/README.md @@ -1,3 +1,5 @@ # SDK release-note validation -Run `dotnet run Program.cs` from this directory with SDK `11.0.100-rc.2.26475.137`. The file-based app checks that a quoted file-level property becomes generated assembly metadata. An exception signals an unexpected result. +Run `dotnet run Program.cs` from this directory with SDK `11.0.100-rc.2.26475.137`. The file-based app checks that a quoted file-level property becomes generated assembly metadata. + +To verify MSBuild property expansion in file-based launch-profile arguments, run `dotnet run --file launch-profile/Program.cs --launch-profile AssemblyName` from this directory. The adjacent `Program.run.json` defines the profile, and the file-based program declares `AssemblyName`; it exits with an error if the property is not expanded. diff --git a/release-notes/11.0/samples/sdk/launch-profile/Program.cs b/release-notes/11.0/samples/sdk/launch-profile/Program.cs new file mode 100644 index 0000000000..5d6ad97fc3 --- /dev/null +++ b/release-notes/11.0/samples/sdk/launch-profile/Program.cs @@ -0,0 +1,8 @@ +#:property AssemblyName=LaunchProfileExpansion + +if (args.Length != 1 || args[0] != "LaunchProfileExpansion") +{ + throw new Exception($"Expected expanded AssemblyName argument; got '{string.Join(' ', args)}'."); +} + +Console.WriteLine($"Expanded launch-profile argument: {args[0]}"); diff --git a/release-notes/11.0/samples/sdk/launch-profile/Program.run.json b/release-notes/11.0/samples/sdk/launch-profile/Program.run.json new file mode 100644 index 0000000000..a4a0172367 --- /dev/null +++ b/release-notes/11.0/samples/sdk/launch-profile/Program.run.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "AssemblyName": { + "commandName": "Project", + "commandLineArgs": "$(AssemblyName)" + } + } +} From 866f7447cf41c19f205842687a99d505745c5427 Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Fri, 2 Oct 2026 11:38:47 -0500 Subject: [PATCH 4/4] Align SDK RC2 note and sample Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- release-notes/11.0/preview/rc2/sdk.md | 23 ++++++++++++++++++----- release-notes/11.0/samples/sdk/Program.cs | 12 +++++++++--- release-notes/11.0/samples/sdk/README.md | 2 +- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/release-notes/11.0/preview/rc2/sdk.md b/release-notes/11.0/preview/rc2/sdk.md index 43bfe23b52..1ec9f00674 100644 --- a/release-notes/11.0/preview/rc2/sdk.md +++ b/release-notes/11.0/preview/rc2/sdk.md @@ -7,18 +7,31 @@ ## Quoted file-level directive values -File-based programs can use quoted values containing spaces in `#:property` directives. The `#:package`, `#:project`, and `#:ref` directives also accept trailing `Name=Value` tokens for MSBuild item metadata ([dotnet/sdk #55960](https://github.com/dotnet/sdk/pull/55960)). +File-based programs can use quoted values containing spaces in `#:property` directives. The `#:package`, `#:project`, and `#:ref` directives also accept trailing `Name=Value` tokens for MSBuild item metadata. This example uses the `Aliases` metadata on a package directive and references the package through the resulting C# extern alias ([dotnet/sdk #55960](https://github.com/dotnet/sdk/pull/55960)). ```csharp #:property Company="RC2 Validation Team" +#:property AssemblyTitle="RC2 Directive Validation" +#:package System.CommandLine@2.0.1 Aliases=CommandLine +extern alias CommandLine; using System.Reflection; -Console.WriteLine(Assembly.GetExecutingAssembly() - .GetCustomAttribute()?.Company); -// RC2 Validation Team + +string? company = Assembly.GetExecutingAssembly() + .GetCustomAttribute()?.Company; +var nameOption = new CommandLine::System.CommandLine.Option("--name"); +var command = new CommandLine::System.CommandLine.RootCommand(); +command.Options.Add(nameOption); +string? name = command.Parse(args).GetValue(nameOption); +if (company != "RC2 Validation Team" || name != "RC2") +{ + throw new Exception($"Unexpected metadata or argument: {company}, {name}."); +} + +Console.WriteLine($"Company: {company}; name: {name}"); ``` -Run the file with `dotnet run Program.cs`. The quoted value becomes the generated assembly's `Company` metadata. +Run the file with `dotnet run Program.cs -- --name RC2`. The quoted value becomes the generated assembly's `Company` metadata, and `System.CommandLine` parses the supplied option through the `CommandLine` alias. See the [file-based apps documentation](https://learn.microsoft.com/dotnet/core/sdk/file-based-apps) for supported directives and the broader workflow. diff --git a/release-notes/11.0/samples/sdk/Program.cs b/release-notes/11.0/samples/sdk/Program.cs index 267778a004..f3ff566f16 100644 --- a/release-notes/11.0/samples/sdk/Program.cs +++ b/release-notes/11.0/samples/sdk/Program.cs @@ -1,13 +1,19 @@ #:property Company="RC2 Validation Team" #:property AssemblyTitle="RC2 Directive Validation" +#:package System.CommandLine@2.0.1 Aliases=CommandLine +extern alias CommandLine; using System.Reflection; string? company = Assembly.GetExecutingAssembly() .GetCustomAttribute()?.Company; -if (company != "RC2 Validation Team") +var nameOption = new CommandLine::System.CommandLine.Option("--name"); +var command = new CommandLine::System.CommandLine.RootCommand(); +command.Options.Add(nameOption); +string? name = command.Parse(args).GetValue(nameOption); +if (company != "RC2 Validation Team" || name != "RC2") { - throw new Exception($"Expected quoted Company property; got '{company}'."); + throw new Exception($"Unexpected metadata or argument: {company}, {name}."); } -Console.WriteLine("Quoted file-level property was applied."); +Console.WriteLine($"Company: {company}; name: {name}"); diff --git a/release-notes/11.0/samples/sdk/README.md b/release-notes/11.0/samples/sdk/README.md index 6771c09187..0c96413c81 100644 --- a/release-notes/11.0/samples/sdk/README.md +++ b/release-notes/11.0/samples/sdk/README.md @@ -1,5 +1,5 @@ # SDK release-note validation -Run `dotnet run Program.cs` from this directory with SDK `11.0.100-rc.2.26475.137`. The file-based app checks that a quoted file-level property becomes generated assembly metadata. +Run `dotnet run Program.cs -- --name RC2` from this directory with SDK `11.0.100-rc.2.26475.137`. The file-based app checks that a quoted file-level property becomes generated assembly metadata and uses `System.CommandLine` through a C# extern alias supplied by trailing `Aliases=CommandLine` package metadata. To verify MSBuild property expansion in file-based launch-profile arguments, run `dotnet run --file launch-profile/Program.cs --launch-profile AssemblyName` from this directory. The adjacent `Program.run.json` defines the profile, and the file-based program declares `AssemblyName`; it exits with an error if the property is not expanded.