From 13c32df3bc356e08391fc1687c3c03f7ef3ecb7f Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Fri, 26 Jul 2024 15:08:34 +0200 Subject: [PATCH 1/8] Update testing platform dotnet test integration (#41883) * Update no-response.yml * Update NUnit doc * Revert update * Align with MSTest * Update testing platform dotnet test integration * revert update --------- Co-authored-by: Marco Rossignoli --- ...t-testing-platform-integration-dotnet-test.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/core/testing/unit-testing-platform-integration-dotnet-test.md b/docs/core/testing/unit-testing-platform-integration-dotnet-test.md index b7202e1679e81..bd625488c81b0 100644 --- a/docs/core/testing/unit-testing-platform-integration-dotnet-test.md +++ b/docs/core/testing/unit-testing-platform-integration-dotnet-test.md @@ -56,11 +56,19 @@ By default, VSTest is used to run `Microsoft.Testing.Platform` tests. You can en ``` -In this mode, additional parameters to the run aren't provided directly through the command line. They need to be provided as an MSBuild property named `TestingPlatformCommandLineArguments`: +In this mode, you can supply extra parameters that will be utilized to call the testing application as follows: -```dotnetcli -dotnet test -p:TestingPlatformCommandLineArguments=" --minimum-expected-tests 10 " -``` +1. Beginning with `Microsoft.Testing.Platform` version 1.4 (included with MSTest version 3.6), options can be added after the double dash `--`: + + ```dotnetcli + dotnet test -- --minimum-expected-tests 10 + ``` + +1. By using the `TestingPlatformCommandLineArguments` MSBuild property: + + ```dotnetcli + dotnet test -p:TestingPlatformCommandLineArguments=" --minimum-expected-tests 10 " + ``` ## Additional MSBuild options From 2fbe18168c902acb0c15f683748740bb7a97cc31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Fri, 26 Jul 2024 15:09:14 +0200 Subject: [PATCH 2/8] Fix or add more details about some MSTest rules (#41885) Co-authored-by: David Pine --- .../testing/mstest-analyzers/includes/test-class-rules.md | 6 ++++++ docs/core/testing/mstest-analyzers/mstest0008.md | 2 ++ docs/core/testing/mstest-analyzers/mstest0009.md | 2 ++ docs/core/testing/mstest-analyzers/mstest0010.md | 4 ++++ docs/core/testing/mstest-analyzers/mstest0011.md | 4 ++++ docs/core/testing/mstest-analyzers/mstest0012.md | 4 ++++ docs/core/testing/mstest-analyzers/mstest0013.md | 4 ++++ docs/core/testing/mstest-analyzers/mstest0029.md | 4 ++-- docs/core/testing/mstest-analyzers/mstest0030.md | 2 +- 9 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 docs/core/testing/mstest-analyzers/includes/test-class-rules.md diff --git a/docs/core/testing/mstest-analyzers/includes/test-class-rules.md b/docs/core/testing/mstest-analyzers/includes/test-class-rules.md new file mode 100644 index 0000000000000..f10f31a1d8332 --- /dev/null +++ b/docs/core/testing/mstest-analyzers/includes/test-class-rules.md @@ -0,0 +1,6 @@ +The type declaring these methods should also respect the following rules: + +- The type should be a `class`. +- The `class` should be `public` or `internal` (if the test project is using the `[DiscoverInternals]` attribute). +- The `class` shouldn't be `static`. +- If the `class` is `sealed`, it should be marked with `[TestClass]` (or a derived attribute). diff --git a/docs/core/testing/mstest-analyzers/mstest0008.md b/docs/core/testing/mstest-analyzers/mstest0008.md index db4b8da4d15b3..de7c20be795c1 100644 --- a/docs/core/testing/mstest-analyzers/mstest0008.md +++ b/docs/core/testing/mstest-analyzers/mstest0008.md @@ -40,6 +40,8 @@ Methods marked with `[TestInitialize]` should follow the following layout to be - it should not take any parameter - return type should be `void`, `Task` or `ValueTask` +[!INCLUDE [test-class-rules](includes/test-class-rules.md)] + ## How to fix violations Ensure that the method matches the layout described above. diff --git a/docs/core/testing/mstest-analyzers/mstest0009.md b/docs/core/testing/mstest-analyzers/mstest0009.md index b4e3cc25092a6..833587c742c55 100644 --- a/docs/core/testing/mstest-analyzers/mstest0009.md +++ b/docs/core/testing/mstest-analyzers/mstest0009.md @@ -40,6 +40,8 @@ Methods marked with `[TestCleanup]` should follow the following layout to be val - it should not take any parameter - return type should be `void`, `Task` or `ValueTask` +[!INCLUDE [test-class-rules](includes/test-class-rules.md)] + ## How to fix violations Ensure that the method matches the layout described above. diff --git a/docs/core/testing/mstest-analyzers/mstest0010.md b/docs/core/testing/mstest-analyzers/mstest0010.md index e9750d17922c8..6c61ce98294bf 100644 --- a/docs/core/testing/mstest-analyzers/mstest0010.md +++ b/docs/core/testing/mstest-analyzers/mstest0010.md @@ -40,6 +40,10 @@ Methods marked with `[ClassInitialize]` should follow the following layout to be - it should take one parameter of type `TestContext` - return type should be `void`, `Task` or `ValueTask` +[!INCLUDE [test-class-rules](includes/test-class-rules.md)] + +- the class should not be generic + ## How to fix violations Ensure that the method matches the layout described above. diff --git a/docs/core/testing/mstest-analyzers/mstest0011.md b/docs/core/testing/mstest-analyzers/mstest0011.md index 587e3be81084e..de4ed0d1c0702 100644 --- a/docs/core/testing/mstest-analyzers/mstest0011.md +++ b/docs/core/testing/mstest-analyzers/mstest0011.md @@ -40,6 +40,10 @@ Methods marked with `[ClassCleanup]` should follow the following layout to be va - it should not take any parameter - return type should be `void`, `Task` or `ValueTask` +[!INCLUDE [test-class-rules](includes/test-class-rules.md)] + +- the class should not be generic + ## How to fix violations Ensure that the method matches the layout described above. diff --git a/docs/core/testing/mstest-analyzers/mstest0012.md b/docs/core/testing/mstest-analyzers/mstest0012.md index c2d3239a2a311..23e901196273d 100644 --- a/docs/core/testing/mstest-analyzers/mstest0012.md +++ b/docs/core/testing/mstest-analyzers/mstest0012.md @@ -40,6 +40,10 @@ Methods marked with `[AssemblyInitialize]` should follow the following layout to - it should take one parameter of type `TestContext` - return type should be `void`, `Task` or `ValueTask` +[!INCLUDE [test-class-rules](includes/test-class-rules.md)] + +- the class should not be generic + ## How to fix violations Ensure that the method matches the layout described above. diff --git a/docs/core/testing/mstest-analyzers/mstest0013.md b/docs/core/testing/mstest-analyzers/mstest0013.md index 243e2f72347c7..4f0a6a4cdc67e 100644 --- a/docs/core/testing/mstest-analyzers/mstest0013.md +++ b/docs/core/testing/mstest-analyzers/mstest0013.md @@ -40,6 +40,10 @@ Methods marked with `[AssemblyCleanup]` should follow the following layout to be - it should not take any parameter - return type should be `void`, `Task` or `ValueTask` +[!INCLUDE [test-class-rules](includes/test-class-rules.md)] + +- the class should not be generic + ## How to fix violations Ensure that the method matches the layout described above. diff --git a/docs/core/testing/mstest-analyzers/mstest0029.md b/docs/core/testing/mstest-analyzers/mstest0029.md index b0597891973ab..8450d6758379d 100644 --- a/docs/core/testing/mstest-analyzers/mstest0029.md +++ b/docs/core/testing/mstest-analyzers/mstest0029.md @@ -25,11 +25,11 @@ ms.author: enjieid ## Cause -A Public method should be a test method. +A `public` method should be a test method. ## Rule description -A Public method should be a test method (marked with `[TestMethod]`). +A `public` method of a class marked with `[TestClass]` should be a test method (marked with `[TestMethod]`). The rule ignores methods that are marked with `[TestInitialize]`, or `[TestCleanup]` attributes. ## How to fix violations diff --git a/docs/core/testing/mstest-analyzers/mstest0030.md b/docs/core/testing/mstest-analyzers/mstest0030.md index 4894942740f02..b0dfc7c6394e9 100644 --- a/docs/core/testing/mstest-analyzers/mstest0030.md +++ b/docs/core/testing/mstest-analyzers/mstest0030.md @@ -25,7 +25,7 @@ ms.author: enjieid ## Cause -Type contaning `[TestMethod]` should be marked with `[TestClass]`, otherwise the test method will be silently ignored. +Type containing `[TestMethod]` should be marked with `[TestClass]`, otherwise the test method will be silently ignored. ## Rule description From 2729b5358f4d595f233c67038ebfe3546fd813a3 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Fri, 26 Jul 2024 10:32:52 -0500 Subject: [PATCH 3/8] Update dotnet format description (#41912) Add that dotnet format will apply static analysis recommendations, and not just "style preferences". --- docs/core/tools/dotnet-format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/tools/dotnet-format.md b/docs/core/tools/dotnet-format.md index b37cc7e93569d..6e78575124d83 100644 --- a/docs/core/tools/dotnet-format.md +++ b/docs/core/tools/dotnet-format.md @@ -21,7 +21,7 @@ dotnet format -h|--help ## Description -`dotnet format` is a code formatter that applies style preferences to a project or solution. Preferences will be read from an *.editorconfig* file, if present, otherwise a default set of preferences will be used. For more information, see the [EditorConfig documentation](../../fundamentals/code-analysis/configuration-files.md#editorconfig). +`dotnet format` is a code formatter that applies style preferences and static analysis recommendations to a project or solution. Preferences will be read from an *.editorconfig* file, if present, otherwise a default set of preferences will be used. For more information, see the [EditorConfig documentation](../../fundamentals/code-analysis/configuration-files.md#editorconfig). ## Arguments From e222d75e837763db60e4d9eb7c5401cd52ad425c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?VERNOU=20C=C3=A9dric?= <1659796+vernou@users.noreply.github.com> Date: Fri, 26 Jul 2024 17:44:22 +0200 Subject: [PATCH 4/8] fix(CommandLine): examples (#41823) --- docs/standard/commandline/get-started-tutorial.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/standard/commandline/get-started-tutorial.md b/docs/standard/commandline/get-started-tutorial.md index 38e1df67c6e1a..6e5f6e4ef8655 100644 --- a/docs/standard/commandline/get-started-tutorial.md +++ b/docs/standard/commandline/get-started-tutorial.md @@ -93,9 +93,11 @@ You can use any of the following ways to test while developing a command-line ap * Use `dotnet run` and pass option values to the app instead of to the `run` command by including them after `--`, as in the following example: ```dotnetcli - dotnet run -- --file scl.runtimeconfig.json + dotnet run -- --file bin/Debug/net6.0/scl.runtimeconfig.json ``` +The working directory is the project folder (the folder that has the .csproj file), so the relative path to `scl.runtimeconfig.json` is from the project folder. + In .NET 7.0.100 SDK Preview, you can use the `commandLineArgs` of a *launchSettings.json* file by running the command `dotnet run --launch-profile `. * [Publish the project to a folder](../../core/tutorials/publishing-with-visual-studio-code.md), open a command prompt to that folder, and run the executable: From 10fba997558c3dbc4d1223557db49257b6763de6 Mon Sep 17 00:00:00 2001 From: Tom Dykstra Date: Fri, 26 Jul 2024 08:50:28 -0700 Subject: [PATCH 5/8] dotnet-nuget-add-source - new option is available in .NET 9 SDK (#41909) --- docs/core/tools/dotnet-nuget-add-source.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/tools/dotnet-nuget-add-source.md b/docs/core/tools/dotnet-nuget-add-source.md index 57a27fcc9e118..5fe3d3a6b0de0 100644 --- a/docs/core/tools/dotnet-nuget-add-source.md +++ b/docs/core/tools/dotnet-nuget-add-source.md @@ -40,7 +40,7 @@ The `dotnet nuget add source` command adds a new package source to your NuGet co - **`--allow-insecure-connections`** - Allows HTTP connections for adding or updating packages. This method is not secure. + Allows HTTP connections for adding or updating packages. This method is not secure. Available since .NET 9 SDK. - **`-n|--name `** From c498f135c2be258e0d0495c94911f9bd0863703e Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 26 Jul 2024 09:05:50 -0700 Subject: [PATCH 6/8] Change 4.8.1 to 4.8 (#41906) --- docs/framework/install/on-server-2019.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/framework/install/on-server-2019.md b/docs/framework/install/on-server-2019.md index df5a0a2878ca3..259f4056653ea 100644 --- a/docs/framework/install/on-server-2019.md +++ b/docs/framework/install/on-server-2019.md @@ -13,7 +13,7 @@ ms.date: 06/27/2024 .NET Framework 4.8 is the last supported version of .NET Framework for Windows Server 2019. > [!div class="button"] -> [Download .NET Framework 4.8.1](https://dotnet.microsoft.com/download/dotnet-framework/net481) +> [Download .NET Framework 4.8](https://dotnet.microsoft.com/download/dotnet-framework/net48) ## .NET Framework 3.5 From 13d7690fb7d2d4466330343ab3653c64b2e5f5e4 Mon Sep 17 00:00:00 2001 From: Scott Addie <10702007+scottaddie@users.noreply.github.com> Date: Fri, 26 Jul 2024 13:32:58 -0500 Subject: [PATCH 7/8] Update target framework statement for Azure SDK (#41917) * Update target framework statement for Azure SDK * Link to specific section of netstandard doc --- docs/azure/sdk/azure-sdk-for-dotnet.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/azure/sdk/azure-sdk-for-dotnet.md b/docs/azure/sdk/azure-sdk-for-dotnet.md index fcfd1c1055c89..7dcfb1b3e062b 100644 --- a/docs/azure/sdk/azure-sdk-for-dotnet.md +++ b/docs/azure/sdk/azure-sdk-for-dotnet.md @@ -3,16 +3,16 @@ title: Azure SDK for .NET Overview description: Provides an overview of what the Azure SDK for .NET is and the basic steps to use the SDK in a .NET application ms.topic: conceptual ms.custom: devx-track-dotnet, engagement-fy23 -ms.date: 3/23/2023 +ms.date: 07/26/2024 --- # Azure SDK for .NET overview ## What is the Azure SDK for .NET -The **Azure SDK for .NET** is designed to make it easy to use Azure services from your .NET applications. Whether it is uploading and downloading files to Blob Storage, retrieving application secrets from Azure Key Vault, or processing notifications from Azure Event Hubs, the Azure SDK for .NET provides a consistent and familiar interface to access Azure services. +The **Azure SDK for .NET** is designed to make it easy to use Azure services from your .NET applications. Whether it's uploading and downloading files to Blob Storage, retrieving application secrets from Azure Key Vault, or processing notifications from Azure Event Hubs, the Azure SDK for .NET provides a consistent and familiar interface to access Azure services. -The Azure SDK for .NET is available as series of NuGet packages that can be used in both .NET Core (2.1 and higher) and .NET Framework (4.7.2 and higher) applications. +The Azure SDK for .NET is a collection of NuGet packages that can be used in applications targeting .NET variants that implement [.NET Standard 2.0](/dotnet/standard/net-standard?tabs=net-standard-2-0#select-net-standard-version). :::image type="content" source="./media/azure-sdk-for-dotnet-overview.png" alt-text="Diagram showing how .NET applications use the Azure SDK to access Azure services."::: From 85b928ae353f798651d83dfaa571c1b204dece5e Mon Sep 17 00:00:00 2001 From: David Pine Date: Fri, 26 Jul 2024 14:01:07 -0500 Subject: [PATCH 8/8] Update dependency-injection-basics.md (#41903) Fixes #41902 --- docs/core/extensions/dependency-injection-basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/extensions/dependency-injection-basics.md b/docs/core/extensions/dependency-injection-basics.md index 4c43a2f0d50ec..2b7f96bf6159f 100644 --- a/docs/core/extensions/dependency-injection-basics.md +++ b/docs/core/extensions/dependency-injection-basics.md @@ -61,7 +61,7 @@ Next, create an _IGreetingService.cs_ file and add the following C# code: :::code source="snippets/di/di-basics/IGreetingService.cs"::: -Then add a new C# file named _DeafultGreetingService.cs_ and add the following code: +Then add a new C# file named DefaultGreetingService.cs_ and add the following code: :::code source="snippets/di/di-basics/DefaultGreetingService.cs":::