From b837bf1bccf67d1d8649d0649db9eefd0011589a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Jul 2026 20:59:27 +0000 Subject: [PATCH 1/6] Initial plan From daadb4505e0338050e6b2e3e17a198f22bb120f4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Jul 2026 21:03:50 +0000 Subject: [PATCH 2/6] docs: update Platform attribute docs for NUnit 5 runtime identifier changes - Replace the Runtime section with NUnit 5-accurate content: - Net, NETCore, DotNET, DotNETCore all target modern .NET - NETFramework and DotNETFramework target .NET Framework (new in NUnit 5) - Note that version specifiers are not supported for modern .NET - NETFramework supports version specifiers (e.g. NETFramework-4.0) - Remove obsolete Net-1.0 through Net-4.5 and NetCF entries - Add MonoTouch to Other Runtimes - Update Notes section (remove .NET Framework footnotes, renumber Mono ones) - Add Breaking Changes in NUnit 5 section with migration table Closes #1181 --- .../writing-tests/attributes/platform.md | 61 ++++++++++++++----- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/docs/articles/nunit/writing-tests/attributes/platform.md b/docs/articles/nunit/writing-tests/attributes/platform.md index 98c401a24..63b6ac815 100644 --- a/docs/articles/nunit/writing-tests/attributes/platform.md +++ b/docs/articles/nunit/writing-tests/attributes/platform.md @@ -103,31 +103,62 @@ considered an internal type and shall not be used in production. ### Runtime +#### Modern .NET + * Net -* Net-1.0 -* Net-1.1 -* Net-2.0 -* Net-3.0 (1) -* Net-3.5 (2) -* Net-4.0 -* Net-4.5 (3) -* NetCF +* NETCore +* DotNET +* DotNETCore + +> [!NOTE] +> Version specifiers (for example, `Net-5.0`) are **not** supported for modern .NET identifiers. + +#### .NET Framework + +* NETFramework +* DotNETFramework + +A version number can be appended using a dash, for example `NETFramework-4.0` or `NETFramework-4.5`. + +#### Other Runtimes + * SSCLI * Rotor * Mono * Mono-1.0 * Mono-2.0 -* Mono-3.0 (4) -* Mono-3.5 (5) +* Mono-3.0 (1) +* Mono-3.5 (2) * Mono-4.0 +* MonoTouch ## Notes -1. Includes Net-2.0 -2. Includes Net-2.0 and Net-3.0 -3. Includes Net-4.0 -4. Includes Mono-2.0 -5. Includes Mono-2.0 and Mono-3.0 +1. Includes Mono-2.0 +2. Includes Mono-2.0 and Mono-3.0 + +## Breaking Changes in NUnit 5 + +> [!IMPORTANT] +> **Breaking change in NUnit 5:** The meaning of `NET` and `DotNET` has changed to better align with +> Microsoft's current .NET terminology. These identifiers previously targeted .NET Framework and now +> target modern .NET (.NET 5+, .NET Core). + +| Identifier | NUnit 4 | NUnit 5 | +|------------|---------|---------| +| `NET` | .NET Framework | Modern .NET | +| `NETFramework` | Not supported | .NET Framework | +| `NETCore` | Modern .NET | Modern .NET *(unchanged)* | +| `DotNET` | .NET Framework | Modern .NET | +| `DotNETCore` | Modern .NET | Modern .NET *(unchanged)* | +| `DotNETFramework` | Not supported | .NET Framework | + +If you were using `[Platform("NET")]` or `[Platform("DotNET")]` to target .NET Framework, +update those usages to `[Platform("NETFramework")]` or `[Platform("DotNETFramework")]`. + +Additionally, version-specific .NET targeting using `Net-X.X` (for example, `Net-4.0`, `Net-4.5`) +is no longer supported. Use `NETFramework-X.X` instead (for example, `NETFramework-4.0`, +`NETFramework-4.5`). ## `[SupportedOSPlatformAttribute]` and `[UnsupportedOSPlatformAttribute]` support From 4a172e72934b201509bf5ffc7c1a3f7d6d52e8b6 Mon Sep 17 00:00:00 2001 From: stevenaw Date: Wed, 8 Jul 2026 08:22:18 -0400 Subject: [PATCH 3/6] Update on what copilot started for me --- .../writing-tests/attributes/platform.md | 35 ++++++++----------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/docs/articles/nunit/writing-tests/attributes/platform.md b/docs/articles/nunit/writing-tests/attributes/platform.md index 63b6ac815..a8f4e083a 100644 --- a/docs/articles/nunit/writing-tests/attributes/platform.md +++ b/docs/articles/nunit/writing-tests/attributes/platform.md @@ -88,9 +88,7 @@ The following values are recognized as platform specifiers. They may be expresse * MacOsX * XBox -A list of supported platform identifiers can also be obtained from the constant string `PlatformHelper.OSPlatforms` of -the NUnit assembly you use. Note that this is for informational purposes only, because the `PlatformHelper` is -considered an internal type and shall not be used in production. +A list of supported identifiers can also be referenced from the named constants in the `PlatformNames` class. (_NUnit 4.6+_). ### Architecture @@ -103,39 +101,34 @@ considered an internal type and shall not be used in production. ### Runtime -#### Modern .NET - * Net * NETCore * DotNET * DotNETCore +* NETFramework (_NUnit 5+_) +* DotNETFramework (_NUnit 5+_) > [!NOTE] -> Version specifiers (for example, `Net-5.0`) are **not** supported for modern .NET identifiers. - -#### .NET Framework - -* NETFramework -* DotNETFramework - -A version number can be appended using a dash, for example `NETFramework-4.0` or `NETFramework-4.5`. +> The meaning of `Net` and `DotNET` has changed in NUnit 5. These identifiers previously targeted .NET Framework and now +> target modern .NET (.NET 5+, .NET Core). For more information please see the **Breaking Changes** section below. #### Other Runtimes * SSCLI * Rotor * Mono -* Mono-1.0 -* Mono-2.0 -* Mono-3.0 (1) -* Mono-3.5 (2) -* Mono-4.0 * MonoTouch -## Notes +#### Runtime Version Specifiers + +> [!NOTE] +> Version specifiers (for example, `Net-5.0`) are **not** supported for modern .NET identifiers. + +A runtime version number can be appended using a dash, for example `NETFramework-4.0`, `NETFramework-4.5`, or `Mono-3.0`. These relate to the underlying Common Language Runtime (CLR) version and are inclusive of lower runtime versions which target the same CLR. + +For example: -1. Includes Mono-2.0 -2. Includes Mono-2.0 and Mono-3.0 +`NETFramework-4.5` will include `NETFramework-4.0` as both run on version 4 of the CLR. Similarly, `Mono-3.5` will include `Mono-2.0` and `Mono-3.0` as all run on version 2 of the MonoCLR. ## Breaking Changes in NUnit 5 From 8953dc33bc972d840e6eb9fa2ba2eb155b7c5178 Mon Sep 17 00:00:00 2001 From: stevenaw Date: Wed, 8 Jul 2026 08:30:13 -0400 Subject: [PATCH 4/6] Fix linting issues --- .../nunit/writing-tests/attributes/platform.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/articles/nunit/writing-tests/attributes/platform.md b/docs/articles/nunit/writing-tests/attributes/platform.md index a8f4e083a..10368a803 100644 --- a/docs/articles/nunit/writing-tests/attributes/platform.md +++ b/docs/articles/nunit/writing-tests/attributes/platform.md @@ -88,7 +88,7 @@ The following values are recognized as platform specifiers. They may be expresse * MacOsX * XBox -A list of supported identifiers can also be referenced from the named constants in the `PlatformNames` class. (_NUnit 4.6+_). +A list of supported identifiers can also be referenced from the named constants in the `PlatformNames` class. _(NUnit 4.6+)_. ### Architecture @@ -105,8 +105,8 @@ A list of supported identifiers can also be referenced from the named constants * NETCore * DotNET * DotNETCore -* NETFramework (_NUnit 5+_) -* DotNETFramework (_NUnit 5+_) +* NETFramework _(NUnit 5+)_ +* DotNETFramework _(NUnit 5+)_ > [!NOTE] > The meaning of `Net` and `DotNET` has changed in NUnit 5. These identifiers previously targeted .NET Framework and now @@ -141,9 +141,9 @@ For example: |------------|---------|---------| | `NET` | .NET Framework | Modern .NET | | `NETFramework` | Not supported | .NET Framework | -| `NETCore` | Modern .NET | Modern .NET *(unchanged)* | +| `NETCore` | Modern .NET | Modern .NET _(unchanged)_ | | `DotNET` | .NET Framework | Modern .NET | -| `DotNETCore` | Modern .NET | Modern .NET *(unchanged)* | +| `DotNETCore` | Modern .NET | Modern .NET _(unchanged)_ | | `DotNETFramework` | Not supported | .NET Framework | If you were using `[Platform("NET")]` or `[Platform("DotNET")]` to target .NET Framework, From 9df550339f4c780638f2cc5e9f33c084acb11db5 Mon Sep 17 00:00:00 2001 From: Steven Weerdenburg Date: Wed, 8 Jul 2026 13:19:29 +0000 Subject: [PATCH 5/6] Final updates, visually verified in codespaces --- .devcontainer/get-nunit-apidocs.sh | 4 ++-- .../nunit/writing-tests/attributes/platform.md | 15 ++++++++------- .../Attributes/PlatformAttributeExamples.cs | 13 ++++++++++++- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.devcontainer/get-nunit-apidocs.sh b/.devcontainer/get-nunit-apidocs.sh index 385bde5f1..d5dc701c4 100644 --- a/.devcontainer/get-nunit-apidocs.sh +++ b/.devcontainer/get-nunit-apidocs.sh @@ -1,11 +1,11 @@ # This script gets the the latest version of NUnit and extracts it. This is because docfx is capable of generating API docs, and this way the Codespace will be automatically enabled to do that. # This is hard-coded for now. -NUNIT_VERSION_FOR_API_DOCS="4.3.2" +NUNIT_VERSION_FOR_API_DOCS="4.6.1" first_workspace="$(cd /workspaces && ls | head -1)" -wget "https://github.com/nunit/nunit/releases/download/$NUNIT_VERSION_FOR_API_DOCS/NUnit.Framework-$NUNIT_VERSION_FOR_API_DOCS.zip" -O /apidocs.zip +wget "https://github.com/nunit/nunit/releases/download/v$NUNIT_VERSION_FOR_API_DOCS/NUnit.Framework-$NUNIT_VERSION_FOR_API_DOCS.zip" -O /apidocs.zip mkdir -p /workspaces/$first_workspace/code-output diff --git a/docs/articles/nunit/writing-tests/attributes/platform.md b/docs/articles/nunit/writing-tests/attributes/platform.md index 10368a803..32f5baaad 100644 --- a/docs/articles/nunit/writing-tests/attributes/platform.md +++ b/docs/articles/nunit/writing-tests/attributes/platform.md @@ -40,6 +40,8 @@ PlatformAttribute(string[] includes) |----------|------|-------------|---------| | `Include` | `string` | Comma-delimited list of included platforms. | `null` | | `Exclude` | `string` | Comma-delimited list of excluded platforms. | `null` | +| `Includes` | `string[]` | Array of included platforms. | `null` | +| `Excludes` | `string[]` | Array of excluded platforms. | `null` | ## Applies To @@ -108,9 +110,10 @@ A list of supported identifiers can also be referenced from the named constants * NETFramework _(NUnit 5+)_ * DotNETFramework _(NUnit 5+)_ -> [!NOTE] -> The meaning of `Net` and `DotNET` has changed in NUnit 5. These identifiers previously targeted .NET Framework and now -> target modern .NET (.NET 5+, .NET Core). For more information please see the **Breaking Changes** section below. +> [!IMPORTANT] +> **Breaking change in NUnit 5:** The meaning of `NET` and `DotNET` has changed to better align with +> Microsoft's terminology. These identifiers previously targeted .NET Framework and now +> target modern .NET (.NET 5+, .NET Core). For more information please see the [**Breaking Changes**](#breaking-changes-in-nunit-5) section below. #### Other Runtimes @@ -132,10 +135,8 @@ For example: ## Breaking Changes in NUnit 5 -> [!IMPORTANT] -> **Breaking change in NUnit 5:** The meaning of `NET` and `DotNET` has changed to better align with -> Microsoft's current .NET terminology. These identifiers previously targeted .NET Framework and now -> target modern .NET (.NET 5+, .NET Core). +The meaning of `NET` and `DotNET` has changed to better align with Microsoft's current .NET terminology. These identifiers previously targeted .NET Framework and now +target modern .NET (.NET 5+, .NET Core). | Identifier | NUnit 4 | NUnit 5 | |------------|---------|---------| diff --git a/docs/snippets/Snippets.NUnit/Attributes/PlatformAttributeExamples.cs b/docs/snippets/Snippets.NUnit/Attributes/PlatformAttributeExamples.cs index 20d22be60..d7203c317 100644 --- a/docs/snippets/Snippets.NUnit/Attributes/PlatformAttributeExamples.cs +++ b/docs/snippets/Snippets.NUnit/Attributes/PlatformAttributeExamples.cs @@ -10,12 +10,23 @@ public class PlatformAttributeExamples public class PortableTests { [Test] - [Platform(Exclude = "Win98,WinME")] + [Platform(Excludes = ["Win98", "WinME"])] public void SomeTest() { Assert.Pass("Runs only on supported platforms."); } } + + [TestFixture] + public class RuntimeSpecificTests + { + [Test] + [Platform([PlatformNames.NETFramework])] + public void SomeTest() + { + Assert.Pass("Runs only on .NET Framework"); + } + } #endregion } } From 32ccca0c4a09f61b64401af621cdddfd652d2825 Mon Sep 17 00:00:00 2001 From: Steven Weerdenburg Date: Wed, 8 Jul 2026 17:03:56 +0000 Subject: [PATCH 6/6] Link out to PlatformNames --- docs/articles/nunit/writing-tests/attributes/platform.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/articles/nunit/writing-tests/attributes/platform.md b/docs/articles/nunit/writing-tests/attributes/platform.md index 32f5baaad..8ec8ff7b3 100644 --- a/docs/articles/nunit/writing-tests/attributes/platform.md +++ b/docs/articles/nunit/writing-tests/attributes/platform.md @@ -55,7 +55,7 @@ PlatformAttribute(string[] includes) ## Platform Specifiers -The following values are recognized as platform specifiers. They may be expressed in upper, lower or mixed case. +The following values are recognized as platform specifiers. They may be expressed in upper, lower or mixed case. A list of supported identifiers can also be referenced from the named constants in the [`PlatformNames`](/api/NUnit.Framework.PlatformNames.html) class. _(NUnit 4.6+)_. ### Operating System @@ -90,8 +90,6 @@ The following values are recognized as platform specifiers. They may be expresse * MacOsX * XBox -A list of supported identifiers can also be referenced from the named constants in the `PlatformNames` class. _(NUnit 4.6+)_. - ### Architecture * 32-Bit