diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index ae7ab0accee2a..774861bd193a8 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -1,5 +1,10 @@ { "redirections": [ + { + "source_path": "docs/core/install/localized-intellisense.md", + "redirect_url": "/previous-versions/dotnet/core/install/localized-intellisense", + "redirect_document_id": false + }, { "source_path": "docs/spark/what-is-apache-spark-dotnet.md", "redirect_url": "/previous-versions/dotnet/spark/what-is-apache-spark-dotnet", diff --git a/docs/azure/includes/dotnet-all.md b/docs/azure/includes/dotnet-all.md index 6a8a1fadbc7a3..9c646449068e5 100644 --- a/docs/azure/includes/dotnet-all.md +++ b/docs/azure/includes/dotnet-all.md @@ -507,7 +507,7 @@ | Functions extension for Application Insights | NuGet [1.0.0-preview4](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.ApplicationInsights/1.0.0-preview4) | | | | Functions extension for Azure Mobile Apps | NuGet [3.0.0-beta8](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.MobileApps/3.0.0-beta8) | | GitHub [3.0.0-beta8](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/v3.0.0-beta8/src/WebJobs.Extensions.MobileApps) | | Functions extension for Azure SQL and SQL Server | NuGet [3.1.527](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Sql/3.1.527) | | | -| Functions extension for Cosmos DB | NuGet [4.9.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.CosmosDB/4.9.0) | | GitHub [4.9.0](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/cosmos-v3.0.7/src/WebJobs.Extensions.CosmosDB) | +| Functions extension for Cosmos DB | NuGet [4.10.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.CosmosDB/4.10.0) | | GitHub [4.10.0](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/cosmos-v3.0.7/src/WebJobs.Extensions.CosmosDB) | | Functions extension for DocumentDB | NuGet [1.3.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DocumentDB/1.3.0) | | GitHub [1.3.0](https://github.com/Azure/azure-webjobs-sdk-extensions) | | Functions extension for Durable Task Framework | NuGet [3.4.1](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/3.4.1) | [docs](/dotnet/api/overview/azure/functions) | GitHub [3.4.1](https://github.com/Azure/azure-functions-durable-extension/tree/v2.2.2/src/WebJobs.Extensions.DurableTask) | | Functions extension for Durable Task Framework - isolated worker | NuGet [1.7.1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask/1.7.1) | | | diff --git a/docs/core/diagnostics/index.md b/docs/core/diagnostics/index.md index 27005a963d674..1820a07b2077c 100644 --- a/docs/core/diagnostics/index.md +++ b/docs/core/diagnostics/index.md @@ -5,9 +5,9 @@ ms.date: 10/20/2023 ms.topic: overview #Customer intent: As a .NET Core developer I want to find the best tools to help me diagnose problems so that I can be productive. --- -# What diagnostic tools are available in .NET Core? +# Diagnostics in .NET -Software doesn't always behave as you would expect, but .NET Core has tools and APIs that will help you diagnose these issues quickly and effectively. +Software doesn't always behave as you would expect, but .NET has tools and APIs that will help you diagnose these issues quickly and effectively. [Native AOT deployment](../../core/deploying/native-aot/index.md) is an application model that's been available since .NET 7. For information about .NET 8 diagnostic support for Native AOT apps, see [Native AOT diagnostics](../../core/deploying/native-aot/diagnostics.md). @@ -17,9 +17,9 @@ This article helps you find the various tools you need. [Debuggers](managed-debuggers.md) allow you to interact with your program. Pausing, incrementally executing, examining, and resuming gives you insight into the behavior of your code. A debugger is a good choice for diagnosing functional problems that can be easily reproduced. -## Unit testing +## Profilers -[Unit testing](../testing/index.md) is a key component of continuous integration and deployment of high-quality software. Unit tests are designed to give you an early warning when you break something. +[Profilers](profilers.md) allow you to analyze your program's performance. You can collect data on memory usage, CPU usage, and other metrics to diagnose and understand performance issues. ## Instrumentation for observability @@ -50,10 +50,6 @@ There are multiple ways that the instrumentation data can be egressed from the a - [dotnet-monitor](./dotnet-monitor.md) - an agent for collecting traces and telemetry - Third-party libraries or app code can read the information from the , , and APIs. -## Resource monitoring - -[Resource monitoring](diagnostic-resource-monitoring.md) is the process of continuously observing and tracking the utilization, performance, and availability of various computing resources within a system. These resources can include hardware components (such as CPUs, memory, disk storage, and network interfaces) as well as software components (like applications and services). Resource monitoring is often used to detect and diagnose performance issues, and to ensure that the system is operating within expected parameters. - ## Specialized diagnostics If debugging or observability is not sufficient, .NET supports additional diagnostic mechanisms such as EventSource, Dumps, DiagnosticSource. For more information, see the [specialized diagnostics](./specialized-diagnostics-overview.md) article. @@ -64,10 +60,6 @@ If debugging or observability is not sufficient, .NET supports additional diagno ## .NET Core diagnostics tutorials -### Write your own diagnostic tool - -[The diagnostics client library](diagnostics-client-library.md) lets you write your own custom diagnostic tool best suited for your diagnostic scenario. Look up information in the [Microsoft.Diagnostics.NETCore.Client API reference](microsoft-diagnostics-netcore-client.md). - ### Debug a memory leak [Tutorial: Debug a memory leak](debug-memory-leak.md) walks through finding a memory leak. The [dotnet-counters](dotnet-counters.md) tool is used to confirm the leak and the [dotnet-dump](dotnet-dump.md) tool is used to diagnose the leak. @@ -95,3 +87,7 @@ If debugging or observability is not sufficient, .NET supports additional diagno ### Measure performance using EventCounters [Tutorial: Measure performance using EventCounters in .NET](event-counter-perf.md) shows you how to use the API to measure performance in your .NET app. + +### Write your own diagnostic tool + +[The diagnostics client library](diagnostics-client-library.md) lets you write your own custom diagnostic tool best suited for your diagnostic scenario. For more information, see the [Microsoft.Diagnostics.NETCore.Client API reference](microsoft-diagnostics-netcore-client.md). diff --git a/docs/core/diagnostics/profilers.md b/docs/core/diagnostics/profilers.md new file mode 100644 index 0000000000000..91ff96d41eb68 --- /dev/null +++ b/docs/core/diagnostics/profilers.md @@ -0,0 +1,20 @@ +--- +title: Profiling tools in .NET +description: An overview of .NET profiling tools. +ms.date: 08/29/2025 +--- +# .NET profiling tools + +Profilers allow you to analyze your program's performance. By analyzing data on memory usage, CPU usage, call stacks and other information, you can better understand the performance profile of your program. + +Microsoft provides a profiler with [Visual Studio](/visualstudio/profiling/beginners-guide-to-performance-profiling) and through the [dotnet-trace](dotnet-trace.md) tool. + +## Visual Studio profiler + +**Visual Studio** is an integrated development environment and an excellent choice for developers working on Windows. + +- [Measure app performance in Visual Studio](/visualstudio/profiling/) + +## dotnet-trace + +[`dotnet-trace`](dotnet-trace.md) is a cross-platform command-line tool that collects diagnostic traces on Windows, Linux, and Mac. You can view these traces in [Visual Studio](/visualstudio/profiling/beginners-guide-to-performance-profiling?#step-2-analyze-cpu-usage-data) or [PerfView](https://github.com/microsoft/perfview). diff --git a/docs/core/diagnostics/specialized-diagnostics-overview.md b/docs/core/diagnostics/specialized-diagnostics-overview.md index 228c05a60827f..f6942465cec7e 100644 --- a/docs/core/diagnostics/specialized-diagnostics-overview.md +++ b/docs/core/diagnostics/specialized-diagnostics-overview.md @@ -13,10 +13,6 @@ If debugging or observability is not sufficient, .NET supports additional diagno Event Source data can be collected in-process using the API or with external diagnostics tools such as [Visual Studio](/visualstudio/profiling), [dotnet-monitor](./dotnet-monitor.md), [dotnet-trace](./dotnet-trace.md), [PerfView](https://github.com/microsoft/perfview), and the [Perfcollect](./trace-perfcollect-lttng.md) scripts. Using the external tools to collect event source data in traces is commonly used for performance analysis. -### Collect diagnostics in containers - -The same diagnostics tools that are used in non-containerized Linux environments can also be used to [collect diagnostics in containers](diagnostics-in-containers.md). There are just a few usage changes needed to make sure the tools work in a Docker container. - ### EventPipe [EventPipe](./eventpipe.md) is a runtime component that can be used to collect tracing data, similar to ETW or LTTng. The goal of EventPipe is to allow .NET developers to easily trace their .NET applications without having to rely on platform-specific, OS-native components, such as ETW or LTTng. @@ -41,7 +37,11 @@ The .NET runtime exposes a service endpoint that allows other processes to send ## DiagnosticSource & DiagnosticListener -[DiagnosticSource](./diagnosticsource-diagnosticlistener.md) is a module that allows code to be instrumented for production-time logging of rich data payloads for consumption within the process that was instrumented. At run time, consumers can dynamically discover data sources and subscribe to the ones of interest. was designed to allow in-process tools to access rich data, such as by [OpenTelemetry instrumentation libraries](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/src/OpenTelemetry.Instrumentation.AspNetCore/README.md). DiagnosticSource data can also be egressed via EventPipe, which enables rich diagnostic data to be collected by dedicated tools. | +[DiagnosticSource](./diagnosticsource-diagnosticlistener.md) is a module that allows code to be instrumented for production-time logging of rich data payloads for consumption within the process that was instrumented. At run time, consumers can dynamically discover data sources and subscribe to the ones of interest. was designed to allow in-process tools to access rich data, such as by [OpenTelemetry instrumentation libraries](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/src/OpenTelemetry.Instrumentation.AspNetCore/README.md). DiagnosticSource data can also be egressed via EventPipe, which enables rich diagnostic data to be collected by dedicated tools. + +## Collect diagnostics in containers + +The same diagnostics tools that are used in non-containerized Linux environments can also be used to [collect diagnostics in containers](diagnostics-in-containers.md). There are just a few usage changes needed to make sure the tools work in a Docker container. ## See also diff --git a/docs/core/install/localized-intellisense.md b/docs/core/install/localized-intellisense.md deleted file mode 100644 index e706488b45a8b..0000000000000 --- a/docs/core/install/localized-intellisense.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: Install localized IntelliSense files -description: Learn how to set up your development machine to use localized IntelliSense files for .NET projects (including .NET Core) in Visual Studio. -ms.date: 11/11/2024 ---- -# How to install localized IntelliSense files for .NET - -[IntelliSense](/visualstudio/ide/using-intellisense) is a code-completion aid that's available in different integrated development environments (IDEs), such as Visual Studio. By default, when you're developing .NET projects, the SDK only includes the English version of the IntelliSense files. This article explains: - -- How to install the localized version of those files. -- How to modify the Visual Studio installation to use a different language. - -> [!NOTE] -> Localized IntelliSense files are no longer available. The latest version they're available for is .NET 5. We recommend using the English IntelliSense files. - -## Prerequisites - -- [.NET SDK](https://dotnet.microsoft.com/download/dotnet/). -- [Visual Studio 2019 version 16.3](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=learn.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2019) or a later version. - -## Download and install the localized IntelliSense files - -> [!IMPORTANT] -> This procedure requires that you have administrator permission to copy the IntelliSense files to the .NET installation folder. - -1. Go to the [Download IntelliSense files](https://dotnet.microsoft.com/download/intellisense) page. - -1. Download the IntelliSense file for the language and version you'd like to use. - -1. Extract the contents of the zip file. - -1. Navigate to the .NET Intellisense folder. - - 1. Navigate to the .NET installation folder. By default, it's under *%ProgramFiles%\dotnet\packs*. - 1. Choose which SDK you want to install the IntelliSense for, and navigate to the associated path. You have the following options: - - | SDK type | Path | - |-----------------------|------------------------------------| - | .NET | *Microsoft.NETCore.App.Ref* | - | Windows Desktop | *Microsoft.WindowsDesktop.App.Ref* | - | .NET Standard | *NETStandard.Library.Ref* | - - 1. Navigate to the version you want to install the localized IntelliSense for. For example, *5.0.0*. - 1. Open the *ref* folder. - 1. Open the moniker folder. For example, *net5.0*. - - So, the full path that you'd navigate to would look similar to *C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0*. - -1. Create a subfolder inside the moniker folder you just opened. The name of the folder indicates which language you want to use. The following table specifies the different options: - - | Language | Folder name | - | --------------------- | ----------- | - | Brazilian Portuguese | *pt-br* | - | Chinese (simplified) | *zh-hans* | - | Chinese (traditional) | *zh-hant* | - | French | *fr* | - | German | *de* | - | Italian | *it* | - | Japanese | *ja* | - | Korean | *ko* | - | Russian | *ru* | - | Spanish | *es* | - -1. Copy the *.xml* files you extracted in step 3 to this new folder. The *.xml* files are broken down by SDK folders, so copy them to the matching SDK you chose in step 4. - -## Modify Visual Studio language - -For Visual Studio to use a different language for IntelliSense, install the appropriate language pack. This can be done [during installation](/visualstudio/install/install-visual-studio#step-6---install-language-packs-optional) or at a later time by modifying the Visual Studio installation. If you already have Visual Studio configured to the language of your choice, your IntelliSense installation is ready. - -### Install the language pack - -If you didn't install the desired language pack during setup, update Visual Studio as follows to install the language pack: - -> [!IMPORTANT] -> To install, update, or modify Visual Studio, you must log on with an account that has administrator permission. For more information, see [User permissions and Visual Studio](/visualstudio/ide/user-permissions-and-visual-studio). - -1. Find the Visual Studio Installer on your computer. - - For example, on a computer running Windows 10, select **Start**, and then scroll to the letter **V**, where it's listed as **Visual Studio Installer**. - - ![Open the Visual Studio Installer from Windows](./media/localized-intellisense/vs-installer-windows-start.png) - - > [!NOTE] - > You can also find the Visual Studio Installer in the following location: - > - > `C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe` - - You might have to update the installer before continuing. If so, follow the prompts. - -1. In the installer, look for the edition of Visual Studio that you want to add the language pack to, and then choose **Modify**. - - ![Update or modify Visual Studio](./media/localized-intellisense/vs-installer-modify.png) - - > [!IMPORTANT] - > If you don't see a **Modify** button but you see an **Update** one instead, you need to update your Visual Studio before you can modify your installation. - > After the update is finished, the **Modify** button should appear. - -1. In the **Language packs** tab, select or deselect the languages you want to install or uninstall. - - ![Visual Studio language packs tab](./media/localized-intellisense/vs-modify-language-packs.png) - -1. Choose **Modify**. The update starts. - -### Modify language settings in Visual Studio - -Once you've installed the desired language packs, modify your Visual Studio settings to use a different language: - -1. Open Visual Studio. - -1. On the start window, choose **Continue without code**. - -1. On the menu bar, select **Tools** > **Options**. The Options dialog opens. - -1. Under the **Environment** node, choose **International Settings**. - -1. On the **Language** drop-down, select the desired language. Choose **OK**. - -1. A dialog informs you that you have to restart Visual Studio for the changes to take effect. Choose **OK**. - -1. Restart Visual Studio. - -After this, your IntelliSense should work as expected when you open a .NET project that targets the version of the IntelliSense files you just installed. - -## See also - -- [IntelliSense in Visual Studio](/visualstudio/ide/using-intellisense) diff --git a/docs/core/install/media/localized-intellisense/vs-installer-modify.png b/docs/core/install/media/localized-intellisense/vs-installer-modify.png deleted file mode 100644 index ee7bee527e25d..0000000000000 Binary files a/docs/core/install/media/localized-intellisense/vs-installer-modify.png and /dev/null differ diff --git a/docs/core/install/media/localized-intellisense/vs-installer-windows-start.png b/docs/core/install/media/localized-intellisense/vs-installer-windows-start.png deleted file mode 100644 index a94cdb88cccec..0000000000000 Binary files a/docs/core/install/media/localized-intellisense/vs-installer-windows-start.png and /dev/null differ diff --git a/docs/core/install/media/localized-intellisense/vs-modify-language-packs.png b/docs/core/install/media/localized-intellisense/vs-modify-language-packs.png deleted file mode 100644 index 454ce24fd0215..0000000000000 Binary files a/docs/core/install/media/localized-intellisense/vs-modify-language-packs.png and /dev/null differ diff --git a/docs/csharp/tutorials/console-webapiclient.md b/docs/csharp/tutorials/console-webapiclient.md index 442e0c2c7d86c..a5a8972cf4b69 100644 --- a/docs/csharp/tutorials/console-webapiclient.md +++ b/docs/csharp/tutorials/console-webapiclient.md @@ -121,35 +121,31 @@ Use the class to make HTTP requests. class to deserialize JSON into objects. +The following steps simplify the approach to fetching the data and processing it. You will use the extension method that's part of the [📦 System.Net.Http.Json](https://www.nuget.org/packages/System.Net.Http.Json) NuGet package to fetch and deserialize the JSON results into objects. 1. Create a file named *Repository.cs* and add the following code: ```csharp - public record class Repository(string name); + public record class Repository(string Name); ``` The preceding code defines a class to represent the JSON object returned from the GitHub API. You'll use this class to display a list of repository names. - The JSON for a repository object contains dozens of properties, but only the `name` property will be deserialized. The serializer automatically ignores JSON properties for which there is no match in the target class. This feature makes it easier to create types that work with only a subset of fields in a large JSON packet. + The JSON for a repository object contains dozens of properties, but only the `Name` property will be deserialized. The serializer automatically ignores JSON properties for which there is no match in the target class. This feature makes it easier to create types that work with only a subset of fields in a large JSON packet. - The C# convention is to [capitalize the first letter of property names](../../standard/design-guidelines/capitalization-conventions.md), but the `name` property here starts with a lowercase letter because that matches exactly what's in the JSON. Later you'll see how to use C# property names that don't match the JSON property names. + Although the `GetFromJsonAsync` method you will use in the next point has a benefit of being case-insensitive when it comes to property names, the C# convention is to [capitalize the first letter of property names](../../standard/design-guidelines/capitalization-conventions.md). -1. Use the serializer to convert JSON into C# objects. Replace the call to - in the `ProcessRepositoriesAsync` method with the following lines: +1. Use the method to fetch and convert JSON into C# objects. Replace the call to in the `ProcessRepositoriesAsync` method with the following lines: ```csharp - await using Stream stream = - await client.GetStreamAsync("https://api.github.com/orgs/dotnet/repos"); - var repositories = - await JsonSerializer.DeserializeAsync>(stream); + var repositories = await client.GetFromJsonAsync>("https://api.github.com/orgs/dotnet/repos"); ``` - The updated code replaces with . This serializer method uses a stream instead of a string as its source. + The updated code replaces with . - The first argument to is an `await` expression. `await` expressions can appear almost anywhere in your code, even though up to now, you've only seen them as part of an assignment statement. The other two parameters, `JsonSerializerOptions` and `CancellationToken`, are optional and are omitted in the code snippet. + The first argument to `GetFromJsonAsync` method is an `await` expression. `await` expressions can appear almost anywhere in your code, even though up to now, you've only seen them as part of an assignment statement. The next parameter, `requestUri` is optional and doesn't have to be provided if was already specified when creating the `client` object. You didn't provide the `client` object with the URI to send request to, so you specified the URI now. The last optional parameter, the `CancellationToken` is omitted in the code snippet. - The `DeserializeAsync` method is [*generic*](../fundamentals/types/generics.md), which means you supply type arguments for what kind of objects should be created from the JSON text. In this example, you're deserializing to a `List`, which is another generic object, a . The `List` class stores a collection of objects. The type argument declares the type of objects stored in the `List`. The type argument is your `Repository` record, because the JSON text represents a collection of repository objects. + The `GetFromJsonAsync` method is [*generic*](../fundamentals/types/generics.md), which means you supply type arguments for what kind of objects should be created from the fetched JSON text. In this example, you're deserializing to a `List`, which is another generic object, a . The `List` class stores a collection of objects. The type argument declares the type of objects stored in the `List`. The type argument is your `Repository` record, because the JSON text represents a collection of repository objects. 1. Add code to display the name of each repository. Replace the lines that read: @@ -161,14 +157,14 @@ The following steps convert the JSON response into C# objects. You use the ()) - Console.Write(repo.name); + Console.WriteLine(repo.Name); ``` 1. The following `using` directives should be present at the top of the file: ```csharp using System.Net.Http.Headers; - using System.Text.Json; + using System.Net.Http.Json; ``` 1. Run the app. @@ -179,33 +175,6 @@ The following steps convert the JSON response into C# objects. You use the to specify how this property appears in the JSON. - -1. In *Program.cs*, update the code to use the new capitalization of the `Name` property: - - ```csharp - foreach (var repo in repositories) - Console.Write(repo.Name); - ``` - -1. Run the app. - - The output is the same. - ## Refactor the code The `ProcessRepositoriesAsync` method can do the async work and return a collection of the repositories. Change that method to return `Task>`, and move the code that writes to the console near its caller. @@ -219,10 +188,7 @@ The `ProcessRepositoriesAsync` method can do the async work and return a collect 1. Return the repositories after processing the JSON response: ```csharp - await using Stream stream = - await client.GetStreamAsync("https://api.github.com/orgs/dotnet/repos"); - var repositories = - await JsonSerializer.DeserializeAsync>(stream); + var repositories = await client.GetFromJsonAsync>("https://api.github.com/orgs/dotnet/repos"); return repositories ?? new(); ``` @@ -234,7 +200,7 @@ The `ProcessRepositoriesAsync` method can do the async work and return a collect var repositories = await ProcessRepositoriesAsync(client); foreach (var repo in repositories) - Console.Write(repo.Name); + Console.WriteLine(repo.Name); ``` 1. Run the app. @@ -248,18 +214,20 @@ The following steps add code to process more of the properties in the received J 1. Replace the contents of `Repository` class, with the following `record` definition: ```csharp - using System.Text.Json.Serialization; - public record class Repository( - [property: JsonPropertyName("name")] string Name, - [property: JsonPropertyName("description")] string Description, - [property: JsonPropertyName("html_url")] Uri GitHubHomeUrl, - [property: JsonPropertyName("homepage")] Uri Homepage, - [property: JsonPropertyName("watchers")] int Watchers); + string Name, + string Description, + Uri GitHubHomeUrl, + Uri Homepage, + int Watchers, + DateTime LastPushUtc + ); ``` The and `int` types have built-in functionality to convert to and from string representation. No extra code is needed to deserialize from JSON string format to those target types. If the JSON packet contains data that doesn't convert to a target type, the serialization action throws an exception. + JSON most often uses lowercase for names of it's objects, however we don't need to make any conversion and can keep the uppercase of the fields names, because, like mentioned in one of previous points, the `GetFromJsonAsync` extension method is case-insensitive when it comes to property names. + 1. Update the `foreach` loop in the *Program.cs* file to display the property values: ```csharp diff --git a/docs/csharp/tutorials/snippets/WebAPIClient/Program.cs b/docs/csharp/tutorials/snippets/WebAPIClient/Program.cs index 141266bb4e36d..eee777bdc50cf 100644 --- a/docs/csharp/tutorials/snippets/WebAPIClient/Program.cs +++ b/docs/csharp/tutorials/snippets/WebAPIClient/Program.cs @@ -1,5 +1,5 @@ using System.Net.Http.Headers; -using System.Text.Json; +using System.Net.Http.Json; using HttpClient client = new(); client.DefaultRequestHeaders.Accept.Clear(); @@ -22,9 +22,6 @@ static async Task> ProcessRepositoriesAsync(HttpClient client) { - await using Stream stream = - await client.GetStreamAsync("https://api.github.com/orgs/dotnet/repos"); - var repositories = - await JsonSerializer.DeserializeAsync>(stream); - return repositories ?? new(); + var repositories = await client.GetFromJsonAsync>("https://api.github.com/orgs/dotnet/repos"); + return repositories ?? new List(); } diff --git a/docs/csharp/tutorials/snippets/WebAPIClient/Repository.cs b/docs/csharp/tutorials/snippets/WebAPIClient/Repository.cs index 2ecb2c67a721d..cd2d4e559dc29 100644 --- a/docs/csharp/tutorials/snippets/WebAPIClient/Repository.cs +++ b/docs/csharp/tutorials/snippets/WebAPIClient/Repository.cs @@ -1,12 +1,11 @@ -using System.Text.Json.Serialization; - -public record class Repository( - [property: JsonPropertyName("name")] string Name, - [property: JsonPropertyName("description")] string Description, - [property: JsonPropertyName("html_url")] Uri GitHubHomeUrl, - [property: JsonPropertyName("homepage")] Uri Homepage, - [property: JsonPropertyName("watchers")] int Watchers, - [property: JsonPropertyName("pushed_at")] DateTime LastPushUtc) +public record class Repository( + string Name, + string Description, + Uri GitHubHomeUrl, + Uri Homepage, + int Watchers, + DateTime LastPushUtc +) { public DateTime LastPush => LastPushUtc.ToLocalTime(); } diff --git a/docs/framework/release-notes/2025/08-26-august-cumulative-update-preview.md b/docs/framework/release-notes/2025/08-26-august-cumulative-update-preview.md index df02696603488..9b2477253d723 100644 --- a/docs/framework/release-notes/2025/08-26-august-cumulative-update-preview.md +++ b/docs/framework/release-notes/2025/08-26-august-cumulative-update-preview.md @@ -6,6 +6,7 @@ ms.date: 08/26/2025 # August 2025 cumulative update preview _Released August 26, 2025_ +_Update August 29, 2025 to include Windows 11, version 24H2 ## Summary of what's new in this release @@ -36,6 +37,8 @@ The following table outlines the updates in this release. | Product version | Cumulative update preview | | --- | --- | +| **Windows 11, version 24H2** | | +| .NET Framework 3.5, 4.8.1 | [5064401](https://support.microsoft.com/kb/5064401) | | **Windows 11, version 23H2** | | | .NET Framework 3.5, 4.8.1 | [5064403](https://support.microsoft.com/kb/5064403) | | **Windows 10, version 22H2** | **[5064794](https://support.microsoft.com/kb/5064794)** | diff --git a/docs/fundamentals/toc.yml b/docs/fundamentals/toc.yml index a60ca93629a6e..5fd27bcf17177 100644 --- a/docs/fundamentals/toc.yml +++ b/docs/fundamentals/toc.yml @@ -73,8 +73,6 @@ items: href: ../core/install/linux-package-mixup.md - name: How to check .NET versions href: ../core/install/how-to-detect-installed-versions.md - - name: Install localized IntelliSense - href: ../core/install/localized-intellisense.md - name: Overview items: - name: Introduction to .NET diff --git a/docs/navigate/tools-diagnostics/index.yml b/docs/navigate/tools-diagnostics/index.yml index 521fd61399d04..ee9331f903a4d 100644 --- a/docs/navigate/tools-diagnostics/index.yml +++ b/docs/navigate/tools-diagnostics/index.yml @@ -98,8 +98,6 @@ landingContent: url: ../../core/diagnostics/diagnostic-health-checks.md - text: Exception summary url: ../../core/diagnostics/diagnostic-exception-summary.md - - text: Resource monitoring - url: ../../core/diagnostics/diagnostic-resource-monitoring.md - linkListType: reference links: - text: Unmanaged API for debugging diff --git a/docs/navigate/tools-diagnostics/toc.yml b/docs/navigate/tools-diagnostics/toc.yml index 879d10f03a470..2220f172b118a 100644 --- a/docs/navigate/tools-diagnostics/toc.yml +++ b/docs/navigate/tools-diagnostics/toc.yml @@ -359,6 +359,8 @@ items: href: ../../core/diagnostics/index.md - name: Managed debuggers href: ../../core/diagnostics/managed-debuggers.md + - name: Profiling tools + href: ../../core/diagnostics/profilers.md - name: Logging & tracing options href: ../../core/diagnostics/logging-tracing.md - name: ILogger Logging @@ -377,8 +379,6 @@ items: href: ../../core/diagnostics/observability-prgrja-example.md - name: "Example: Use OpenTelemetry with Azure Monitor and Application Insights" href: ../../core/diagnostics/observability-applicationinsights.md - - name: Resource monitoring - href: ../../core/diagnostics/diagnostic-resource-monitoring.md displayName: resource monitoring, - name: App health checks href: ../../core/diagnostics/diagnostic-health-checks.md @@ -423,6 +423,8 @@ items: href: ../../core/diagnostics/event-counter-perf.md - name: Compare metric APIs href: ../../core/diagnostics/compare-metric-apis.md + - name: Resource monitoring + href: ../../core/diagnostics/diagnostic-resource-monitoring.md - name: Migrate from Windows Performance Counters href: ../../core/diagnostics/migrate-from-windows-performance-counters.md - name: Distributed tracing diff --git a/docs/standard/serialization/system-text-json/snippets/how-to/csharp/DeserializeExtra.cs b/docs/standard/serialization/system-text-json/snippets/how-to/csharp/DeserializeExtra.cs index 68f3a8fa6b6ae..779808eb11294 100644 --- a/docs/standard/serialization/system-text-json/snippets/how-to/csharp/DeserializeExtra.cs +++ b/docs/standard/serialization/system-text-json/snippets/how-to/csharp/DeserializeExtra.cs @@ -34,15 +34,15 @@ public static void Main() "2019-08-02T00:00:00-07:00" ], "TemperatureRanges": { - "Cold": { - "High": 20, + "Cold": { + "High": 20, "Low": -10 - }, + }, "Hot": { - "High": 60, + "High": 60, "Low": 20 } - }, + }, "SummaryWords": [ "Cool", "Windy",