From 822a25bd10ea2ff6796c8e1dfdf33c4248fbc3af Mon Sep 17 00:00:00 2001 From: Adit Sheth Date: Sat, 28 Dec 2024 00:25:16 +0530 Subject: [PATCH 1/4] Fix CA2000 Warning: Properly Dispose of RegistryKey in Example Code. (#44089) --- .../migration-guide/snippets/csharp/versions-installed.cs | 3 ++- .../snippets/visual-basic/versions-installed.vb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/framework/migration-guide/snippets/csharp/versions-installed.cs b/docs/framework/migration-guide/snippets/csharp/versions-installed.cs index 9439b53d070f1..b951f15025c62 100644 --- a/docs/framework/migration-guide/snippets/csharp/versions-installed.cs +++ b/docs/framework/migration-guide/snippets/csharp/versions-installed.cs @@ -98,7 +98,8 @@ private static void Get45PlusFromRegistry() // const string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\"; - using (var ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey)) + using (var baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32)) + using (var ndpKey = baseKey.OpenSubKey(subkey)) { if (ndpKey != null && ndpKey.GetValue("Release") != null) { diff --git a/docs/framework/migration-guide/snippets/visual-basic/versions-installed.vb b/docs/framework/migration-guide/snippets/visual-basic/versions-installed.vb index f2a882f6db09e..b760cc9194923 100644 --- a/docs/framework/migration-guide/snippets/visual-basic/versions-installed.vb +++ b/docs/framework/migration-guide/snippets/visual-basic/versions-installed.vb @@ -72,7 +72,8 @@ Module Program Private Sub Get45PlusFromRegistry() Const subkey As String = "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" - Using ndpKey As RegistryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey) + Using baseKey As RegistryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32), + ndpKey As RegistryKey = baseKey.OpenSubKey(subkey) If ndpKey IsNot Nothing AndAlso ndpKey.GetValue("Release") IsNot Nothing Then Console.WriteLine($".NET Framework Version: {CheckFor45PlusVersion(ndpKey.GetValue("Release"))}") Else From 2028e2509e6885edb7de8b792476f835337f5ca8 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 27 Dec 2024 11:09:05 -0800 Subject: [PATCH 2/4] Add no-loc words (#44094) --- .../how-to-view-certificates-with-the-mmc-snap-in.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/framework/wcf/feature-details/how-to-view-certificates-with-the-mmc-snap-in.md b/docs/framework/wcf/feature-details/how-to-view-certificates-with-the-mmc-snap-in.md index e753a3abe90a6..c088ce3258666 100644 --- a/docs/framework/wcf/feature-details/how-to-view-certificates-with-the-mmc-snap-in.md +++ b/docs/framework/wcf/feature-details/how-to-view-certificates-with-the-mmc-snap-in.md @@ -5,6 +5,7 @@ ms.date: 02/25/2019 helpviewer_keywords: - "certificates [WCF], viewing with the MMC snap-in" ms.assetid: 2b8782aa-ebb4-4ee7-974b-90299e356dc5 +no-loc: [certlm.msc, certmgr.msc] --- # How to: View certificates with the MMC snap-in From 3c184a9fae9431edb6cf08efb1182cbf40e935a6 Mon Sep 17 00:00:00 2001 From: fku-incom Date: Fri, 27 Dec 2024 20:10:05 +0100 Subject: [PATCH 3/4] remove unnecessary line (#44091) --- .../csharp/JsonNodeAverageGradeExample.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/standard/serialization/system-text-json/snippets/use-dom-utf8jsonreader-utf8jsonwriter/csharp/JsonNodeAverageGradeExample.cs b/docs/standard/serialization/system-text-json/snippets/use-dom-utf8jsonreader-utf8jsonwriter/csharp/JsonNodeAverageGradeExample.cs index a7a6d3e19e473..97bcf54921648 100644 --- a/docs/standard/serialization/system-text-json/snippets/use-dom-utf8jsonreader-utf8jsonwriter/csharp/JsonNodeAverageGradeExample.cs +++ b/docs/standard/serialization/system-text-json/snippets/use-dom-utf8jsonreader-utf8jsonwriter/csharp/JsonNodeAverageGradeExample.cs @@ -38,8 +38,7 @@ public static void Main() double sum = 0; JsonNode document = JsonNode.Parse(jsonString)!; - JsonNode root = document.Root; - JsonArray studentsArray = root["Students"]!.AsArray(); + JsonArray studentsArray = document["Students"]!.AsArray(); int count = studentsArray.Count; foreach (JsonNode? student in studentsArray) From 59ce76278c13c90446c229eb9d5f2a49fbd2438c Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 27 Dec 2024 11:10:41 -0800 Subject: [PATCH 4/4] Update msbuild-props.md (#44095) --- docs/core/project-sdk/msbuild-props.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/project-sdk/msbuild-props.md b/docs/core/project-sdk/msbuild-props.md index 34490c526d53e..8dd0fa61480d1 100644 --- a/docs/core/project-sdk/msbuild-props.md +++ b/docs/core/project-sdk/msbuild-props.md @@ -1512,7 +1512,7 @@ The `EnableNUnitRunner` property enables or disables the use of the [NUnit runne ### GenerateTestingPlatformEntryPoint -Setting the `GenerateTestingPlatformEntryPoint` property to `false` disables the automatic generation of the program entry point in an MSTest, NUnit, or xUnit test project. You might want to set this property to `false` when you manually define an entry point, or when you reference a test project from an executable that also has an entry point. +Setting the `GenerateTestingPlatformEntryPoint` property to `false` disables the automatic generation of the program entry point in an MSTest or NUnit test project. You might want to set this property to `false` when you manually define an entry point, or when you reference a test project from an executable that also has an entry point. For more information, see [error CS8892](../testing/unit-testing-platform-faq.md#error-cs8892-method-testingplatformentrypointmainstring-will-not-be-used-as-an-entry-point-because-a-synchronous-entry-point-programmainstring-was-found).