From d23fc9f5e1394cd655d1ab5ad3f0a8df50b285fa Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Thu, 17 Jul 2025 15:39:08 +0200 Subject: [PATCH 01/11] Update microsoft-testing-platform-vs-vstest.md (#47437) --- docs/core/testing/microsoft-testing-platform-vs-vstest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/testing/microsoft-testing-platform-vs-vstest.md b/docs/core/testing/microsoft-testing-platform-vs-vstest.md index 81c0081754ada..8ce80848f29a3 100644 --- a/docs/core/testing/microsoft-testing-platform-vs-vstest.md +++ b/docs/core/testing/microsoft-testing-platform-vs-vstest.md @@ -117,7 +117,7 @@ Visual Studio Test Explorer supports the new test platform starting with version #### Visual Studio Code -Visual Studio Code Test Explorer supports the new test platform starting with version X. +Visual Studio Code with C# DevKit supports the new test platform. ### Azure DevOps From 2680077b8ef2c15680e9e1b50fb52d231febe41c Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 11:08:57 -0400 Subject: [PATCH 02/11] Fix date typos and terminology in default interface methods tutorial (#47375) * Initial plan * Fix date typos and terminology in default interface methods tutorial Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- .../default-interface-methods-versions.md | 2 +- .../finished/customer-relationship/Program.cs | 4 ++-- .../starter/customer-relationship/Program.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/csharp/advanced-topics/interface-implementation/default-interface-methods-versions.md b/docs/csharp/advanced-topics/interface-implementation/default-interface-methods-versions.md index 1f5a96d54f5aa..f4987b37cf31e 100644 --- a/docs/csharp/advanced-topics/interface-implementation/default-interface-methods-versions.md +++ b/docs/csharp/advanced-topics/interface-implementation/default-interface-methods-versions.md @@ -58,7 +58,7 @@ Notice the following portion of the test: :::code language="csharp" source="./snippets/default-interface-members-versions/finished/customer-relationship/Program.cs" id="SnippetHighlightCast"::: -That cast from `SampleCustomer` to `ICustomer` is necessary. The `SampleCustomer` class doesn't need to provide an implementation for `ComputeLoyaltyDiscount`; that's provided by the `ICustomer` interface. However, the `SampleCustomer` class doesn't inherit members from its interfaces. That rule hasn't changed. In order to call any method declared and implemented in the interface, the variable must be the type of the interface, `ICustomer` in this example. +That implicit conversion from `SampleCustomer` to `ICustomer` is necessary. The `SampleCustomer` class doesn't need to provide an implementation for `ComputeLoyaltyDiscount`; that's provided by the `ICustomer` interface. However, the `SampleCustomer` class doesn't inherit members from its interfaces. That rule hasn't changed. In order to call any method declared and implemented in the interface, the variable must be the type of the interface, `ICustomer` in this example. ## Provide parameterization diff --git a/docs/csharp/advanced-topics/interface-implementation/snippets/default-interface-members-versions/finished/customer-relationship/Program.cs b/docs/csharp/advanced-topics/interface-implementation/snippets/default-interface-members-versions/finished/customer-relationship/Program.cs index 8311fa0e82979..04771d3fec454 100644 --- a/docs/csharp/advanced-topics/interface-implementation/snippets/default-interface-members-versions/finished/customer-relationship/Program.cs +++ b/docs/csharp/advanced-topics/interface-implementation/snippets/default-interface-members-versions/finished/customer-relationship/Program.cs @@ -5,14 +5,14 @@ Reminders = { { new DateTime(2010, 08, 12), "childs's birthday" }, - { new DateTime(1012, 11, 15), "anniversary" } + { new DateTime(2012, 11, 15), "anniversary" } } }; SampleOrder o = new SampleOrder(new DateTime(2012, 6, 1), 5m); c.AddOrder(o); -o = new SampleOrder(new DateTime(2103, 7, 4), 25m); +o = new SampleOrder(new DateTime(2013, 7, 4), 25m); c.AddOrder(o); // diff --git a/docs/csharp/advanced-topics/interface-implementation/snippets/default-interface-members-versions/starter/customer-relationship/Program.cs b/docs/csharp/advanced-topics/interface-implementation/snippets/default-interface-members-versions/starter/customer-relationship/Program.cs index f0b294dfba0eb..7b1cb6c504484 100644 --- a/docs/csharp/advanced-topics/interface-implementation/snippets/default-interface-members-versions/starter/customer-relationship/Program.cs +++ b/docs/csharp/advanced-topics/interface-implementation/snippets/default-interface-members-versions/starter/customer-relationship/Program.cs @@ -5,14 +5,14 @@ Reminders = { { new DateTime(2010, 08, 12), "childs's birthday" }, - { new DateTime(1012, 11, 15), "anniversary" } + { new DateTime(2012, 11, 15), "anniversary" } } }; SampleOrder o = new SampleOrder(new DateTime(2012, 6, 1), 5m); c.AddOrder(o); -o = new SampleOrder(new DateTime(2103, 7, 4), 25m); +o = new SampleOrder(new DateTime(2013, 7, 4), 25m); c.AddOrder(o); Console.WriteLine($"Data about {c.Name}"); From badd9fec6a13305b81b2eb6e9a1b81b563dd4f3d Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 15:14:17 +0000 Subject: [PATCH 03/11] Clarify method hiding explanation in polymorphism documentation (#47378) * Initial plan * Clarify method hiding explanation in polymorphism documentation Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> * Fix hyphenation: change 'runtime' to 'run-time' for consistency Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --- docs/csharp/fundamentals/object-oriented/polymorphism.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/csharp/fundamentals/object-oriented/polymorphism.md b/docs/csharp/fundamentals/object-oriented/polymorphism.md index bd2beb760df80..f62506825e912 100644 --- a/docs/csharp/fundamentals/object-oriented/polymorphism.md +++ b/docs/csharp/fundamentals/object-oriented/polymorphism.md @@ -54,10 +54,14 @@ If you want your derived class to have a member with the same name as a member i :::code language="csharp" source="./snippets/inheritance/Inheritance.cs" ID="SnippetNewMethods"::: -Hidden base class members may be accessed from client code by casting the instance of the derived class to an instance of the base class. For example: +When you use the `new` keyword, you're creating a method that *hides* the base class method rather than *overriding* it. This is different from virtual methods. With method hiding, the method that gets called depends on the compile-time type of the variable, not the run-time type of the object. + +Hidden base class members can be accessed from client code by casting the instance of the derived class to an instance of the base class. For example: :::code language="csharp" source="./snippets/inheritance/Inheritance.cs" ID="SnippetUseNewMethods"::: +In this example, both variables refer to the same object instance, but the method that gets called depends on the variable's declared type: `DerivedClass.DoWork()` when accessed through the `DerivedClass` variable, and `BaseClass.DoWork()` when accessed through the `BaseClass` variable. + ### Prevent derived classes from overriding virtual members Virtual members remain virtual, regardless of how many classes have been declared between the virtual member and the class that originally declared it. If class `A` declares a virtual member, and class `B` derives from `A`, and class `C` derives from `B`, class `C` inherits the virtual member, and may override it, regardless of whether class `B` declared an override for that member. The following code provides an example: From f68407653d67e9b31e605de0db6cb57ac4c4ce31 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 11:15:40 -0400 Subject: [PATCH 04/11] Update CS1617 documentation to clarify how to list supported C# language versions (#47377) * Initial plan * Update CS1617 documentation to clarify how to list supported language versions Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> * Apply review feedback: improve headings and text clarity per style guide Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --- docs/csharp/misc/cs1617.md | 39 +++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/csharp/misc/cs1617.md b/docs/csharp/misc/cs1617.md index b2a6f184bc00b..9e86f2e2731b0 100644 --- a/docs/csharp/misc/cs1617.md +++ b/docs/csharp/misc/cs1617.md @@ -10,12 +10,49 @@ ms.assetid: fd3371ed-39eb-4d3d-b8f5-d96ac0c79398 --- # Compiler Error CS1617 -Invalid option 'option' for **LangVersion**. Use `?` to list supported values. +Invalid option 'option' for **LangVersion**. Use `?` to list supported values. This error occurs if you used the [**LangVersion**](../language-reference/compiler-options/language.md#langversion) command line switch or project setting but didn't specify a valid language option. To resolve this error, check the command line syntax or project setting and change it to one of the listed options. For example, compiling with `csc -langversion:ISO` will generate error CS1617. +## How to list supported language versions + +To see a list of supported language versions, you reference the table in this article, compile with `-langversion:?`, or temporarily set `?` in your project file before building. + +### Use the reference table (recommended) + +The most reliable way to see supported language versions is to consult the reference table at the end of this article, which lists all currently supported language versions. + +### Use the C# compiler directly + +Use the `-langversion:?` option with the C# compiler. You need to find the path to `csc.dll` in your .NET SDK installation: + +```console +dotnet exec "/path/to/dotnet/sdk/version/Roslyn/bincore/csc.dll" -langversion:? +``` + +For example, on Linux with .NET 8 SDK: + +```console +dotnet exec "/usr/lib/dotnet/sdk/8.0.117/Roslyn/bincore/csc.dll" -langversion:? +``` + +The exact path varies based on your operating system and .NET SDK version. + +### Use a project file with diagnostic output (not recommended) + +You can temporarily set `?` in your project file and build with diagnostic verbosity: + +```console +dotnet build -v diagnostic +``` + +Look for the "Supported language versions:" line in the output. + +> [!WARNING] +> Setting `?` in a project file will cause the build to fail after displaying the supported versions. This is because the compiler exits after listing the versions instead of continuing to compile your code. Remove this setting after viewing the list. + ## Valid values for -langversion The valid values for the language versions depend on the .NET version you are using. See [the language version rules](../language-reference/language-versioning.md#defaults) for more information on which language version is available with which version of .NET. If you are receiving this error while attempting to use a newer language version, either downgrade to a lower language version or update your .NET SDK to a version that supports the language version. From 2d6f0fe9c74b9c17cfcd3944ebbdbf5c695023aa Mon Sep 17 00:00:00 2001 From: Nikita Balabaev Date: Thu, 17 Jul 2025 22:33:58 +0700 Subject: [PATCH 05/11] Improve "Async return types" docs (#47289) * Update async-return-types.md * Update docs/csharp/asynchronous-programming/async-return-types.md --------- Co-authored-by: Bill Wagner --- docs/csharp/asynchronous-programming/async-return-types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/asynchronous-programming/async-return-types.md b/docs/csharp/asynchronous-programming/async-return-types.md index 140ace1bed4d3..c88d6fb9243f6 100644 --- a/docs/csharp/asynchronous-programming/async-return-types.md +++ b/docs/csharp/asynchronous-programming/async-return-types.md @@ -71,7 +71,7 @@ The following example shows the behavior of an async event handler. In the examp ## Generalized async return types and ValueTask\ -An async method can return any type that has an accessible `GetAwaiter` method that returns an instance of an *awaiter type*. In addition, the type returned from the `GetAwaiter` method must have the attribute. You can learn more in the article on [Attributes read by the compiler](../language-reference/attributes/general.md#asyncmethodbuilder-attribute) or the C# spec for the [Task type builder pattern](~/_csharpstandard/standard/classes.md#15142-task-type-builder-pattern). +An async method can return any type that has an accessible `GetAwaiter` method that returns an instance of an *awaiter type*. In addition, the returned type must match the type of the parameter of `SetResult` and returned type of the `Task` property on the type specified by the attribute. You can learn more in the article on [Attributes read by the compiler](../language-reference/attributes/general.md#asyncmethodbuilder-attribute) or the C# spec for the [Task type builder pattern](~/_csharpstandard/standard/classes.md#15142-task-type-builder-pattern). This feature is the complement to [awaitable expressions](~/_csharpstandard/standard/expressions.md#12982-awaitable-expressions), which describes the requirements for the operand of `await`. Generalized async return types enable the compiler to generate `async` methods that return different types. Generalized async return types enabled performance improvements in the .NET libraries. Because and are reference types, memory allocation in performance-critical paths, particularly when allocations occur in tight loops, can adversely affect performance. Support for generalized return types means that you can return a lightweight value type instead of a reference type to avoid more memory allocations. From 058b1e932005d484256d7ddfa0ce678623343e6e Mon Sep 17 00:00:00 2001 From: Radek Zikmund <32671551+rzikm@users.noreply.github.com> Date: Thu, 17 Jul 2025 17:47:01 +0200 Subject: [PATCH 06/11] Mention HTTP-specific actions for revocation check breaking change (#47384) * Mention HTTP-specific actions for revocation check breaking change This should make the recommended actions more easily applicable for users which do not use SslStream directly, but use HttpClient instead. * Apply suggestions from code review Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --------- Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- ...sl-certificate-revocation-check-default.md | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/docs/core/compatibility/networking/10.0/ssl-certificate-revocation-check-default.md b/docs/core/compatibility/networking/10.0/ssl-certificate-revocation-check-default.md index a012c0e6dc9e9..fc2e5857e0a3e 100644 --- a/docs/core/compatibility/networking/10.0/ssl-certificate-revocation-check-default.md +++ b/docs/core/compatibility/networking/10.0/ssl-certificate-revocation-check-default.md @@ -8,7 +8,11 @@ ms.custom: https://github.com/dotnet/docs/issues/46824 # HttpClient/SslStream default certificate revocation check mode changed to `Online` -The default values of and have changed from `NoCheck` to `Online`. This change enhances security and makes the behavior consistent with . +The default values of and have changed from `NoCheck` to `Online`. + +The default values of and have changed from `false` to `true`. + +This change enhances security and makes the behavior consistent with . ## Version introduced @@ -16,11 +20,11 @@ The default values of and were , meaning revocation status of peer certificates wasn't checked by default. +Previously, the default values of and were , and the default values of and were `false`, meaning revocation status of peer certificates wasn't checked by default. ## New behavior -Starting in .NET 10, the default values of and are , meaning revocation status of peer certificates are checked online by default. +Starting in .NET 10, the default values of and are , and the default values of and are `true`, meaning revocation status of peer certificates are checked online by default. ## Type of breaking change @@ -32,7 +36,7 @@ This change enhances security and ensures consistency between APIs related to X. ## Recommended action -If certificate revocation checking is not desired, specify explicitly: +If certificate revocation checking is not desired and you are using directly, specify explicitly: ```csharp var clientOptions = new SslClientAuthenticationOptions @@ -48,8 +52,30 @@ var serverOptions = new SslServerAuthenticationOptions }; ``` +When using you need to configure the underlying handler during creation: + +```csharp +var withHttpClientHandler = new HttpClient(new HttpClientHandler +{ + CheckCertificateRevocationList = false +}); + +var withWinHttpHandler = new HttpClient(new WinHttpHandler +{ + CheckCertificateRevocationList = false +}); + +var withSocketsHttpHandler = new HttpClient(new SocketsHttpHandler +{ + SslOptions = + { + CertificateRevocationCheckMode = X509RevocationMode.NoCheck + } +}); +``` + > [!NOTE] -> Due to a bug on the OSX platform, you might encounter certificate validation failures with in scenarios where the certificate doesn't support revocation checking via OCSP. This is a bug in the underlying platform crypto implementation. To avoid failing the certificate validation if revocation status can't be retrieved, either disable certificate revocation checking as per the previous instructions, or set with set to `X509VerificationFlags.IgnoreEndRevocationUnknown | X509VerificationFlags.IgnoreCertificateAuthorityRevocationUnknown`. +> Due to a bug on the OSX platform, you might encounter certificate validation failures with in scenarios where the certificate doesn't support revocation checking via OCSP. This is a bug in the underlying platform crypto implementation. To avoid failing the certificate validation if revocation status can't be retrieved, either disable certificate revocation checking as per the previous instructions, or set to with set to `X509VerificationFlags.IgnoreEndRevocationUnknown | X509VerificationFlags.IgnoreCertificateAuthorityRevocationUnknown`. In situations where you can't modify the code, you can restore the previous behavior with one of the following settings: From 712b62c97df3ece9bdc1cc6356b51091dc158361 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 17 Jul 2025 09:02:14 -0700 Subject: [PATCH 07/11] fix build warnings/suggestions (#47432) --- .openpublishing.redirection.core.json | 3 +-- .../aspnet-core/8.0/securitytoken-events.md | 10 +++++----- docs/core/extensions/httpclient-http3.md | 1 - .../fundamentals/code-analysis/quality-rules/ca1835.md | 5 ++--- .../fundamentals/code-analysis/quality-rules/ca2016.md | 1 - .../fundamentals/code-analysis/quality-rules/ca5404.md | 4 ++-- .../fundamentals/code-analysis/quality-rules/ca5405.md | 2 +- docs/fundamentals/code-analysis/quality-rules/index.md | 4 ++-- .../code-analysis/quality-rules/security-warnings.md | 4 ++-- docs/fundamentals/networking/telemetry/tracing.md | 3 +-- .../how-to-guides/ner-dataset-guide.md | 1 - 11 files changed, 16 insertions(+), 22 deletions(-) diff --git a/.openpublishing.redirection.core.json b/.openpublishing.redirection.core.json index f2867967dd53f..0942f98aa4975 100644 --- a/.openpublishing.redirection.core.json +++ b/.openpublishing.redirection.core.json @@ -1345,8 +1345,7 @@ }, { "source_path_from_root": "/docs/whats-new/dotnet-7-docs.md", - "redirect_url": "/dotnet/whats-new/dotnet-docs-mod0", - "redirect_document_id": true + "redirect_url": "/dotnet/whats-new" }, { "source_path_from_root": "/docs/core/whats-new/dotnet-8.md", diff --git a/docs/core/compatibility/aspnet-core/8.0/securitytoken-events.md b/docs/core/compatibility/aspnet-core/8.0/securitytoken-events.md index 2077524457eab..b10342cfa9da7 100644 --- a/docs/core/compatibility/aspnet-core/8.0/securitytoken-events.md +++ b/docs/core/compatibility/aspnet-core/8.0/securitytoken-events.md @@ -5,7 +5,7 @@ ms.date: 07/31/2023 --- # Security token events return a JsonWebToken -The , , and events are authentication events fired respectively by the [JwtBearer](xref:Microsoft.AspNetCore.Authentication.JwtBearer), [WsFederation](xref:Microsoft.AspNetCore.Authentication.WsFederation), and [OpenIdConnect](xref:Microsoft.AspNetCore.Authentication.OpenIdConnect) authentication handlers. For example, the event is fired when a security token is validated. These events are fired with a context (for example, ) that exposes a property of abstract type . The default real implementation of changed from to . +The , , and events are authentication events fired respectively by the [JwtBearer](xref:Microsoft.AspNetCore.Authentication.JwtBearer), [WsFederation](xref:Microsoft.AspNetCore.Authentication.WsFederation), and [OpenIdConnect](xref:Microsoft.AspNetCore.Authentication.OpenIdConnect) authentication handlers. For example, the event is fired when a security token is validated. These events are fired with a context (for example, ) that exposes a property of abstract type . The default real implementation of changed from `System.IdentityModel.Tokens.Jwt.JwtSecurityToken` to . ## Version introduced @@ -13,13 +13,13 @@ ASP.NET Core 8.0 Preview 7 ## Previous behavior -Previously, the affected `SecurityToken` properties were implemented by , which derives from . is the previous generation of JSON Web Token (JWT) implementation. The tokens were produced by . +Previously, the affected `SecurityToken` properties were implemented by `System.IdentityModel.Tokens.Jwt.JwtSecurityToken`, which derives from . `JwtSecurityToken` is the previous generation of JSON Web Token (JWT) implementation. The `JwtSecurityToken` tokens were produced by . -In addition, the field provided the default claim type mapping for inbound claims. +In addition, the `JwtSecurityTokenHandler.DefaultInboundClaimTypeMap` field provided the default claim type mapping for inbound claims. ## New behavior -Starting in ASP.NET Core 8.0, the class, which also derives from , implements the `SecurityToken` properties, by default. tokens are produced by more optimized handlers. +Starting in ASP.NET Core 8.0, the class, which also derives from , implements the `SecurityToken` properties, by default. tokens are produced by more optimized `TokenHandler` handlers. In addition, the field provides the default claim type mapping for inbound claims. @@ -37,7 +37,7 @@ This change was made because || || with `CancellationToken` set to `default` in C#, or `Nothing` in Visual Basic.| ||| diff --git a/docs/fundamentals/code-analysis/quality-rules/ca2016.md b/docs/fundamentals/code-analysis/quality-rules/ca2016.md index 6d19365b56551..6e16a8dea2ee2 100644 --- a/docs/fundamentals/code-analysis/quality-rules/ca2016.md +++ b/docs/fundamentals/code-analysis/quality-rules/ca2016.md @@ -9,7 +9,6 @@ helpviewer_keywords: - "ForwardCancellationTokenToInvocations" - "CA2016" author: carlossanlop -ms.author: calope dev_langs: - CSharp - VB diff --git a/docs/fundamentals/code-analysis/quality-rules/ca5404.md b/docs/fundamentals/code-analysis/quality-rules/ca5404.md index 25aedef884937..f5974b4544dcf 100644 --- a/docs/fundamentals/code-analysis/quality-rules/ca5404.md +++ b/docs/fundamentals/code-analysis/quality-rules/ca5404.md @@ -18,7 +18,7 @@ f1_keywords: ## Cause -Setting properties `RequireExpirationTime`, `ValidateAudience`, `ValidateIssuer`, or `ValidateLifetime` to `false`. +Setting the `Microsoft.IdentityModel.Tokens.TokenValidationParameters` properties `RequireExpirationTime`, `ValidateAudience`, `ValidateIssuer`, or `ValidateLifetime` to `false`. ## Rule description @@ -28,7 +28,7 @@ More details about best practices for token validation can be found on the [libr ## How to fix violations -Set properties `RequireExpirationTime`, `ValidateAudience`, `ValidateIssuer`, or `ValidateLifetime` to `true`. Or, remove the assignment to `false` because the default value is `true`. +Set the `Microsoft.IdentityModel.Tokens.TokenValidationParameters` properties `RequireExpirationTime`, `ValidateAudience`, `ValidateIssuer`, and `ValidateLifetime` to `true`. Or, remove the assignment to `false` because the default value is `true`. ## When to suppress warnings diff --git a/docs/fundamentals/code-analysis/quality-rules/ca5405.md b/docs/fundamentals/code-analysis/quality-rules/ca5405.md index 63d9d990bc778..fe875ab85460e 100644 --- a/docs/fundamentals/code-analysis/quality-rules/ca5405.md +++ b/docs/fundamentals/code-analysis/quality-rules/ca5405.md @@ -18,7 +18,7 @@ f1_keywords: ## Cause -The callback assigned to or always returns `true`. +The callback assigned to `AudienceValidator` or `LifetimeValidator` always returns `true`. ## Rule description diff --git a/docs/fundamentals/code-analysis/quality-rules/index.md b/docs/fundamentals/code-analysis/quality-rules/index.md index 3a5f7c27fc3b8..886ea8e2aef92 100644 --- a/docs/fundamentals/code-analysis/quality-rules/index.md +++ b/docs/fundamentals/code-analysis/quality-rules/index.md @@ -331,8 +331,8 @@ The following table lists code quality analysis rules. > | [CA5401: Do not use CreateEncryptor with non-default IV](ca5401.md) | Symmetric encryption should always use a non-repeatable initialization vector to prevent dictionary attacks. | > | [CA5402: Use CreateEncryptor with the default IV](ca5402.md) | Symmetric encryption should always use a non-repeatable initialization vector to prevent dictionary attacks. | > | [CA5403: Do not hard-code certificate](ca5403.md) | The `data` or `rawData` parameter of a or constructor is hard-coded. | -> | [CA5404: Do not disable token validation checks](ca5404.md) | properties that control token validation should not be set to `false`. | -> | [CA5405: Do not always skip token validation in delegates](ca5405.md) | The callback assigned to or always returns `true`. | +> | [CA5404: Do not disable token validation checks](ca5404.md) | `TokenValidationParameters` properties that control token validation should not be set to `false`. | +> | [CA5405: Do not always skip token validation in delegates](ca5405.md) | The callback assigned to `AudienceValidator` or `LifetimeValidator` always returns `true`. | > | [IL3000: Avoid accessing Assembly file path when publishing as a single file](../../../core/deploying/single-file/warnings/il3000.md) | Avoid accessing Assembly file path when publishing as a single file. | > | [IL3001: Avoid accessing Assembly file path when publishing as a single-file](../../../core/deploying/single-file/warnings/il3001.md) | Avoid accessing Assembly file path when publishing as a single file. | > | [IL3002: Avoid calling members annotated with 'RequiresAssemblyFilesAttribute' when publishing as a single file](../../../core/deploying/single-file/warnings/il3002.md) | Avoid calling members annotated with 'RequiresAssemblyFilesAttribute' when publishing as a single file| diff --git a/docs/fundamentals/code-analysis/quality-rules/security-warnings.md b/docs/fundamentals/code-analysis/quality-rules/security-warnings.md index 34bba9523dffa..6f0cc10d406c1 100644 --- a/docs/fundamentals/code-analysis/quality-rules/security-warnings.md +++ b/docs/fundamentals/code-analysis/quality-rules/security-warnings.md @@ -112,5 +112,5 @@ Security rules support safer libraries and applications. These rules help preven |[CA5401: Do not use CreateEncryptor with non-default IV](ca5401.md)|Symmetric encryption should always use a non-repeatable initialization vector to prevent dictionary attacks.| |[CA5402: Use CreateEncryptor with the default IV](ca5402.md)|Symmetric encryption should always use a non-repeatable initialization vector to prevent dictionary attacks.| |[CA5403: Do not hard-code certificate](ca5403.md)|The `data` or `rawData` parameter of a or constructor is hard-coded.| -| [CA5404: Do not disable token validation checks](ca5404.md) | properties that control token validation should not be set to `false`. | -| [CA5405: Do not always skip token validation in delegates](ca5405.md) | The callback assigned to or always returns `true`. | +| [CA5404: Do not disable token validation checks](ca5404.md) | `TokenValidationParameters` properties that control token validation should not be set to `false`. | +| [CA5405: Do not always skip token validation in delegates](ca5405.md) | The callback assigned to `AudienceValidator` or `LifetimeValidator` always returns `true`. | diff --git a/docs/fundamentals/networking/telemetry/tracing.md b/docs/fundamentals/networking/telemetry/tracing.md index 2f35ba5742287..54fa688d35d78 100644 --- a/docs/fundamentals/networking/telemetry/tracing.md +++ b/docs/fundamentals/networking/telemetry/tracing.md @@ -1,8 +1,7 @@ --- title: Networking tracing -description: Learn how to consume .NET networking Tracing. +description: Learn how to consume .NET networking tracing. author: samsp-msft -ms.author: samsp ms.date: 10/4/2024 --- diff --git a/docs/machine-learning/how-to-guides/ner-dataset-guide.md b/docs/machine-learning/how-to-guides/ner-dataset-guide.md index 726ac6aedc98f..0f96aef2b1973 100644 --- a/docs/machine-learning/how-to-guides/ner-dataset-guide.md +++ b/docs/machine-learning/how-to-guides/ner-dataset-guide.md @@ -3,7 +3,6 @@ title: How to format data for Named Entity Recognition (NER) description: Learn how to format data for the Named Entity Recognition (NER) scenario in Model Builder ms.date: 02/23/2024 author: zewditu -ms.author: zehailem ms.custom: mvc,how-to ms.topic: how-to #Customer intent: As a non-developer, I want to be able to format training data for Model Builder to use for training NER scenarios From e6878f7965a659eb146fb059a6408b364ef9dc34 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 13:59:16 -0400 Subject: [PATCH 08/11] Update DebugType documentation to clarify default behavior and show how to disable PDB generation for Release builds (#47376) * Initial plan * Update DebugType documentation to clarify default behavior and show how to disable PDB generation for Release builds Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> * Move PDB disabling section after values table and improve wording Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --- .../compiler-options/code-generation.md | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/csharp/language-reference/compiler-options/code-generation.md b/docs/csharp/language-reference/compiler-options/code-generation.md index ec4ca0ca8b352..5842b944eb6f9 100644 --- a/docs/csharp/language-reference/compiler-options/code-generation.md +++ b/docs/csharp/language-reference/compiler-options/code-generation.md @@ -24,7 +24,7 @@ The following options control code generation by the compiler. The new MSBuild s ## DebugType -The **DebugType** option causes the compiler to generate debugging information and place it in the output file or files. Debugging information is added by default. +The **DebugType** option causes the compiler to generate debugging information and place it in the output file or files. The default value is `portable` for both Debug and Release build configurations, which means PDB files are generated by default for all configurations. ```xml pdbonly @@ -40,11 +40,33 @@ The following values are valid: | `pdbonly` | Same as `full`. See the note below for more information. | | `portable` | Emit debugging information to .pdb file using cross-platform [Portable PDB](https://github.com/dotnet/designs/blob/main/accepted/2020/diagnostics/portable-pdb.md) format. | | `embedded` | Emit debugging information into the _.dll/.exe_ itself (_.pdb_ file is not produced) using [Portable PDB](https://github.com/dotnet/designs/blob/main/accepted/2020/diagnostics/portable-pdb.md) format. | +| `none` | Don't produce a PDB file. | > [!IMPORTANT] > The following information applies only to compilers older than C# 6.0. > The value of this element can be either `full` or `pdbonly`. The *full* argument, which is in effect if you don't specify *pdbonly*, enables attaching a debugger to the running program. Specifying *pdbonly* allows source code debugging when the program is started in the debugger but will only display assembler when the running program is attached to the debugger. Use this option to create debug builds. If you use *Full*, be aware that there's some impact on the speed and size of JIT optimized code and a small impact on code quality with *full*. We recommend *pdbonly* or no PDB for generating release code. One difference between *pdbonly* and *full* is that with *full* the compiler emits a , which is used to tell the JIT compiler that debug information is available. Therefore, you will get an error if your code contains the set to false if you use *full*. For more information on how to configure the debug performance of an application, see [Making an Image Easier to Debug](../../../framework/debug-trace-profile/making-an-image-easier-to-debug.md). +### Disable PDB generation for Release builds + +To suppress PDB file generation for Release builds while keeping them for Debug builds, add the following property to your project file: + +```xml + + none + +``` + +Alternatively, you can set `DebugSymbols` to `false` for Release builds: + +```xml + + false + +``` + +> [!NOTE] +> In .NET 8 and later versions, setting `DebugSymbols` to `false` should suppress PDB generation according to the [breaking change documentation](../../../core/compatibility/sdk/8.0/debugsymbols.md). However, the most reliable way to disable PDB generation is to explicitly set `DebugType` to `none`. + ## Optimize The **Optimize** option enables or disables optimizations performed by the compiler to make your output file smaller, faster, and more efficient. The *Optimize* option is enabled by default for a *Release* build configuration. It is off by default for a *Debug* and any other build configuration. From b6000b0fb447309a3e0e0b21b8f33fee910ed39f Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 17 Jul 2025 12:53:17 -0700 Subject: [PATCH 09/11] Update package index with latest published versions (#47441) --- docs/azure/includes/dotnet-all.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/azure/includes/dotnet-all.md b/docs/azure/includes/dotnet-all.md index d1b5c808b9b00..e97830a67b0eb 100644 --- a/docs/azure/includes/dotnet-all.md +++ b/docs/azure/includes/dotnet-all.md @@ -412,7 +412,7 @@ | Speech Extension Telemetry | NuGet [1.45.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.Telemetry/1.45.0) | | | | System Net Client Model | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/System.Net.ClientModel/1.0.0-beta.1) | | | | Unknown Display Name | NuGet [0.10.9-akri](https://www.nuget.org/packages/Azure.Iot.Operations.Connector/0.10.9-akri) | | | -| Unknown Display Name | NuGet [1.1.0-preview](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.AzureCosmosDb.Mongo/1.1.0-preview) | | | +| Unknown Display Name | NuGet [1.1.1-preview](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.AzureCosmosDb.Mongo/1.1.1-preview) | | | | Unknown Display Name | NuGet [1.45.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.MAS/1.45.0) | | | | WebJobs Extension MySQL | NuGet [1.0.129](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.MySql/1.0.129) | | | | Anomaly Detector | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.AnomalyDetector/1.0.0) | | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.AnomalyDetector_1.0.0-preview.1/sdk/cognitiveservices/AnomalyDetector) | From 16daaa242d1c694f9873934d08df489777d925b1 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 13:58:58 -0700 Subject: [PATCH 10/11] Add guidance on identifying conflicting assemblies in CS0433 compiler error documentation (#47379) * Initial plan * Add guidance on identifying conflicting assemblies in CS0433 error Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> * Move "How to identify conflicting assemblies" section after "This error can also occur if" section Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --- .../language-reference/compiler-messages/cs0433.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/csharp/language-reference/compiler-messages/cs0433.md b/docs/csharp/language-reference/compiler-messages/cs0433.md index fe64b64a11667..c511b32b17e3e 100644 --- a/docs/csharp/language-reference/compiler-messages/cs0433.md +++ b/docs/csharp/language-reference/compiler-messages/cs0433.md @@ -20,6 +20,16 @@ This error can also occur if: * The `@ Page` directive has a `CodeFile` attribute when it should be a `CodeBehind` attribute. * Code is placed in an *App_Code* folder that shouldn't reside there. + +## How to identify the conflicting assemblies + +The full error message shows which assemblies contain the conflicting type. The message format is: + +``` +error CS0433: The type 'N.C' exists in both 'A, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'B, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' +``` + +In this example, the conflicting assemblies are **A** and **B**. The assembly names appear in single quotes before the version information. Use these assembly names to determine which references are causing the conflict and decide how to resolve it. ## Examples From 8c77c47e26d73929b2ef36da1800bcd590650dc3 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 17 Jul 2025 15:53:22 -0700 Subject: [PATCH 11/11] Add periods to bullets (#47430) --- .github/copilot-instructions.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index c48ae856aeb87..8e8b966ebdb7e 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -24,7 +24,9 @@ Use "might" instead of "may" to indicate possibility. For example, "This method Use the Oxford comma in lists of three or more items. -Number ordered list items all as "1." instead of "1.", "2.", etc. Use bullets for unordered lists. +Number ordered list items all as "1." instead of "1.", "2.", etc. + +Use bullets for unordered lists. Unless *all* the bullet list items are three words or less, each bullet item should end with a period. Use **bold** when referring to UI elements. Use `code style` for file names and folders, custom types, and other text that should never be localized.