diff --git a/docs/architecture/blazor-for-web-forms-developers/pages-routing-layouts.md b/docs/architecture/blazor-for-web-forms-developers/pages-routing-layouts.md index 9fd630bf40e1b..868fb6e190d79 100644 --- a/docs/architecture/blazor-for-web-forms-developers/pages-routing-layouts.md +++ b/docs/architecture/blazor-for-web-forms-developers/pages-routing-layouts.md @@ -10,7 +10,7 @@ ms.date: 09/19/2019 ASP.NET Web Forms apps are composed of pages defined in *.aspx* files. Each page's address is based on its physical file path in the project. When a browser makes a request to the page, the contents of the page are dynamically rendered on the server. The rendering accounts for both the page's HTML markup and its server controls. -In Blazor, each page in the app is a component, typically defined in a *.razor* file, with one or more specified routes. Routing mostly happens client-side without involving a specific server request. The browser first makes a request to the root address of the app. A root `Router` component in the Blazor app then handles intercepting navigation requests and them to the correct component. +In Blazor, each page in the app is a component, typically defined in a *.razor* file, with one or more specified routes. Routing mostly happens client-side without involving a specific server request. The browser first makes a request to the root address of the app. A root `Router` component in the Blazor app then handles intercepting navigation requests and forwards them to the correct component. Blazor also supports *deep linking*. Deep linking occurs when the browser makes a request to a specific route other than the root of the app. Requests for deep links sent to the server are routed to the Blazor app, which then routes the request client-side to the correct component. diff --git a/docs/architecture/cloud-native/logging-with-elastic-stack.md b/docs/architecture/cloud-native/logging-with-elastic-stack.md index 0d088955fcfd7..def90e42f13dc 100644 --- a/docs/architecture/cloud-native/logging-with-elastic-stack.md +++ b/docs/architecture/cloud-native/logging-with-elastic-stack.md @@ -6,7 +6,7 @@ ms.date: 01/19/2021 # Logging with Elastic Stack -There are many good centralized logging tools and they vary in cost from being free, open-source tools, to more expensive options. In many cases, the free tools are as good as or better than the paid offerings. One such tool is a combination of three open-source components: Elastic search, Logstash, and Kibana. +There are many good centralized logging tools and they vary in cost from being free, open-source tools, to more expensive options. In many cases, the free tools are as good as or better than the paid offerings. One such tool is a combination of three open-source components: Elasticsearch, Logstash, and Kibana. Collectively these tools are known as the Elastic Stack or ELK stack. @@ -66,11 +66,11 @@ output { For scenarios where extensive log manipulation isn't needed there's an alternative to Logstash known as [Beats](https://www.elastic.co/products/beats). Beats is a family of tools that can gather a wide variety of data from logs to network data and uptime information. Many applications will use both Logstash and Beats. -Once the logs have been gathered by Logstash, it needs somewhere to put them. While Logstash supports many different outputs, one of the more exciting ones is Elastic search. +Once the logs have been gathered by Logstash, it needs somewhere to put them. While Logstash supports many different outputs, one of the more exciting ones is Elasticsearch. -## Elastic search +## Elasticsearch -Elastic search is a powerful search engine that can index logs as they arrive. It makes running queries against the logs quick. Elastic search can handle huge quantities of logs and, in extreme cases, can be scaled out across many nodes. +Elasticsearch is a powerful search engine that can index logs as they arrive. It makes running queries against the logs quick. Elasticsearch can handle huge quantities of logs and, in extreme cases, can be scaled out across many nodes. Log messages that have been crafted to contain parameters or that have had parameters split from them through Logstash processing, can be queried directly as Elasticsearch preserves this information. diff --git a/docs/architecture/microservices/multi-container-microservice-net-applications/subscribe-events.md b/docs/architecture/microservices/multi-container-microservice-net-applications/subscribe-events.md index c0f8e9b258565..951a6356d3c91 100644 --- a/docs/architecture/microservices/multi-container-microservice-net-applications/subscribe-events.md +++ b/docs/architecture/microservices/multi-container-microservice-net-applications/subscribe-events.md @@ -366,8 +366,8 @@ If the "redelivered" flag is set, the receiver must take that into account, beca - **Eric Brewer. CAP Twelve Years Later: How the "Rules" Have Changed** \ -- **Azure Service Bus. Brokered Messaging: Duplicate Detection** \ - +- **Azure Service Bus. Brokered Messaging: Duplicate Detection**\ + - **Reliability Guide** (RabbitMQ documentation) \ diff --git a/docs/core/compatibility/unsupported-apis.md b/docs/core/compatibility/unsupported-apis.md index daae9b59c4402..966d0b2c151b0 100644 --- a/docs/core/compatibility/unsupported-apis.md +++ b/docs/core/compatibility/unsupported-apis.md @@ -2,7 +2,7 @@ title: Unsupported APIs on .NET Core and .NET 5+ titleSuffix: "" description: Learn which .NET APIs always throw an exception on .NET Core and .NET 5 and later versions. -ms.date: 09/17/2021 +ms.date: 11/23/2021 --- # APIs that always throw exceptions on .NET Core and .NET 5+ @@ -232,6 +232,13 @@ This article organizes the affected APIs by namespace. | Member | Platforms that throw | | - | - | | | All | +| | Linux and macOS | +| | Linux and macOS | +| | Linux and macOS | +| | Linux and macOS | +| | Linux and macOS | +| | Linux and macOS | +| | Linux and macOS | | | All | | | Linux and macOS | | | Linux and macOS | diff --git a/docs/core/project-sdk/msbuild-props.md b/docs/core/project-sdk/msbuild-props.md index e8f8ff15d5519..15deb5f7dd6fa 100644 --- a/docs/core/project-sdk/msbuild-props.md +++ b/docs/core/project-sdk/msbuild-props.md @@ -1,7 +1,7 @@ --- title: MSBuild properties for Microsoft.NET.Sdk description: Reference for the MSBuild properties and items that are understood by the .NET SDK. -ms.date: 09/02/2021 +ms.date: 11/22/2021 ms.topic: reference ms.custom: updateeachrelease --- @@ -317,7 +317,7 @@ The `RuntimeIdentifiers` property lets you specify a semicolon-delimited list of ``` -## SatelliteResourceLanguages +### SatelliteResourceLanguages The `SatelliteResourceLanguages` property lets you specify which languages you want to preserve satellite resource assemblies for during build and publish. Many NuGet packages include localized resource satellite assemblies in the main package. For projects that reference these NuGet packages that don't require localized resources, the localized assemblies can unnecessarily inflate the build and publish output size. By adding the `SatelliteResourceLanguages` property to your project file, only localized assemblies for the languages you specify will be included in the build and publish output. For example, in the following project file, only English (US) resource satellite assemblies will be retained. @@ -348,8 +348,10 @@ For more information about deployment, see [.NET application deployment](../depl The following MSBuild properties are documented in this section: +- [DocumentationFile](#documentationfile) - [EmbeddedResourceUseDependentUponConvention](#embeddedresourceusedependentuponconvention) - [EnablePreviewFeatures](#enablepreviewfeatures) +- [GenerateDocumentationFile](#generatedocumentationfile) - [GenerateRequiresPreviewFeaturesAttribute](#generaterequirespreviewfeaturesattribute) - [OptimizeImplicitlyTriggeredBuild](#optimizeimplicitlytriggeredbuild) @@ -390,6 +392,30 @@ An analyzer warns if this attribute is present on dependencies for projects wher Library authors who intend to ship preview assemblies should set this property to `True`. If an assembly needs to ship with a mixture of preview and non-preview APIs, see the [GenerateRequiresPreviewFeaturesAttribute](#generaterequirespreviewfeaturesattribute) section below. +### DocumentationFile + +The `DocumentationFile` property lets you specify a file name for the XML file that contains the documentation for your library. For IntelliSense to function correctly with your documentation, the file name must be the same as the assembly name and must be in the same directory as the assembly. If you don't specify this property but you do set [GenerateDocumentationFile](#generatedocumentationfile) to `true`, the name of the documentation file defaults to the name of your assembly but with an *.xml* file extension. For this reason, it's often easier to omit this property and use the [GenerateDocumentationFile property](#generatedocumentationfile) instead. + +If you specify this property but you set [GenerateDocumentationFile](#generatedocumentationfile) to `false`, the compiler *does not* generate a documentation file. If you specify this property and omit the [GenerateDocumentationFile property](#generatedocumentationfile), the compiler *does* generate a documentation file. + +```xml + + path/to/file.xml + +``` + +### GenerateDocumentationFile + +The `GenerateDocumentationFile` property controls whether the compiler generates an XML documentation file for your library. If you set this property to `true` and you don't specify a file name via the [DocumentationFile property](#documentationfile), the generated XML file is placed in the same output directory as your assembly and has the same file name (but with an *.xml* extension). + +```xml + + true + +``` + +For more information about generating documentation from code comments, see [XML documentation comments (C#)](../../csharp/language-reference/xmldoc/index.md), [Document your code with XML (Visual Basic)](../../visual-basic/programming-guide/program-structure/documenting-your-code-with-xml.md), or [Document your code with XML (F#)](../../fsharp/language-reference/xml-documentation.md). + ### GenerateRequiresPreviewFeaturesAttribute The `GenerateRequiresPreviewFeaturesAttribute` property is closely related to the [EnablePreviewFeatures](#enablepreviewfeatures) property. If your library uses preview features but you don't want the entire assembly to be marked with the attribute, which would require any consumers to [enable preview features](#enablepreviewfeatures), set this property to `False`. diff --git a/docs/core/run-time-config/index.md b/docs/core/run-time-config/index.md index 4635e1be9aa7a..b5fbdb3271f58 100644 --- a/docs/core/run-time-config/index.md +++ b/docs/core/run-time-config/index.md @@ -130,4 +130,4 @@ export DOTNET_GCRetainVM=1 ## See also -- .NET environment variables](../tools/dotnet-environment-variables.md) +- [.NET environment variables](../tools/dotnet-environment-variables.md) diff --git a/docs/core/whats-new/dotnet-6.md b/docs/core/whats-new/dotnet-6.md index 34afd244e9d70..b0d3464071d24 100644 --- a/docs/core/whats-new/dotnet-6.md +++ b/docs/core/whats-new/dotnet-6.md @@ -26,7 +26,7 @@ This article does not cover all of the new features of .NET 6. To see all of the ## Performance -.NET 6 includes numerous performance improvements. This section lists some of the improvements. For detailed information, see the [Performance improvements in .NET 6](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-6/) blog post. +.NET 6 includes numerous performance improvements. This section lists some of the improvements—in [FileStream](#filestream), [profile-guided optimization](#profile-guided-optimization), and [AOT compilation](#crossgen2). For detailed information, see the [Performance improvements in .NET 6](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-6/) blog post. ### FileStream diff --git a/docs/csharp/language-reference/compiler-options/output.md b/docs/csharp/language-reference/compiler-options/output.md index 949f6a4a4d1de..c216d2572f4c1 100644 --- a/docs/csharp/language-reference/compiler-options/output.md +++ b/docs/csharp/language-reference/compiler-options/output.md @@ -36,6 +36,8 @@ The source code file that contains Main or top-level statements is output first > [!NOTE] > The **DocumentationFile** option applies to all files in the project. To disable warnings related to documentation comments for a specific file or section of code, use [#pragma warning](../preprocessor-directives.md#pragma-warning). +This option can be used in any .NET SDK-style project. For more information, see [DocumentationFile property](../../../core/project-sdk/msbuild-props.md#documentationfile). + ## OutputAssembly The **OutputAssembly** option specifies the name of the output file. The output path specifies the folder where compiler output is placed. diff --git a/docs/csharp/language-reference/operators/lambda-expressions.md b/docs/csharp/language-reference/operators/lambda-expressions.md index f01ff94915dfe..13112d22e7b5c 100644 --- a/docs/csharp/language-reference/operators/lambda-expressions.md +++ b/docs/csharp/language-reference/operators/lambda-expressions.md @@ -311,6 +311,8 @@ For more information about features added in C# 9.0, see the following feature p - [C# reference](../index.md) - [C# operators and expressions](index.md) - [LINQ (Language-Integrated Query)](../../programming-guide/concepts/linq/index.md) -- [Expression Trees](../../programming-guide/concepts/expression-trees/index.md) +- [Expression trees](../../programming-guide/concepts/expression-trees/index.md) - [Local functions vs. lambda expressions](../../programming-guide/classes-and-structs/local-functions.md#local-functions-vs-lambda-expressions) -- [Visual Studio 2008 C# Samples (see LINQ Sample Queries files and XQuery program)](https://code.msdn.microsoft.com/Visual-Studio-2008-C-d295cdba) +- [LINQ sample queries](https://github.com/microsoftarchive/msdn-code-gallery-microsoft/tree/master/Visual%20Studio%20Product%20Team/Official%20Visual%20Studio%202008%20C%23%20Samples/%5BC%23%5D-Official%20Visual%20Studio%202008%20C%23%20Samples/LINQ%20-%20Sample%20Queries/C%23) +- [XQuery sample](https://github.com/microsoftarchive/msdn-code-gallery-microsoft/tree/master/Visual%20Studio%20Product%20Team/Official%20Visual%20Studio%202008%20C%23%20Samples/%5BC%23%5D-Official%20Visual%20Studio%202008%20C%23%20Samples/XQuery/C%23) +- [101 LINQ samples](/samples/dotnet/try-samples/101-linq-samples/) diff --git a/docs/csharp/language-reference/xmldoc/index.md b/docs/csharp/language-reference/xmldoc/index.md index df0ad1e2a69c2..9cb372ff2cbc2 100644 --- a/docs/csharp/language-reference/xmldoc/index.md +++ b/docs/csharp/language-reference/xmldoc/index.md @@ -42,7 +42,7 @@ You create documentation for your code by writing special comment fields indicat public class MyClass {} ``` -You set the [**DocumentationFile**](../../language-reference/compiler-options/output.md#documentationfile) option and the compiler will find all comment fields with XML tags in the source code and create an XML documentation file from those comments. When this option is enabled, the compiler generates the [CS1591](../compiler-messages/cs1591.md) warning for any publicly visible member declared in your project without XML documentation comments. +You set either the [**GenerateDocumentationFile**](../../../core/project-sdk/msbuild-props.md#generatedocumentationfile) or [**DocumentationFile**](../../language-reference/compiler-options/output.md#documentationfile) option, and the compiler will find all comment fields with XML tags in the source code and create an XML documentation file from those comments. When this option is enabled, the compiler generates the [CS1591](../compiler-messages/cs1591.md) warning for any publicly visible member declared in your project without XML documentation comments. ## XML comment formats diff --git a/docs/csharp/programming-guide/concepts/async/task-asynchronous-programming-model.md b/docs/csharp/programming-guide/concepts/async/task-asynchronous-programming-model.md index 8e891c8bcda47..c2198b85dde4f 100644 --- a/docs/csharp/programming-guide/concepts/async/task-asynchronous-programming-model.md +++ b/docs/csharp/programming-guide/concepts/async/task-asynchronous-programming-model.md @@ -205,16 +205,16 @@ By convention, methods that return commonly awaitable types (for example, `Task` You can ignore the convention where an event, base class, or interface contract suggests a different name. For example, you shouldn't rename common event handlers, such as `OnButtonClick`. -## Related topics and samples (Visual Studio) - -| Title | Description | Sample | -|--|--|--| -| [How to make multiple web requests in parallel by using async and await (C#)](./index.md) | Demonstrates how to start several tasks at the same time. | [Async Sample: Make Multiple Web Requests in Parallel](https://code.msdn.microsoft.com/Async-Make-Multiple-Web-49adb82e) | -| [Async return types (C#)](async-return-types.md) | Illustrates the types that async methods can return, and explains when each type is appropriate. | | -| Cancel tasks with a cancellation token as a signaling mechanism. | Shows how to add the following functionality to your async solution:

- [Cancel a list of tasks (C#)](cancel-an-async-task-or-a-list-of-tasks.md)
- [Cancel tasks after a period of time (C#)](cancel-async-tasks-after-a-period-of-time.md)
- [Process asynchronous task as they complete (C#)](start-multiple-async-tasks-and-process-them-as-they-complete.md) | | -| [Using async for file access (C#)](using-async-for-file-access.md) | Lists and demonstrates the benefits of using async and await to access files. | | -| [Task-based asynchronous pattern (TAP)](../../../../standard/asynchronous-programming-patterns/task-based-asynchronous-pattern-tap.md) | Describes an asynchronous pattern, the pattern is based on the and types. | | -| [Async Videos on Channel 9](https://channel9.msdn.com/search?term=async%20&type=All#pubDate=year&ch9Search&lang-en=en) | Provides links to a variety of videos about async programming. | | +## Related articles (Visual Studio) + +| Title | Description | +|--|--| +| [How to make multiple web requests in parallel by using async and await (C#)](./index.md) | Demonstrates how to start several tasks at the same time. | +| [Async return types (C#)](async-return-types.md) | Illustrates the types that async methods can return, and explains when each type is appropriate. | +| Cancel tasks with a cancellation token as a signaling mechanism. | Shows how to add the following functionality to your async solution:

- [Cancel a list of tasks (C#)](cancel-an-async-task-or-a-list-of-tasks.md)
- [Cancel tasks after a period of time (C#)](cancel-async-tasks-after-a-period-of-time.md)
- [Process asynchronous task as they complete (C#)](start-multiple-async-tasks-and-process-them-as-they-complete.md) | +| [Using async for file access (C#)](using-async-for-file-access.md) | Lists and demonstrates the benefits of using async and await to access files. | +| [Task-based asynchronous pattern (TAP)](../../../../standard/asynchronous-programming-patterns/task-based-asynchronous-pattern-tap.md) | Describes an asynchronous pattern, the pattern is based on the and types. | +| [Async Videos on Channel 9](https://channel9.msdn.com/search?term=async%20&type=All#pubDate=year&ch9Search&lang-en=en) | Provides links to a variety of videos about async programming. | ## See also diff --git a/docs/csharp/programming-guide/file-system/how-to-write-to-a-text-file.md b/docs/csharp/programming-guide/file-system/how-to-write-to-a-text-file.md index d6a39ea4ddd23..9b5646d9b6c50 100644 --- a/docs/csharp/programming-guide/file-system/how-to-write-to-a-text-file.md +++ b/docs/csharp/programming-guide/file-system/how-to-write-to-a-text-file.md @@ -80,4 +80,3 @@ There are additional conditions that may cause exceptions when working with the - [C# Programming Guide](../index.md) - [File System and the Registry (C# Programming Guide)](./index.md) -- [Sample: Save a collection to Application Storage](https://code.msdn.microsoft.com/CSWinStoreAppSaveCollection-bed5d6e6) diff --git a/docs/csharp/whats-new/csharp-10.md b/docs/csharp/whats-new/csharp-10.md index ddffee0c6e20c..5df06164fe857 100644 --- a/docs/csharp/whats-new/csharp-10.md +++ b/docs/csharp/whats-new/csharp-10.md @@ -55,7 +55,7 @@ You can use a new form of the [`namespace` declaration](../language-reference/ke namespace MyNamespace; ``` -This new syntax saves both horizontal and vertical space for the most common `namespace` declarations. +This new syntax saves both horizontal and vertical space for `namespace` declarations. ## Extended property patterns diff --git a/docs/framework/data/adonet/retrieving-identity-or-autonumber-values.md b/docs/framework/data/adonet/retrieving-identity-or-autonumber-values.md index c0749f248a2d1..490a91a24d4f9 100644 --- a/docs/framework/data/adonet/retrieving-identity-or-autonumber-values.md +++ b/docs/framework/data/adonet/retrieving-identity-or-autonumber-values.md @@ -350,7 +350,7 @@ GO The code listing follows: > [!TIP] -> The code listing refers to an Access database file called MySchool.mdb. You can download MySchool.mdb (as part of the full C# or Visual Basic sample project) from [code.msdn.microsoft.com](https://code.msdn.microsoft.com/How-to-Retrieve-the-511acece). +> The code listing refers to an Access database file called *MySchool.mdb*. You can download *MySchool.mdb* from [the MSDN Code Gallery archive](https://github.com/microsoftarchive/msdn-code-gallery-microsoft/tree/21cb9b6bc0da3b234c5854ecac449cb3bd261f29/OneCodeTeam/How%20to%20retrieve%20the%20Identity%20value%20after%20inserting%20a%20data%20using%20ADO.NET/%5BC%23%5D-How%20to%20retrieve%20the%20Identity%20value%20after%20inserting%20a%20data%20using%20ADO.NET/C%23/CSDataRetrieveIdentity/Database). ```csharp using System; diff --git a/docs/framework/data/adonet/updating-data-sources-with-dataadapters.md b/docs/framework/data/adonet/updating-data-sources-with-dataadapters.md index ae6b07ed87906..06e667d9ed224 100644 --- a/docs/framework/data/adonet/updating-data-sources-with-dataadapters.md +++ b/docs/framework/data/adonet/updating-data-sources-with-dataadapters.md @@ -173,8 +173,6 @@ ALTER TABLE [dbo].[Course] CHECK CONSTRAINT [FK_Course_Department] GO ``` -C# and Visual Basic projects with this code sample can be found on [Developer Code Samples](https://code.msdn.microsoft.com/site/search?f%5B0%5D.Type=SearchText&f%5B0%5D.Value=How%20to%20use%20DataAdapter%20to%20retrieve%20and%20update%20data&f%5B1%5D). - ```csharp using System; using System.Data; diff --git a/docs/framework/deployment/how-to-get-progress-from-the-dotnet-installer.md b/docs/framework/deployment/how-to-get-progress-from-the-dotnet-installer.md index 983b9f3706abb..4ea6bb7961a16 100644 --- a/docs/framework/deployment/how-to-get-progress-from-the-dotnet-installer.md +++ b/docs/framework/deployment/how-to-get-progress-from-the-dotnet-installer.md @@ -49,13 +49,11 @@ The Chainer sample silently launches and tracks .NET Framework 4.5 setup while s > [!WARNING] > You must run the example as an administrator. -You can download the complete Visual Studio solution for the [.NET Framework 4.5 Chainer Sample](https://code.msdn.microsoft.com/NET-Framework-45-Developer-e416a0ba) from the MSDN Samples Gallery. - The following sections describe the significant files in this sample: MMIOChainer.h, ChainingdotNet4.cpp, and IProgressObserver.h. #### MMIOChainer.h -- The MMIOChainer.h file (see [complete code](https://code.msdn.microsoft.com/NET-Framework-45-Developer-e416a0ba/sourcecode?fileId=47345&pathId=663039622)) contains the data structure definition and the base class from which the chainer class should be derived. The .NET Framework 4.5 extends the MMIO data structure to handle data that the .NET Framework 4.5 installer needs. The changes to the MMIO structure are backward-compatible, so a .NET Framework 4 chainer can work with .NET Framework 4.5 setup without requiring recompilation. However, this scenario does not support the feature for reducing system restarts. +- The MMIOChainer.h file contains the data structure definition and the base class from which the chainer class should be derived. The .NET Framework 4.5 extends the MMIO data structure to handle data that the .NET Framework 4.5 installer needs. The changes to the MMIO structure are backward-compatible, so a .NET Framework 4 chainer can work with .NET Framework 4.5 setup without requiring recompilation. However, this scenario does not support the feature for reducing system restarts. A version field provides a means of identifying revisions to the structure and message format. The .NET Framework setup determines the version of the chainer interface by calling the `VirtualQuery` function to determine the size of the file mapping. If the size is large enough to accommodate the version field, .NET Framework setup uses the specified value. If the file mapping is too small to contain a version field, which is the case with the .NET Framework 4, the setup process assumes version 0 (4). If the chainer does not support the version of the message that .NET Framework setup wants to send, .NET Framework setup assumes an ignore response. @@ -92,7 +90,7 @@ The following sections describe the significant files in this sample: MMIOChaine #### IProgressObserver.h -- The IProgressObserver.h file implements a progress observer ([see complete code](https://code.msdn.microsoft.com/NET-Framework-45-Developer-e416a0ba/sourcecode?fileId=47345&pathId=1263700592)). This observer gets notified of download and installation progress (specified as an unsigned `char`, 0-255, indicating 1%-100% complete). The observer is also notified when the chainee sends a message, and the observer should send a response. +- The IProgressObserver.h file implements a progress observer. This observer gets notified of download and installation progress (specified as an unsigned `char`, 0-255, indicating 1%-100% complete). The observer is also notified when the chainee sends a message, and the observer should send a response. ```cpp class IProgressObserver @@ -106,7 +104,7 @@ The following sections describe the significant files in this sample: MMIOChaine #### ChainingdotNet4.5.cpp -- The [ChainingdotNet4.5.cpp](https://code.msdn.microsoft.com/NET-Framework-45-Developer-e416a0ba/sourcecode?fileId=47345&pathId=1757268882) file implements the `Server` class, which derives from the `MmioChainer` class and overrides the appropriate methods to display progress information. The MmioChainer creates a section with the specified section name and initializes the chainer with the specified event name. The event name is saved in the mapped data structure. You should make the section and event names unique. The `Server` class in the following code launches the specified setup program, monitors its progress, and returns an exit code. +- The ChainingdotNet4.5.cpp file implements the `Server` class, which derives from the `MmioChainer` class and overrides the appropriate methods to display progress information. The MmioChainer creates a section with the specified section name and initializes the chainer with the specified event name. The event name is saved in the mapped data structure. You should make the section and event names unique. The `Server` class in the following code launches the specified setup program, monitors its progress, and returns an exit code. ```cpp class Server : public ChainerSample::MmioChainer, public ChainerSample::IProgressObserver diff --git a/docs/framework/network-programming/index.md b/docs/framework/network-programming/index.md index 3b02acb47a00d..f85361caeec14 100644 --- a/docs/framework/network-programming/index.md +++ b/docs/framework/network-programming/index.md @@ -136,4 +136,3 @@ The Microsoft .NET Framework provides a layered, extensible, and managed impleme - [Transport Layer Security (TLS) best practices with .NET Framework](tls.md) - [Network Programming How-to Topics](network-programming-how-to-topics.md) - [Network Programming Samples](network-programming-samples.md) -- [HttpClient Sample](https://code.msdn.microsoft.com/windowsapps/HttpClient-sample-55700664) diff --git a/docs/framework/network-programming/network-isolation-for-windows-store-apps.md b/docs/framework/network-programming/network-isolation-for-windows-store-apps.md index 029f6ca857426..61d8c31460674 100644 --- a/docs/framework/network-programming/network-isolation-for-windows-store-apps.md +++ b/docs/framework/network-programming/network-isolation-for-windows-store-apps.md @@ -29,4 +29,3 @@ For more detailed information on how to configure network capabilities and isola - [Quickstart: Connecting using HttpClient](/previous-versions/windows/apps/hh781239(v=win.10)) - [How to use HttpClient handlers](/previous-versions/windows/apps/hh781241(v=win.10)) - [How to secure HttpClient connections](/previous-versions/windows/apps/hh781240(v=win.10)) -- [HttpClient Sample](https://code.msdn.microsoft.com/windowsapps/HttpClient-sample-55700664) diff --git a/docs/framework/network-programming/network-programming-how-to-topics.md b/docs/framework/network-programming/network-programming-how-to-topics.md index 7fa6d339eb908..66715ed05b7bb 100644 --- a/docs/framework/network-programming/network-programming-how-to-topics.md +++ b/docs/framework/network-programming/network-programming-how-to-topics.md @@ -77,4 +77,3 @@ The following list includes links to the How-to topics found in the conceptual d - [Network Programming in the .NET Framework](index.md) - [Network Programming Samples](network-programming-samples.md) -- [Networking Samples for .NET on MSDN Code Gallery](https://code.msdn.microsoft.com/Wiki/View.aspx?ProjectName=nclsamples) diff --git a/docs/framework/wcf/whats-new.md b/docs/framework/wcf/whats-new.md index c68f726430dc8..0722d668c0915 100644 --- a/docs/framework/wcf/whats-new.md +++ b/docs/framework/wcf/whats-new.md @@ -122,11 +122,11 @@ Support has been added to allow for WCF services with Internationalized Domain N ## HttpClient -A new class called has been added to make working with HTTP requests much easier. For more info, see [Making apps social and connected with HTTP services](https://channel9.msdn.com/Events/BUILD/BUILD2011/PLAT-581T) and the [HTTP Client Sample](https://code.msdn.microsoft.com/windowsapps/HttpClient-sample-55700664). +A new class called has been added to make working with HTTP requests much easier. For more info, see [Making apps social and connected with HTTP services](https://channel9.msdn.com/Events/BUILD/BUILD2011/PLAT-581T). -## Configuration Intellisense +## Configuration IntelliSense -Attribute values in configuration files for custom attributes defined in the project now support intellisense to facilitate working with configurations quickly and accurately. +Attribute values in configuration files for custom attributes defined in the project now support IntelliSense to facilitate working with configurations quickly and accurately. ## Configuration tooltips diff --git a/docs/fsharp/language-reference/xml-documentation.md b/docs/fsharp/language-reference/xml-documentation.md index e00e7ad2161b1..b565377ec3728 100644 --- a/docs/fsharp/language-reference/xml-documentation.md +++ b/docs/fsharp/language-reference/xml-documentation.md @@ -26,6 +26,8 @@ You can generate the XML file at compile time by doing one of the following: true ``` + For more information, see [GenerateDocumentationFile property](../../core/project-sdk/msbuild-props.md#generatedocumentationfile). + - If you are developing an application using Visual Studio, right-click on the project and select **Properties**. In the properties dialog, select the **Build** tab, and check **XML documentation file**. You can also change the location to which the compiler writes the file. There are two ways to write XML documentation comments: with and without XML tags. Both use triple-slash comments. diff --git a/docs/fundamentals/code-analysis/quality-rules/ca1839.md b/docs/fundamentals/code-analysis/quality-rules/ca1839.md new file mode 100644 index 0000000000000..301e39fbfc844 --- /dev/null +++ b/docs/fundamentals/code-analysis/quality-rules/ca1839.md @@ -0,0 +1,106 @@ +--- +title: "CA1839: Use 'Environment.ProcessPath'" +description: "'Environment.ProcessPath' is simpler and faster than 'Process.GetCurrentProcess().MainModule.FileName'." +ms.date: 11/23/2021 +ms.topic: reference +f1_keywords: + - "CA1839" +helpviewer_keywords: + - "CA1839" +author: buyaa-n +dev_langs: +- CSharp +- VB +--- + +# CA1839: Use Environment.ProcessPath instead of Process.GetCurrentProcess().MainModule.FileName + +| | Value | +|-|-| +| **Rule ID** |CA1839| +| **Category** |[Performance](performance-warnings.md)| +| **Fix is breaking or non-breaking** |Non-breaking| + +## Cause + +Using `Process.GetCurrentProcess().MainModule.FileName` for getting the path to the file that launched the process instead of . + +## Rule description + +`System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName` is expensive: + +- It allocates a and instance, usually just to get the `FileName`. +- The instance needs to be disposed, which has a performance impact. +- It's easy to forget to call on the instance. +- If nothing else besides `FileName` uses the `Process` instance, then the linked size grows unnecessarily by increasing the graph of types referenced. +- It is somewhat difficult to discover or find this API. + +`System.Environment.ProcessPath` avoids all of these downsides and produces the same information. + +> [!NOTE] +> is available starting in .NET 6. + +## How to fix violations + +The violation can either be fixed manually, or, in some cases, using Quick Actions to fix code in Visual Studio. + +The following two code snippets show a violation of the rule and how to fix it: + +```csharp +using System.Diagnostics; + +class MyClass +{ + void MyMethod() + { + string path = Process.GetCurrentProcess().MainModule.FileName; // Violation occurs + } +} +``` + +```vb +Imports System.Diagnostics + +Class MyClass + Private Sub MyMethod() + Dim path As String = Process.GetCurrentProcess().MainModule.FileName ' Violation occurs. + End Function +End Class +``` + +```csharp +using System.Diagnostics; + +class MyClass +{ + void MyMethod() + { + string path = System.Environment.ProcessPath; // Violation fixed + } +} +``` + +```vb +Imports System.Diagnostics + +Class MyClass + Private Sub MyMethod() + Dim path As String = System.Environment.ProcessPath ' Violation fixed. + End Function +End Class +``` + +> [!TIP] +> A code fix is available for this rule in Visual Studio. To use it, position the cursor on the violation and press **Ctrl**+**.** (period). Choose **Use 'Environment.ProcessPath'** from the list of options that's presented. +> +> ![Code fix for CA1839 - Use 'Environment.ProcessPath'](media/ca1839-codefix.png) + +## When to suppress warnings + +It's safe to suppress a violation of this rule if you're not concerned about the performance impact from unnecessary allocation and eventual disposal of the and instances. + +## See also + +- [Performance rules](performance-warnings.md) +- [Use 'Environment.ProcessId' instead of 'Process.GetCurrentProcess().Id'](ca1837.md) +- [Use 'Environment.CurrentManagedThreadId' instead of 'Thread.CurrentThread.ManagedThreadId'](ca1840.md) diff --git a/docs/fundamentals/code-analysis/quality-rules/ca1840.md b/docs/fundamentals/code-analysis/quality-rules/ca1840.md new file mode 100644 index 0000000000000..4a5f56217a1d8 --- /dev/null +++ b/docs/fundamentals/code-analysis/quality-rules/ca1840.md @@ -0,0 +1,95 @@ +--- +title: "CA1840: Use 'Environment.CurrentManagedThreadId'" +description: "'Environment.CurrentManagedThreadId' is simpler and faster than 'Thread.CurrentThread.ManagedThreadId'." +ms.date: 11/23/2021 +ms.topic: reference +f1_keywords: + - "CA1840" +helpviewer_keywords: + - "CA1840" +author: buyaa-n +dev_langs: +- CSharp +- VB +--- + +# CA1840: Use Environment.CurrentManagedThreadId instead of Thread.CurrentThread.ManagedThreadId + +| | Value | +|-|-| +| **Rule ID** |CA1840| +| **Category** |[Performance](performance-warnings.md)| +| **Fix is breaking or non-breaking** |Non-breaking| + +## Cause + +Using `Thread.CurrentThread.ManagedThreadId` for getting the current managed thread ID instead of . + +## Rule description + + is a compact and efficient replacement of the `Thread.CurrentThread.ManagedThreadId` pattern. + +## How to fix violations + +The violation can either be fixed manually, or, in some cases, using Quick Actions to fix code in Visual Studio. + +The following two code snippets show a violation of the rule and how to fix it: + +```csharp +using System.Threading; + +class MyClass +{ + void MyMethod() + { + int id = Thread.CurrentThread.ManagedThreadId; // Violation occurs + } +} +``` + +```vb +Imports System.Threading + +Class MyClass + Private Sub MyMethod() + Dim id As Integer = Thread.CurrentThread.ManagedThreadId ' Violation occurs. + End Function +End Class +``` + +```csharp +using System.Threading; + +class MyClass +{ + void MyMethod() + { + int id = System.Environment.CurrentManagedThreadId; // Violation fixed + } +} +``` + +```vb +Imports System.Threading + +Class MyClass + Private Sub MyMethod() + Dim id As Integer = System.Environment.CurrentManagedThreadId ' Violation fixed. + End Function +End Class +``` + +> [!TIP] +> A code fix is available for this rule in Visual Studio. To use it, position the cursor on the violation and press **Ctrl**+**.** (period). Choose **Use 'Environment.CurrentManagedThreadId'** from the list of options that's presented. +> +> ![Code fix for CA1840 - Use 'Environment.CurrentManagedThreadId'](media/ca1840-codefix.png) + +## When to suppress warnings + +It's safe to suppress a violation of this rule if you're not concerned about the performance impact from using `Thread.CurrentThread.ManagedThreadId`. + +## See also + +- [Performance rules](performance-warnings.md) +- [Use 'Environment.ProcessId' instead of 'Process.GetCurrentProcess().Id'](ca1837.md) +- [Use 'Environment.ProcessPath' instead of 'Process.GetCurrentProcess().MainModule.FileName'](ca1839.md) diff --git a/docs/fundamentals/code-analysis/quality-rules/index.md b/docs/fundamentals/code-analysis/quality-rules/index.md index ad6e45c1452e8..218e8cbff2b24 100644 --- a/docs/fundamentals/code-analysis/quality-rules/index.md +++ b/docs/fundamentals/code-analysis/quality-rules/index.md @@ -130,6 +130,8 @@ The following table lists code quality analysis rules. > |[CA1836: Prefer `IsEmpty` over `Count` when available](ca1836.md) | Prefer `IsEmpty` property that is more efficient than `Count`, `Length`, or to determine whether the object contains or not any items. | > | [CA1837: Use `Environment.ProcessId` instead of `Process.GetCurrentProcess().Id`](ca1837.md) | `Environment.ProcessId` is simpler and faster than `Process.GetCurrentProcess().Id`. | > | [CA1838: Avoid `StringBuilder` parameters for P/Invokes](ca1838.md) | Marshaling of 'StringBuilder' always creates a native buffer copy, resulting in multiple allocations for one marshaling operation. | +> | [CA1839: Use Environment.ProcessPath instead of Process.GetCurrentProcess().MainModule.FileName](ca1837.md) | `Environment.ProcessPath` is simpler and faster than `Process.GetCurrentProcess().MainModule.FileName`. | +> | [CA1840: Use Environment.CurrentManagedThreadId instead of Thread.CurrentThread.ManagedThreadId](ca1837.md) | `Environment.CurrentManagedThreadId` is more compact and efficient than `Thread.CurrentThread.ManagedThreadId`. | > | [CA1841: Prefer Dictionary Contains methods](ca1841.md) | Calling `Contains` on the `Keys` or `Values` collection may often be more expensive than calling `ContainsKey` or `ContainsValue` on the dictionary itself. | > | [CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'](ca1844.md) | To improve performance, override the memory-based async methods when subclassing 'Stream'. Then implement the array-based methods in terms of the memory-based methods. | > | [CA1845: Use span-based 'string.Concat'](ca1845.md) | It is more efficient to use `AsSpan` and `string.Concat`, instead of `Substring` and a concatenation operator. | diff --git a/docs/fundamentals/code-analysis/quality-rules/media/ca1839-codefix.png b/docs/fundamentals/code-analysis/quality-rules/media/ca1839-codefix.png new file mode 100644 index 0000000000000..7f7ee7df48b4e Binary files /dev/null and b/docs/fundamentals/code-analysis/quality-rules/media/ca1839-codefix.png differ diff --git a/docs/fundamentals/code-analysis/quality-rules/media/ca1840-codefix.png b/docs/fundamentals/code-analysis/quality-rules/media/ca1840-codefix.png new file mode 100644 index 0000000000000..72854a2e79969 Binary files /dev/null and b/docs/fundamentals/code-analysis/quality-rules/media/ca1840-codefix.png differ diff --git a/docs/fundamentals/code-analysis/quality-rules/performance-warnings.md b/docs/fundamentals/code-analysis/quality-rules/performance-warnings.md index 3b4ca0217fbfe..cc00cc27dc700 100644 --- a/docs/fundamentals/code-analysis/quality-rules/performance-warnings.md +++ b/docs/fundamentals/code-analysis/quality-rules/performance-warnings.md @@ -49,6 +49,8 @@ Performance rules support high-performance libraries and applications. | [CA1836: Prefer `IsEmpty` over `Count` when available](ca1836.md) | Prefer `IsEmpty` property that is more efficient than `Count`, `Length`, or to determine whether the object contains or not any items. | | [CA1837: Use `Environment.ProcessId` instead of `Process.GetCurrentProcess().Id`](ca1837.md) | `Environment.ProcessId` is simpler and faster than `Process.GetCurrentProcess().Id`. | | [CA1838: Avoid `StringBuilder` parameters for P/Invokes](ca1838.md) | Marshaling of `StringBuilder` always creates a native buffer copy, resulting in multiple allocations for one marshaling operation. | +| [CA1839: Use Environment.ProcessPath instead of Process.GetCurrentProcess().MainModule.FileName](ca1837.md) | `Environment.ProcessPath` is simpler and faster than `Process.GetCurrentProcess().MainModule.FileName`. | +| [CA1840: Use Environment.CurrentManagedThreadId instead of Thread.CurrentThread.ManagedThreadId](ca1837.md) | `Environment.CurrentManagedThreadId` is more compact and efficient than `Thread.CurrentThread.ManagedThreadId`. | | [CA1841: Prefer Dictionary Contains methods](ca1841.md) | Calling `Contains` on the `Keys` or `Values` collection may often be more expensive than calling `ContainsKey` or `ContainsValue` on the dictionary itself. | | [CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'](ca1844.md) | To improve performance, override the memory-based async methods when subclassing 'Stream'. Then implement the array-based methods in terms of the memory-based methods. | | [CA1845: Use span-based 'string.Concat'](ca1845.md) | It is more efficient to use `AsSpan` and `string.Concat`, instead of `Substring` and a concatenation operator. | diff --git a/docs/fundamentals/code-analysis/style-rules/ide0044.md b/docs/fundamentals/code-analysis/style-rules/ide0044.md index 68fbe9f8e0304..6551066d2c518 100644 --- a/docs/fundamentals/code-analysis/style-rules/ide0044.md +++ b/docs/fundamentals/code-analysis/style-rules/ide0044.md @@ -28,14 +28,14 @@ dev_langs: ## Overview -This style rule concerns specifying the readonly modifier for fields that are initialized (either inline or inside of a constructor) but never reassigned. +This style rule concerns specifying the readonly modifier for private fields that are initialized (either inline or inside of a constructor) but never reassigned. ## dotnet_style_readonly_field |Property|Value| |-|-| | **Option name** | dotnet_style_readonly_field | -| **Option values** | `true` - Prefer that fields should be marked with `readonly` (C#) or `ReadOnly` (Visual Basic) if they are only ever assigned inline, or inside of a constructor

`false` - Specify no preference over whether fields should be marked with `readonly` (C#) or `ReadOnly` (Visual Basic) | +| **Option values** | `true` - Prefer that private fields should be marked with `readonly` (C#) or `ReadOnly` (Visual Basic) if they are only ever assigned inline, or inside of a constructor

`false` - Specify no preference over whether private fields should be marked with `readonly` (C#) or `ReadOnly` (Visual Basic) | | **Default option value** | `true` | ### Example diff --git a/docs/fundamentals/toc.yml b/docs/fundamentals/toc.yml index 6c0e01b725323..2d99252df5090 100644 --- a/docs/fundamentals/toc.yml +++ b/docs/fundamentals/toc.yml @@ -986,6 +986,10 @@ items: href: code-analysis/quality-rules/ca1837.md - name: CA1838 href: code-analysis/quality-rules/ca1838.md + - name: CA1839 + href: code-analysis/quality-rules/ca1839.md + - name: CA1840 + href: code-analysis/quality-rules/ca1840.md - name: CA1841 href: code-analysis/quality-rules/ca1841.md - name: CA1844 diff --git a/docs/standard/datetime/working-with-calendars.md b/docs/standard/datetime/working-with-calendars.md index b685c1ed617ff..f9f3625674268 100644 --- a/docs/standard/datetime/working-with-calendars.md +++ b/docs/standard/datetime/working-with-calendars.md @@ -356,5 +356,4 @@ Japanese calendar date: 平成1年8月18日 (Gregorian: Friday, August 18, 1989) ## See also - [How to: Display dates in non-Gregorian calendars](../base-types/how-to-display-dates-in-non-gregorian-calendars.md) -- [Sample: Calendar week range utility](https://code.msdn.microsoft.com/NET-Framework-4-Calendar-3360a84a) - [Calendar class](xref:System.Globalization.Calendar) diff --git a/docs/visual-basic/programming-guide/program-structure/documenting-your-code-with-xml.md b/docs/visual-basic/programming-guide/program-structure/documenting-your-code-with-xml.md index 395ab58866312..734a2223bcdfa 100644 --- a/docs/visual-basic/programming-guide/program-structure/documenting-your-code-with-xml.md +++ b/docs/visual-basic/programming-guide/program-structure/documenting-your-code-with-xml.md @@ -1,7 +1,7 @@ --- description: "Learn more about: Document your code with XML (Visual Basic)" title: "Documenting Your Code with XML" -ms.date: 07/20/2015 +ms.date: 11/22/2021 helpviewer_keywords: - "XML [Visual Basic], documenting code" - "XML comments, Visual Basic" @@ -14,7 +14,7 @@ In Visual Basic, you can document your code using XML. ## XML documentation comments -Visual Basic provides an easy way to automatically create XML documentation for projects. You can automatically generate an XML skeleton for your types and members, and then provide summaries, descriptive documentation for each parameter, and other remarks. With the appropriate setup, the XML documentation is automatically emitted into an XML file with the same root file name as your project. For more information, see [-doc](../../reference/command-line-compiler/doc.md). +Visual Basic provides an easy way to automatically create XML documentation for projects. You can automatically generate an XML skeleton for your types and members, and then provide summaries, descriptive documentation for each parameter, and other remarks. With the appropriate setup, the XML documentation is automatically emitted into an XML file with the same root file name as your project. For information about configuring the generation of the XML documentation file, see [-doc compiler option](../../reference/command-line-compiler/doc.md) and [GenerateDocumentationFile MSBuild property](../../../core/project-sdk/msbuild-props.md#generatedocumentationfile). The XML file can be consumed or otherwise manipulated as XML. This file is located in the same directory as the output .exe or .dll file of your project.