From 6097607a7ee76557f58430cdff05b04a82ef8930 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 22 Oct 2026 07:15:56 -0700 Subject: [PATCH 01/10] remove invalid owners and simplify (#56524) --- .github/CODEOWNERS | 239 +++++---------------------------------------- 1 file changed, 27 insertions(+), 212 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 51d43cbc463a9..ef0fa0ca82b2c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,245 +1,60 @@ # Lines starting with '#' are comments. # Each line is a file pattern followed by one or more owners. - +# Order is important. The last matching pattern has the most precedence. # More details are here: https://help.github.com/articles/about-codeowners/ # The '*' pattern is global owners. - -* @dotnet/docs - -.github/ @dotnet/docs - -# Order is important. The last matching pattern has the most precedence. -# The folders are ordered as follows: -# . Guides -# . .NET Core sections -# . .NET Framework sections -# . .NET Standard -# . Architecture e-books - -# In each subsection, folders are order first by depth, then alphabetically. -# This should make it easy to add new rules without breaking existing ones. +* @BillWagner ######## API landing page ########### -/api/ @gewarren @dotnet/docs - -######## Includes files ########### -/includes/ @dotnet/docs - -############ What's new ############### -/docs/whats-new/ @gewarren @dotnet/docs +/api/ @gewarren @BillWagner ############ Guides ################ -# .NET Core -/docs/core/ @dotnet/docs - -# .NET fundamentals -/docs/fundamentals/ @dotnet/docs - -# .NET Framework -/docs/framework/ @dotnet/docs - -# .NET Standard -/docs/standard/ @gewarren @dotnet/docs - -# The C# Guide: -/docs/csharp/ @BillWagner @dotnet/docs - -# The F# Guide: -/docs/fsharp/ @BillWagner @dotnet/fsharp-team-msft @dotnet/docs - -# The Visual Basic Guide: -/docs/visual-basic/ @BillWagner @dotnet/docs +# The F# Guide +/docs/fsharp/ @dotnet/fsharp-team-msft @BillWagner -# The ML.NET Guide: -/docs/machine-learning/ @gewarren @luisquintanilla @JakeRadMSFT @dotnet/docs - -# The .NET Architecture Guide: -/docs/architecture/ @dotnet/docs +# The ML.NET Guide +/docs/machine-learning/ @luisquintanilla @JakeRadMSFT @BillWagner # .NET Orleans -/docs/orleans/ @meaghanlewis @ReubenBond - -# IoT Guide -/docs/iot/ @dotnet/docs - -############### AI ################ - -/docs/ai/ @gewarren @dotnet/docs +/docs/orleans/ @ReubenBond @BillWagner ############### Azure ################ - -# Azure Guide -/docs/azure/ @dotnet/docs - -# Azure SDK package list -/docs/azure/includes/ @dotnet/docs - # Azure SDK catch-all entry -/docs/azure/sdk/ @JonathanGiles @dotnet/docs +/docs/azure/sdk/ @JonathanGiles @BillWagner # Azure SDK authentication topics -/docs/azure/sdk/authentication/ @JonathanCrd @dotnet/docs +/docs/azure/sdk/authentication/ @JonathanCrd @BillWagner # Azure SDK miscellaneous topics -/docs/azure/sdk/azure-sdk-configure-proxy.md @JoshLove-msft @JonathanGiles @dotnet/docs -/docs/azure/sdk/azure-sdk-for-net.md @JonathanGiles @dotnet/docs -/docs/azure/sdk/dependency-injection.md @JoshLove-msft @JonathanGiles @m-nash @dotnet/docs -/docs/azure/sdk/logging.md @JoshLove-msft @JonathanGiles @dotnet/docs -/docs/azure/sdk/packages.md @JonathanGiles @dotnet/docs -/docs/azure/sdk/pagination.md @JoshLove-msft @JonathanGiles @dotnet/docs -/docs/azure/sdk/protocol-convenience-methods.md @JonathanGiles @dotnet/docs -/docs/azure/sdk/resource-management.md @ArthurMa1978 @m-nash @dotnet/docs -/docs/azure/sdk/thread-safety.md @JoshLove-msft @JonathanGiles @dotnet/docs -/docs/azure/sdk/unit-testing-mocking.md @JoshLove-msft @JonathanGiles @dotnet/docs - -############### Fundamentals ################ - -# Code analysis -/docs/fundamentals/code-analysis/ @gewarren @dotnet/docs +/docs/azure/sdk/azure-sdk-configure-proxy.md @JoshLove-msft @JonathanGiles @BillWagner +/docs/azure/sdk/azure-sdk-for-net.md @JonathanGiles @BillWagner +/docs/azure/sdk/dependency-injection.md @JoshLove-msft @JonathanGiles @m-nash @BillWagner +/docs/azure/sdk/logging.md @JoshLove-msft @JonathanGiles @BillWagner +/docs/azure/sdk/packages.md @JonathanGiles @BillWagner +/docs/azure/sdk/pagination.md @JoshLove-msft @JonathanGiles @BillWagner +/docs/azure/sdk/protocol-convenience-methods.md @JonathanGiles @BillWagner +/docs/azure/sdk/resource-management.md @ArthurMa1978 @m-nash @BillWagner +/docs/azure/sdk/thread-safety.md @JoshLove-msft @JonathanGiles @BillWagner +/docs/azure/sdk/unit-testing-mocking.md @JoshLove-msft @JonathanGiles @BillWagner ############### .NET Core ######################## -# Breaking changes -/docs/core/compatibility/ @gewarren @dotnet/docs -# Containers -/docs/core/containers/ @dotnet/docs -# Deployment -/docs/core/deploying/ @adegeo @dotnet/docs # Diagnostics -/docs/core/diagnostics/ @tommcdon @dotnet/docs -# Docker -/docs/core/docker/ @adegeo @dotnet/docs -# Extensions -/docs/core/extensions/ @gewarren @dotnet/docs -# Install -/docs/core/install/ @adegeo @dotnet/docs -# Project SDKs -/docs/core/project-sdk/ @gewarren @dotnet/docs -# Config settings -/docs/core/runtime-config/ @gewarren @dotnet/docs +/docs/core/diagnostics/ @tommcdon @BillWagner # Testing -/docs/core/testing/ @meaghanlewis @dotnet/dotnet-testing -# Tools -/docs/core/tools/ @meaghanlewis @dotnet/docs -# Tutorials -/docs/core/tutorials/ @meaghanlewis @dotnet/docs -# What's new -/docs/core/whats-new/ @dotnet/docs +/docs/core/testing/ @dotnet/dotnet-testing @BillWagner ################### .NET Framework ################## -# App domains -/docs/framework/app-domains/ @gewarren @dotnet/docs -# Config - WinForms -/docs/framework/configure-apps/file-schema/winforms/ @adegeo @dotnet/docs -# Deployment -/docs/framework/deployment/ @adegeo @dotnet/docs -# Installation -/docs/framework/install/ @adegeo @dotnet/docs -# Migration guide -/docs/framework/migration-guide/ @gewarren @dotnet/docs -# Reflection -/docs/framework/reflection-and-codedom/ @adegeo @dotnet/docs -# Resources -/docs/framework/resources/ @adegeo @dotnet/docs -# Tools -/docs/framework/tools/ @gewarren @dotnet/docs -# UI Automation -/docs/framework/ui-automation/ @adegeo @dotnet/docs -# What's New -/docs/framework/whats-new/ @gewarren @dotnet/docs -# Winforms -/docs/framework/winforms/ @adegeo @dotnet/docs -# WPF -/docs/framework/wpf/ @adegeo @dotnet/docs -# XAML Services -/docs/framework/xaml-services/ @adegeo @dotnet/docs -# ADO.NET -/docs/framework/data/ @dotnet/docs # NCL -/docs/framework/configure-apps/file-schema/network/ @karelz @dotnet/docs -/docs/framework/network-programming/ @karelz @dotnet/docs -# WCF -/docs/framework/configure-apps/file-schema/wcf/ @dotnet/docs -/docs/framework/wcf/ @dotnet/docs +/docs/framework/configure-apps/file-schema/network/ @karelz @BillWagner +/docs/framework/network-programming/ @karelz @BillWagner ################## .NET Standard ################## -# Analyzers -/docs/standard/analyzers/ @gewarren @dotnet/docs -# Assembly -/docs/standard/assembly/ @gewarren @dotnet/docs -# Asynchronous Programming Patterns -/docs/standard/asynchronous-programming-patterns/ @BillWagner @dotnet/docs -# Attributes -/docs/standard/attributes/ @gewarren @dotnet/docs -# Character encoding -/docs/standard/base-types/character-encoding/ @gewarren @dotnet/docs -/docs/standard/base-types/character-encoding-introduction/ @gewarren @dotnet/docs -# Base types -/docs/standard/base-types/ @adegeo @dotnet/docs -# Collections -/docs/standard/collections/ @adegeo @dotnet/docs -# System.CommandLine -/docs/standard/commandline/ @gewarren @dotnet/docs -# Data -/docs/standard/data/ @gewarren @dotnet/docs -# Data - SQLite -/docs/standard/data/sqlite/ @dotnet/docs -# Datetime -/docs/standard/datetime/ @adegeo @dotnet/docs -# Design guidelines -/docs/standard/design-guidelines/ @BillWagner @dotnet/docs -# Events -/docs/standard/events/ @adegeo @dotnet/docs -# Exceptions -/docs/standard/exceptions/ @gewarren @dotnet/docs -# GC -/docs/standard/garbage-collection/ @gewarren @dotnet/docs -# Generics -/docs/standard/generics/ @adegeo @dotnet/docs -# Globalization -/docs/standard/globalization-localization/ @dotnet/docs @dotnet/docs -# I/O -/docs/standard/io/ @adegeo @dotnet/docs # Library guidance -/docs/standard/library-guidance/ @jamesnk @dotnet/docs -# LINQ -/docs/standard/linq/ @dotnet/docs -# Memory and spans -/docs/standard/memory-and-spans/ @gewarren @dotnet/docs +/docs/standard/library-guidance/ @jamesnk @BillWagner # Native Interop -/docs/standard/native-interop/ @jkoritzinsky @dotnet/docs -# Parallel programming -/docs/standard/parallel-programming/ @adegeo @dotnet/docs -# Security -/docs/standard/security/ @BillWagner @dotnet/docs -# Serialization -/docs/standard/serialization/ @gewarren @dotnet/docs -# Threading -/docs/standard/threading/ @BillWagner @dotnet/docs -# What's New -/docs/standard/whats-new/ @dotnet/docs +/docs/standard/native-interop/ @jkoritzinsky @BillWagner ################## E-books ################## # Blazor: -/docs/architecture/blazor-for-web-forms-developers/ @danroth27 @dotnet/docs -# Desktop: -/docs/architecture/modernize-desktop/ @adegeo @dotnet/docs - -################# Samples folder ############## - -## These have been pulled directly from the samples repo: - -# C# snippets: -/samples/snippets/csharp/ @BillWagner @dotnet/docs -# Visual Basic snippets: -/samples/snippets/visualbasic/ @BillWagner @dotnet/docs -# F# Snippets: -/samples/snippets/fsharp/ @dotnet/docs - -# WPF folders: -/samples/snippets/xaml/wpf/ @adegeo @dotnet/docs -/samples/snippets/csharp/wpf/ @adegeo @dotnet/docs -/samples/snippets/visualbasic/wpf/ @adegeo @dotnet/docs -/samples/snippets/desktop-guide/wpf/ @adegeo @dotnet/docs - -/samples/snippets/winforms/ @adegeo @dotnet/docs +/docs/architecture/blazor-for-web-forms-developers/ @danroth27 @BillWagner From bc8a4bae46a5bd6540c1b535432dd44eab0e2bcc Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 22 Oct 2026 07:16:54 -0700 Subject: [PATCH 02/10] Update disallow-edits.yml to include new bot (#56515) Add learn-build-service-prod bot to disallowed edits policy --- .github/policies/disallow-edits.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/policies/disallow-edits.yml b/.github/policies/disallow-edits.yml index f00e48d6612b5..41281c4b61b39 100644 --- a/.github/policies/disallow-edits.yml +++ b/.github/policies/disallow-edits.yml @@ -33,6 +33,8 @@ configuration: user: dotnet-policy-service[bot] - isActivitySender: user: github-actions[bot] + - isActivitySender: + user: learn-build-service-prod[bot] then: - addReply: reply: >- From c02d3002666585469ba5f4ca48c0a01a14ecbcfd Mon Sep 17 00:00:00 2001 From: surya pratap singh Date: Thu, 22 Oct 2026 19:57:09 +0530 Subject: [PATCH 03/10] Fix typo in F# compiler directives: relate the the file -> relate to the file (#56520) --- docs/fsharp/language-reference/compiler-directives.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fsharp/language-reference/compiler-directives.md b/docs/fsharp/language-reference/compiler-directives.md index 38169df1c1d64..6343124738680 100644 --- a/docs/fsharp/language-reference/compiler-directives.md +++ b/docs/fsharp/language-reference/compiler-directives.md @@ -138,7 +138,7 @@ When you use the `#line` directive, file names must be enclosed in quotation mar These tokens indicate that the F# code generated at this location is derived from some constructs at or near line `25` in `Script1`. -Note that `#line` directives do not influence the behavior of `#nowarn` / `#warnon`. These two directives always relate the the file that is being compiled. +Note that `#line` directives do not influence the behavior of `#nowarn` / `#warnon`. These two directives always relate to the file that is being compiled. ## Warn Directives From 9b5f5f81de8fd9851fc46273e93e8664d9cc3556 Mon Sep 17 00:00:00 2001 From: David Levy Date: Thu, 22 Oct 2026 09:37:02 -0500 Subject: [PATCH 04/10] docs: clarify required legacy SqlClient examples (#56464) * docs: clarify required legacy SqlClient examples Add page notices and displayed sample comments only where .NET Framework integrations require System.Data.SqlClient. Preserve existing executable examples. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b0a4c59a-563b-44a5-ae83-8c4b9fe56ebc * docs: warn on retained SqlClient integration guidance Add page-only notices to six existing Entity Framework and LINQ to SQL integration articles. Preserve code and avoid artificial snippets. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b0a4c59a-563b-44a5-ae83-8c4b9fe56ebc * build: restore legacy Entity Framework reference assemblies Restore portable net40 reference assemblies for the legacy VB sample and use the resolved Visual Basic runtime without changing its target framework or sample code. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b0a4c59a-563b-44a5-ae83-8c4b9fe56ebc * fix: correct retained LINQ sample operations Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b0a4c59a-563b-44a5-ae83-8c4b9fe56ebc --------- Copilot-Session: b0a4c59a-563b-44a5-ae83-8c4b9fe56ebc --- .../framework/data/adonet/code-access-security.md | 8 +++++++- .../data/adonet/ef/edm-generator-edmgen-exe.md | 6 +++++- ...ityclient-provider-for-the-entity-framework.md | 6 +++++- ...sues-and-considerations-in-linq-to-entities.md | 12 ++++++++++-- .../data/adonet/ef/security-considerations.md | 6 +++++- .../ef/sqlclient-for-the-entity-framework.md | 6 +++++- .../adonet/sql/linq/ado-net-and-linq-to-sql.md | 8 ++++++-- .../sql/linq/how-to-connect-to-a-database.md | 6 +++++- .../linq/how-to-display-linq-to-sql-commands.md | 6 +++++- ...etween-an-ado-net-command-and-a-datacontext.md | 6 +++++- .../adonet/sql/linq/security-in-linq-to-sql.md | 6 +++++- .../data/adonet/sql/linq/troubleshooting.md | 6 +++++- .../DataWorks SqlClient.CAS/CS/source.cs | 2 ++ .../VS_Snippets_Data/DLinqAdoNet/cs/Program.cs | 10 +++++++++- .../DLinqCommunicatingWithDatabase/cs/Program.cs | 8 ++++++++ .../DLinqDebuggingSupport/cs/Program.cs | 2 ++ .../DP L2E Conceptual Examples/CS/Program.cs | 12 +++++++++++- .../DataWorks SqlClient.CAS/VB/source.vb | 2 ++ .../VS_Snippets_Data/DLinqAdoNet/vb/Module1.vb | 15 ++++++++++++--- .../DLinqCommunicatingWithDatabase/vb/Module1.vb | 10 +++++++++- .../DLinqDebuggingSupport/vb/Module1.vb | 2 ++ .../DP L2E Conceptual Examples/VB/Module1.vb | 12 ++++++++++++ .../VB/l2e_conceptualexamplesvb.vbproj | 10 ++++++++++ 23 files changed, 147 insertions(+), 20 deletions(-) diff --git a/docs/framework/data/adonet/code-access-security.md b/docs/framework/data/adonet/code-access-security.md index 6571c77f98af5..ad2beb3f2c581 100644 --- a/docs/framework/data/adonet/code-access-security.md +++ b/docs/framework/data/adonet/code-access-security.md @@ -1,13 +1,17 @@ --- description: "Learn more about: Code Access Security and ADO.NET. Whether the code is allowed to run or not depends on the code's origin or other aspects of its identity." title: "Code Access Security" -ms.date: "03/30/2017" +ms.date: "10/19/2026" +ai-usage: ai-assisted dev_langs: - "csharp" - "vb" --- # Code access security and ADO.NET +> [!IMPORTANT] +> Do not use `System.Data.SqlClient` for new development. Use [Microsoft.Data.SqlClient](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace) for new SQL Server data-access code. The examples on this page retain `System.Data.SqlClient` because they demonstrate the built-in .NET Framework provider's code access security permissions. Code access security isn't supported in modern .NET. + .NET Framework offers role-based security as well as code access security (CAS), both of which are implemented using a common infrastructure supplied by the common language runtime (CLR). In the world of unmanaged code, most applications execute with the permissions of the user or principal. As a result, computer systems can be damaged and private data compromised when malicious or error-filled software is run by a user with elevated privileges. By contrast, managed code executing in .NET Framework includes code access security, which applies to code alone. Whether the code is allowed to run or not depends on the code's origin or other aspects of the code's identity, not solely the identity of the principal. This reduces the likelihood that managed code can be misused. @@ -158,6 +162,8 @@ To determine whether code is authorized to access a resource or perform an opera The following is a sample permission set for the .NET Framework Data Provider for SQL Server in a partially trusted scenario. For information on creating custom permission sets, see [Configuring Permission Sets Using Caspol.exe](/previous-versions/dotnet/netframework-4.0/4ybs46y6(v=vs.100)). ```xml + [!IMPORTANT] +> Do not use `System.Data.SqlClient` for new development. Use [Microsoft.Data.SqlClient](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace) for new SQL Server data-access code. The `EdmGen.exe` tool documented here belongs to the built-in Entity Framework implementation in .NET Framework and defaults to its `System.Data.SqlClient` provider. Changing that integration requires more than replacing the provider name. + EdmGen.exe is a command-line tool used for working with Entity Framework model and mapping files. You can use the EdmGen.exe tool to do the following: - Connect to a data source by using a data source–specific .NET Framework data provider, and generate the conceptual model (.csdl), storage model (.ssdl), and mapping (.msl) files that are used by the Entity Framework. For more information, see [How to: Use EdmGen.exe to Generate the Model and Mapping Files](how-to-use-edmgen-exe-to-generate-the-model-and-mapping-files.md). diff --git a/docs/framework/data/adonet/ef/entityclient-provider-for-the-entity-framework.md b/docs/framework/data/adonet/ef/entityclient-provider-for-the-entity-framework.md index c4a5ac87bfe05..5b16dc4797bab 100644 --- a/docs/framework/data/adonet/ef/entityclient-provider-for-the-entity-framework.md +++ b/docs/framework/data/adonet/ef/entityclient-provider-for-the-entity-framework.md @@ -1,11 +1,15 @@ --- description: "Learn more about EntityClient Provider for Entity Framework, a data provider used by Entity Framework apps to access data described in a conceptual model." title: "EntityClient Provider for the Entity Framework" -ms.date: "03/30/2017" +ms.date: "10/19/2026" +ai-usage: ai-assisted ms.custom: sfi-ropc-nochange --- # EntityClient Provider for Entity Framework +> [!IMPORTANT] +> Do not use `System.Data.SqlClient` for new development. Use [Microsoft.Data.SqlClient](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace) for new SQL Server data-access code. The built-in Entity Framework SQL provider described here uses `System.Data.SqlClient`. To change that provider, you must migrate the Entity Framework integration, not just replace a namespace. The provider-independent EntityClient APIs on this page also support other data providers. + The EntityClient provider is a data provider used by Entity Framework applications to access data described in a conceptual model. For information about conceptual models, see [Modeling and Mapping](modeling-and-mapping.md). EntityClient uses other .NET Framework data providers to access the data source. For example, EntityClient uses the .NET Framework Data Provider for SQL Server (SqlClient) when accessing a SQL Server database. For information about the SqlClient provider, see [SqlClient for the Entity Framework](sqlclient-for-the-entity-framework.md). The EntityClient provider is implemented in the namespace. ## Managing Connections diff --git a/docs/framework/data/adonet/ef/language-reference/known-issues-and-considerations-in-linq-to-entities.md b/docs/framework/data/adonet/ef/language-reference/known-issues-and-considerations-in-linq-to-entities.md index 57138e90cef78..d4496465069bf 100644 --- a/docs/framework/data/adonet/ef/language-reference/known-issues-and-considerations-in-linq-to-entities.md +++ b/docs/framework/data/adonet/ef/language-reference/known-issues-and-considerations-in-linq-to-entities.md @@ -1,7 +1,8 @@ --- description: "Learn more about: Known Issues and Considerations in LINQ to Entities" title: "Known Issues and Considerations in LINQ to Entities" -ms.date: "03/30/2017" +ms.date: "10/20/2026" +ai-usage: ai-assisted dev_langs: - "csharp" - "vb" @@ -9,6 +10,9 @@ ms.assetid: acd71129-5ff0-4b4e-b266-c72cc0c53601 --- # Known Issues and Considerations in LINQ to Entities +> [!IMPORTANT] +> Do not use `System.Data.SqlClient` for new development. Use [Microsoft.Data.SqlClient](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace) for new SQL Server data-access code. These examples retain `System.Data.SqlClient` through the built-in Entity Framework SQL provider in `System.Data.Entity`. To change that provider, you must migrate the Entity Framework integration, not just replace a namespace. + This section provides information about known issues with LINQ to Entities queries. - [LINQ Queries That cannot be Cached](#LINQQueriesThatAreNotCached) @@ -44,7 +48,11 @@ This section provides information about known issues with LINQ to Entities queri ## Unsigned Integers Not Supported - Specifying an unsigned integer type in a LINQ to Entities query is not supported because the Entity Framework does not support unsigned integers. If you specify an unsigned integer, an exception will be thrown during the query expression translation, as shown in the following example. This example queries for an order with ID 48000. + The built-in Entity Framework provider doesn't support unsigned integer constants in a query expression. The outcome of a comparison that uses an unsigned variable depends on the conversions in its expression tree. + + In the following C# example, the comparison converts both operands to `Int64`. The query returns the order with ID 48000 instead of throwing an exception. This result doesn't imply general support for `UInt32` query values. + + The Visual Basic example contains checked conversions in its expression tree. The provider throws for the `UInt32` value during query translation, before it sends the query to SQL Server. [!code-csharp[DP L2E Conceptual Examples#UIntAsQueryParam](../../../../../../samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/Program.cs#uintasqueryparam)] [!code-vb[DP L2E Conceptual Examples#UIntAsQueryParam](../../../../../../samples/snippets/visualbasic/VS_Snippets_Data/DP L2E Conceptual Examples/VB/Module1.vb#uintasqueryparam)] diff --git a/docs/framework/data/adonet/ef/security-considerations.md b/docs/framework/data/adonet/ef/security-considerations.md index 789e66e5bf069..1eec08adeebef 100644 --- a/docs/framework/data/adonet/ef/security-considerations.md +++ b/docs/framework/data/adonet/ef/security-considerations.md @@ -1,10 +1,14 @@ --- description: "Learn more about security considerations that are specific to developing, deploying, and running Entity Framework applications." title: "Security Considerations (Entity Framework)" -ms.date: "03/30/2017" +ms.date: "10/19/2026" +ai-usage: ai-assisted --- # Security Considerations (Entity Framework) +> [!IMPORTANT] +> Do not use `System.Data.SqlClient` for new development. Use [Microsoft.Data.SqlClient](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace) for new SQL Server data-access code. This page describes the built-in Entity Framework implementation in .NET Framework, including its `System.Data.SqlClient` permission types. To change that provider, you must migrate the Entity Framework integration, not just replace a namespace. + This article describes security considerations that are specific to developing, deploying, and running Entity Framework applications. You should also follow recommendations for creating secure .NET Framework applications. For more information, see [Security Overview](../security-overview.md). ## General Security Considerations diff --git a/docs/framework/data/adonet/ef/sqlclient-for-the-entity-framework.md b/docs/framework/data/adonet/ef/sqlclient-for-the-entity-framework.md index 879a08881181e..fcc2604e9f5d2 100644 --- a/docs/framework/data/adonet/ef/sqlclient-for-the-entity-framework.md +++ b/docs/framework/data/adonet/ef/sqlclient-for-the-entity-framework.md @@ -1,11 +1,15 @@ --- description: "Learn more about: SqlClient for the Entity Framework" title: "SqlClient for the Entity Framework" -ms.date: "03/30/2017" +ms.date: "10/19/2026" +ai-usage: ai-assisted ms.assetid: 9a5d6d39-d955-43a5-a5c2-931c239398f1 --- # SqlClient for the Entity Framework +> [!IMPORTANT] +> Do not use `System.Data.SqlClient` for new development. Use [Microsoft.Data.SqlClient](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace) for new SQL Server data-access code. The provider name on this page selects the built-in Entity Framework SQL provider in .NET Framework. To use a different provider, you must migrate the Entity Framework integration, not just replace the `Provider` attribute. + This section describes the .NET Framework Data Provider for SQL Server (SqlClient), which enables the Entity Framework to work over Microsoft SQL Server. ## Provider Schema Attribute diff --git a/docs/framework/data/adonet/sql/linq/ado-net-and-linq-to-sql.md b/docs/framework/data/adonet/sql/linq/ado-net-and-linq-to-sql.md index 15ec5cffc3630..38648b1fac807 100644 --- a/docs/framework/data/adonet/sql/linq/ado-net-and-linq-to-sql.md +++ b/docs/framework/data/adonet/sql/linq/ado-net-and-linq-to-sql.md @@ -2,7 +2,8 @@ description: "Learn more about: ADO.NET and LINQ to SQL" title: "ADO.NET and LINQ to SQL" titleSuffix: "" -ms.date: "03/30/2017" +ms.date: "10/20/2026" +ai-usage: ai-assisted dev_langs: - "csharp" - "vb" @@ -10,6 +11,9 @@ ms.assetid: 49ac6da0-f2e1-46fa-963e-1b6dcb63fef7 --- # ADO.NET and LINQ to SQL +> [!IMPORTANT] +> Do not use `System.Data.SqlClient` for new development. Use [Microsoft.Data.SqlClient](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace) for new SQL Server data-access code. These examples retain `System.Data.SqlClient` because .NET Framework's built-in LINQ to SQL provider requires it. Changing the connection type alone doesn't migrate LINQ to SQL. + [!INCLUDE[vbtecdlinq](../../../../../../includes/vbtecdlinq-md.md)] is part of the ADO.NET family of technologies. It is based on services provided by the ADO.NET provider model. You can therefore mix [!INCLUDE[vbtecdlinq](../../../../../../includes/vbtecdlinq-md.md)] code with existing ADO.NET applications and migrate current ADO.NET solutions to [!INCLUDE[vbtecdlinq](../../../../../../includes/vbtecdlinq-md.md)]. The following illustration provides a high-level view of the relationship. ![LINQ to SQL and ADO.NET](./media/dlinq-3.png "DLinq_3") @@ -46,7 +50,7 @@ ms.assetid: 49ac6da0-f2e1-46fa-963e-1b6dcb63fef7 [!code-csharp[DLinqAdoNet#3](../../../../../../samples/snippets/csharp/VS_Snippets_Data/DLinqAdoNet/cs/Program.cs#3)] [!code-vb[DLinqAdoNet#3](../../../../../../samples/snippets/visualbasic/VS_Snippets_Data/DLinqAdoNet/vb/Module1.vb#3)] - As long as the column names in the tabular results match column properties of your entity class, [!INCLUDE[vbtecdlinq](../../../../../../includes/vbtecdlinq-md.md)] creates your objects out of any SQL query. + To materialize the mapped `Customer` entities, return columns that match their mapped properties and include `CustomerID`, the primary key. ### Parameters diff --git a/docs/framework/data/adonet/sql/linq/how-to-connect-to-a-database.md b/docs/framework/data/adonet/sql/linq/how-to-connect-to-a-database.md index 20896f62b1c41..7965b489f8f31 100644 --- a/docs/framework/data/adonet/sql/linq/how-to-connect-to-a-database.md +++ b/docs/framework/data/adonet/sql/linq/how-to-connect-to-a-database.md @@ -1,7 +1,8 @@ --- title: "How to: Connect to a Database" description: Learn how to use DataContext to connect to a database in LINQ to SQL. Refer to these examples to use DataContext to connect to a database and to get rows. -ms.date: "03/30/2017" +ms.date: "10/19/2026" +ai-usage: ai-assisted dev_langs: - "csharp" - "vb" @@ -9,6 +10,9 @@ ms.assetid: c33d74b3-530d-421b-a121-96786dd263a5 --- # How to: Connect to a Database +> [!IMPORTANT] +> Do not use `System.Data.SqlClient` for new development. Use [Microsoft.Data.SqlClient](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace) for new SQL Server data-access code. These examples retain `System.Data.SqlClient` because .NET Framework's built-in LINQ to SQL provider requires it. Changing the connection type alone doesn't migrate LINQ to SQL. + The is the main conduit by which you connect to a database, retrieve objects from it, and submit changes back to it. You use the just as you would use an ADO.NET . In fact, the is initialized with a connection or connection string that you supply. For more information, see [DataContext Methods (O/R Designer)](/visualstudio/data-tools/datacontext-methods-o-r-designer). The purpose of the is to translate your requests for objects into SQL queries to be made against the database, and then to assemble objects out of the results. The enables Language-Integrated Query (LINQ) by implementing the same operator pattern as the Standard Query Operators, such as `Where` and `Select`. diff --git a/docs/framework/data/adonet/sql/linq/how-to-display-linq-to-sql-commands.md b/docs/framework/data/adonet/sql/linq/how-to-display-linq-to-sql-commands.md index dcb19668123b2..8f6f1a00bcb7d 100644 --- a/docs/framework/data/adonet/sql/linq/how-to-display-linq-to-sql-commands.md +++ b/docs/framework/data/adonet/sql/linq/how-to-display-linq-to-sql-commands.md @@ -1,7 +1,8 @@ --- description: "Learn more about: How to: Display LINQ to SQL Commands" title: "How to: Display LINQ to SQL Commands" -ms.date: "03/30/2017" +ms.date: "10/19/2026" +ai-usage: ai-assisted dev_langs: - "csharp" - "vb" @@ -9,6 +10,9 @@ ms.assetid: 1decb05e-37ad-4ed6-ab2f-071eb4c4f628 --- # How to: Display LINQ to SQL Commands +> [!IMPORTANT] +> Do not use `System.Data.SqlClient` for new development. Use [Microsoft.Data.SqlClient](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace) for new SQL Server data-access code. These examples retain `System.Data.SqlClient` because .NET Framework's built-in LINQ to SQL provider requires it. Changing the connection type alone doesn't migrate LINQ to SQL. + Use to display SQL commands and other information. ## Example diff --git a/docs/framework/data/adonet/sql/linq/how-to-reuse-a-connection-between-an-ado-net-command-and-a-datacontext.md b/docs/framework/data/adonet/sql/linq/how-to-reuse-a-connection-between-an-ado-net-command-and-a-datacontext.md index dcfa464061e56..ccd0ed7a57f4d 100644 --- a/docs/framework/data/adonet/sql/linq/how-to-reuse-a-connection-between-an-ado-net-command-and-a-datacontext.md +++ b/docs/framework/data/adonet/sql/linq/how-to-reuse-a-connection-between-an-ado-net-command-and-a-datacontext.md @@ -1,7 +1,8 @@ --- description: "Learn more about: How to: Reuse a Connection Between an ADO.NET Command and a DataContext" title: "How to: Reuse a Connection Between an ADO.NET Command and a DataContext" -ms.date: "03/30/2017" +ms.date: "10/19/2026" +ai-usage: ai-assisted dev_langs: - "csharp" - "vb" @@ -9,6 +10,9 @@ ms.assetid: 7e26c7eb-c18a-43b5-a8f0-28fd8b04b0f0 --- # How to: Reuse a Connection Between an ADO.NET Command and a DataContext +> [!IMPORTANT] +> Do not use `System.Data.SqlClient` for new development. Use [Microsoft.Data.SqlClient](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace) for new SQL Server data-access code. These examples retain `System.Data.SqlClient` because .NET Framework's built-in LINQ to SQL provider requires it. Changing the connection type alone doesn't migrate LINQ to SQL. + Because [!INCLUDE[vbtecdlinq](../../../../../../includes/vbtecdlinq-md.md)] is a part of the ADO.NET family of technologies and is based on services provided by ADO.NET, you can reuse a connection between an ADO.NET command and a . ## Example diff --git a/docs/framework/data/adonet/sql/linq/security-in-linq-to-sql.md b/docs/framework/data/adonet/sql/linq/security-in-linq-to-sql.md index 0c617200cebea..fc5d77e83bcba 100644 --- a/docs/framework/data/adonet/sql/linq/security-in-linq-to-sql.md +++ b/docs/framework/data/adonet/sql/linq/security-in-linq-to-sql.md @@ -1,11 +1,15 @@ --- description: "Learn more about: Security in LINQ to SQL" title: "Security in LINQ to SQL" -ms.date: "03/30/2017" +ms.date: "10/19/2026" +ai-usage: ai-assisted ms.assetid: d49787f7-414e-4c71-aa33-80a5895536b1 --- # Security in LINQ to SQL +> [!IMPORTANT] +> Do not use `System.Data.SqlClient` for new development. Use [Microsoft.Data.SqlClient](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace) for new SQL Server data-access code. The connection guidance on this page retains `System.Data.SqlClient` because .NET Framework's built-in LINQ to SQL provider requires it. Changing the connection type alone doesn't migrate LINQ to SQL. + Security risks are always present when you connect to a database. Although LINQ to SQL may include some new ways to work with data in SQL Server, it does not provide any additional security mechanisms. ## Access Control and Authentication diff --git a/docs/framework/data/adonet/sql/linq/troubleshooting.md b/docs/framework/data/adonet/sql/linq/troubleshooting.md index 56932ae2a792d..f8e559ac51f1c 100644 --- a/docs/framework/data/adonet/sql/linq/troubleshooting.md +++ b/docs/framework/data/adonet/sql/linq/troubleshooting.md @@ -1,11 +1,15 @@ --- description: "Learn more about: Troubleshooting" title: "Troubleshooting" -ms.date: "03/30/2017" +ms.date: "10/19/2026" +ai-usage: ai-assisted ms.assetid: 8cd4401c-b12c-4116-a421-f3dcffa65670 --- # Troubleshooting +> [!IMPORTANT] +> Do not use `System.Data.SqlClient` for new development. Use [Microsoft.Data.SqlClient](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace) for new SQL Server data-access code. The provider-specific behavior on this page comes from .NET Framework's built-in LINQ to SQL provider, which requires `System.Data.SqlClient`. Changing the connection type alone doesn't migrate LINQ to SQL. + The following information exposes some issues you might encounter in your [!INCLUDE[vbtecdlinq](../../../../../../includes/vbtecdlinq-md.md)] applications, and provides suggestions to avoid or otherwise reduce the effect of these issues. Additional issues are addressed in [Frequently Asked Questions](frequently-asked-questions.yml). diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/CS/source.cs index 1d836cf26fb58..246d38293f332 100644 --- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/CS/source.cs +++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/CS/source.cs @@ -1,4 +1,6 @@ // +// Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. +// This code access security example requires the built-in .NET Framework SQL provider. using System; using System.Data; using System.Data.SqlClient; diff --git a/samples/snippets/csharp/VS_Snippets_Data/DLinqAdoNet/cs/Program.cs b/samples/snippets/csharp/VS_Snippets_Data/DLinqAdoNet/cs/Program.cs index bd0abf5179c10..d76571ebb9305 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/DLinqAdoNet/cs/Program.cs +++ b/samples/snippets/csharp/VS_Snippets_Data/DLinqAdoNet/cs/Program.cs @@ -13,10 +13,14 @@ static void Main(string[] args) Northwnd db = new Northwnd(@""); // + // Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + // LINQ to SQL's built-in provider requires System.Data.SqlClient. db.Connection.Close(); // // + // Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + // LINQ to SQL's built-in provider requires System.Data.SqlClient. using (TransactionScope ts = new TransactionScope()) { db.SubmitChanges(); @@ -25,6 +29,8 @@ static void Main(string[] args) // // + // Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + // LINQ to SQL's built-in provider requires System.Data.SqlClient. IEnumerable results = db.ExecuteQuery( @"select c1.custid as CustomerID, c2.custName as ContactName from customer1 as c1, customer2 as c2 @@ -38,8 +44,10 @@ void another() Northwnd db = new Northwnd(@""); // + // Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + // LINQ to SQL's built-in provider requires System.Data.SqlClient. IEnumerable results = db.ExecuteQuery( - "select contactname from customers where city = {0}", + "select CustomerID, ContactName from customers where city = {0}", "London" ); // diff --git a/samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/Program.cs b/samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/Program.cs index e20465fdd1643..dda6b55fee49e 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/Program.cs +++ b/samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/Program.cs @@ -17,6 +17,8 @@ static void Main(string[] args) // Northwnd db = new Northwnd(@"c:\northwnd.mdf"); // +// Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. +// LINQ to SQL's built-in provider requires System.Data.SqlClient. // DataContext takes a connection string. DataContext db = new DataContext(@"c:\Northwind.mdf"); @@ -38,6 +40,8 @@ from cust in Customers // // + // Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + // LINQ to SQL's built-in provider requires System.Data.SqlClient. string connString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=c:\northwind.mdf; Integrated Security=True; Connect Timeout=30; User Instance=True"; SqlConnection nwindConn = new SqlConnection(connString); @@ -81,6 +85,8 @@ from cust in Customers } //end of Main // + // Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + // LINQ to SQL's built-in provider requires System.Data.SqlClient. public partial class Northwind : DataContext { public Table Customers; @@ -92,6 +98,8 @@ public Northwind(string connection) : base(connection) { } void method() { // + // Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + // LINQ to SQL's built-in provider requires System.Data.SqlClient. Northwnd db = new Northwnd(@"c:\Northwnd.mdf"); var query = from cust in db.Customers diff --git a/samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/Program.cs b/samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/Program.cs index 0b63a664b411c..1e28836f9d72d 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/Program.cs +++ b/samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/Program.cs @@ -58,6 +58,8 @@ from cust in db.Customers void method3() { // + // Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + // LINQ to SQL's built-in provider requires System.Data.SqlClient. // using System.Data.Common; Northwnd db = new Northwnd(@"c:\northwnd.mdf"); diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/Program.cs b/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/Program.cs index fee5ec50578a1..ee42f644b2ecf 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/Program.cs +++ b/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/Program.cs @@ -840,6 +840,8 @@ static void SBUDT543840() { // + // Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + // This Entity Framework model uses the built-in .NET Framework SQL provider. using (AdventureWorksEntities context = new AdventureWorksEntities()) { // Ordering information is lost when executed against a SQL Server 2005 @@ -965,6 +967,8 @@ public static void UIntAsQueryParam_MQ() public static void UIntAsQueryParam() { // + // Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + // This Entity Framework model uses the built-in .NET Framework SQL provider. using (AdventureWorksEntities context = new AdventureWorksEntities()) { uint s = UInt32.Parse("48000"); @@ -973,7 +977,7 @@ public static void UIntAsQueryParam() where sale.SalesOrderID == s select sale; - // NotSupportedException exception is thrown here. + // The comparison converts the operands to Int64. try { foreach (SalesOrderDetail order in query) @@ -1036,6 +1040,8 @@ public static void SBUDT543574() public static void SBUDT555877() { // + // Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + // This Entity Framework model uses the built-in .NET Framework SQL provider. using (AdventureWorksEntities context = new AdventureWorksEntities()) { Contact contact = context.Contacts.FirstOrDefault(); @@ -1361,6 +1367,8 @@ static void CompiledQuery7() static void ProjectToAnonType() { // + // Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + // This Entity Framework model uses the built-in .NET Framework SQL provider. using (AdventureWorksEntities context = new AdventureWorksEntities()) { var resultWithoutRelatedObjects = @@ -1372,6 +1380,8 @@ static void ProjectToAnonType() } // // + // Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + // This Entity Framework model uses the built-in .NET Framework SQL provider. using (AdventureWorksEntities context = new AdventureWorksEntities()) { var resultWithRelatedObjects = diff --git a/samples/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/VB/source.vb b/samples/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/VB/source.vb index f8170b61ec1b0..6350cdfae2133 100644 --- a/samples/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/VB/source.vb +++ b/samples/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/VB/source.vb @@ -1,4 +1,6 @@ ' +' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. +' This code access security example requires the built-in .NET Framework SQL provider. Imports System.Data.SqlClient Imports System.Security Imports System.Security.Permissions diff --git a/samples/snippets/visualbasic/VS_Snippets_Data/DLinqAdoNet/vb/Module1.vb b/samples/snippets/visualbasic/VS_Snippets_Data/DLinqAdoNet/vb/Module1.vb index aa72b1140071f..07e4c384b2217 100644 --- a/samples/snippets/visualbasic/VS_Snippets_Data/DLinqAdoNet/vb/Module1.vb +++ b/samples/snippets/visualbasic/VS_Snippets_Data/DLinqAdoNet/vb/Module1.vb @@ -8,10 +8,14 @@ Module Module1 Dim db As New Northwnd("") ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' LINQ to SQL's built-in provider requires System.Data.SqlClient. db.Connection.Close() ' ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' LINQ to SQL's built-in provider requires System.Data.SqlClient. Using ts As New TransactionScope() db.SubmitChanges() ts.Complete() @@ -19,11 +23,13 @@ Module Module1 ' ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' LINQ to SQL's built-in provider requires System.Data.SqlClient. Dim results As IEnumerable(Of Customer) = _ db.ExecuteQuery(Of Customer)( _ "SELECT [c1].custID as CustomerID," & _ - "[c2].custName as ContactName" & _ - "FROM customer1 AS [c1], customer2 as [c2]" & _ + "[c2].custName as ContactName " & _ + "FROM customer1 AS [c1], customer2 as [c2] " & _ "WHERE [c1].custid = [c2].custid") ' @@ -35,9 +41,12 @@ Module Module1 Dim db As New Northwnd("") ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' LINQ to SQL's built-in provider requires System.Data.SqlClient. Dim results As IEnumerable(Of Customer) = _ db.ExecuteQuery(Of Customer)( _ - "SELECT contactname FROM customers WHERE city = {0}, 'London'") + "SELECT CustomerID, ContactName FROM customers WHERE city = {0}", _ + "London") End Sub ' diff --git a/samples/snippets/visualbasic/VS_Snippets_Data/DLinqCommunicatingWithDatabase/vb/Module1.vb b/samples/snippets/visualbasic/VS_Snippets_Data/DLinqCommunicatingWithDatabase/vb/Module1.vb index b2fbb13178dfd..3a32d8c1f3f6f 100644 --- a/samples/snippets/visualbasic/VS_Snippets_Data/DLinqCommunicatingWithDatabase/vb/Module1.vb +++ b/samples/snippets/visualbasic/VS_Snippets_Data/DLinqCommunicatingWithDatabase/vb/Module1.vb @@ -12,6 +12,8 @@ Module Module1 ' Dim db As New Northwnd("c:\northwnd.mdf") ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' LINQ to SQL's built-in provider requires System.Data.SqlClient. ' DataContext takes a connection string. Dim db As New DataContext("…\Northwind.mdf") @@ -37,6 +39,8 @@ Module Module1 End Sub ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' LINQ to SQL's built-in provider requires System.Data.SqlClient. Partial Public Class Northwind Inherits DataContext Public Customers As Table(Of Customer) @@ -57,11 +61,13 @@ Module Module1 Sub thirdsnippet() ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' LINQ to SQL's built-in provider requires System.Data.SqlClient. Dim conString = "Data Source=.\SQLEXPRESS;AttachDbFilename=c:\northwind.mdf; Integrated Security=True;Connect Timeout=30;User Instance=True" Dim northwindCon = New SqlConnection(conString) northwindCon.Open() - Dim db = New Northwnd("...") + Dim db = New Northwnd(northwindCon) Dim northwindTransaction = northwindCon.BeginTransaction() Try @@ -98,6 +104,8 @@ Module Module1 Sub other() ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' LINQ to SQL's built-in provider requires System.Data.SqlClient. Dim db As New Northwind("...\Northwnd.mdf") Dim query = _ diff --git a/samples/snippets/visualbasic/VS_Snippets_Data/DLinqDebuggingSupport/vb/Module1.vb b/samples/snippets/visualbasic/VS_Snippets_Data/DLinqDebuggingSupport/vb/Module1.vb index a656caa2bfacd..d65925c5bf08d 100644 --- a/samples/snippets/visualbasic/VS_Snippets_Data/DLinqDebuggingSupport/vb/Module1.vb +++ b/samples/snippets/visualbasic/VS_Snippets_Data/DLinqDebuggingSupport/vb/Module1.vb @@ -52,6 +52,8 @@ Module Module1 Sub method3() ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' LINQ to SQL's built-in provider requires System.Data.SqlClient. ' Imports System.Data.Common Dim db As New Northwnd("c:\northwnd.mdf") diff --git a/samples/snippets/visualbasic/VS_Snippets_Data/DP L2E Conceptual Examples/VB/Module1.vb b/samples/snippets/visualbasic/VS_Snippets_Data/DP L2E Conceptual Examples/VB/Module1.vb index 4f5783dabc321..8620a95f7a4c2 100644 --- a/samples/snippets/visualbasic/VS_Snippets_Data/DP L2E Conceptual Examples/VB/Module1.vb +++ b/samples/snippets/visualbasic/VS_Snippets_Data/DP L2E Conceptual Examples/VB/Module1.vb @@ -729,6 +729,8 @@ Module Module1 Sub SBUDT544355() ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' This Entity Framework model uses the built-in .NET Framework SQL provider. Using context As New AdventureWorksEntities() Dim productsList = _ From product In context.Products _ @@ -845,6 +847,8 @@ Module Module1 Sub UIntAsQueryParam() ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' This Entity Framework model uses the built-in .NET Framework SQL provider. Using context As New AdventureWorksEntities() Dim saleId As UInteger = UInt32.Parse("48000") @@ -886,6 +890,8 @@ Module Module1 Sub SBUDT543840() ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' This Entity Framework model uses the built-in .NET Framework SQL provider. Using context As New AdventureWorksEntities() ' Ordering information is lost when executed against a SQL Server 2005 ' database running with a compatibility level of "80". @@ -931,6 +937,8 @@ Module Module1 Sub SBUDT555877() ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' This Entity Framework model uses the built-in .NET Framework SQL provider. Using context As New AdventureWorksEntities() Dim contact As Contact = context.Contacts.FirstOrDefault() @@ -1225,6 +1233,8 @@ Module Module1 Sub ProjectToAnonType() ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' This Entity Framework model uses the built-in .NET Framework SQL provider. Using context As New AdventureWorksEntities() Dim resultWithoutRelatedObjects = context.Contacts. _ Include("SalesOrderHeaders"). _ @@ -1235,6 +1245,8 @@ Module Module1 End Using ' ' + ' Do not use System.Data.SqlClient for new development; use Microsoft.Data.SqlClient. + ' This Entity Framework model uses the built-in .NET Framework SQL provider. Using context As New AdventureWorksEntities() Dim resultWithRelatedObjects = context.Contacts. _ Include("SalesOrderHeaders"). _ diff --git a/samples/snippets/visualbasic/VS_Snippets_Data/DP L2E Conceptual Examples/VB/l2e_conceptualexamplesvb.vbproj b/samples/snippets/visualbasic/VS_Snippets_Data/DP L2E Conceptual Examples/VB/l2e_conceptualexamplesvb.vbproj index 31832f9ae6af2..33f286ff065e0 100644 --- a/samples/snippets/visualbasic/VS_Snippets_Data/DP L2E Conceptual Examples/VB/l2e_conceptualexamplesvb.vbproj +++ b/samples/snippets/visualbasic/VS_Snippets_Data/DP L2E Conceptual Examples/VB/l2e_conceptualexamplesvb.vbproj @@ -1,5 +1,6 @@  + Debug x86 @@ -38,6 +39,7 @@ 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + @@ -99,7 +101,15 @@ Settings.Designer.vb + + + + + + %(ReferencePath.Identity) + + -Union types rely on the `UnionAttribute` and `IUnion` types in the `System.Runtime.CompilerServices` namespace. The runtime includes these types beginning with .NET 11 Preview 5: - -```csharp -namespace System.Runtime.CompilerServices; - -[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false)] -public sealed class UnionAttribute : Attribute; - -public interface IUnion -{ - object? Value { get; } -} -``` - -Union declarations generated by the compiler implement `IUnion` . You can check for any union value at runtime by using `IUnion`: - -```csharp -if (value is IUnion { Value: null }) { /* the union's value is null */ } -``` - -When you declare a `union` type, the compiler generates a struct that implements `IUnion`. For example, the `Pet` declaration (`public union Pet(Cat, Dog, Bird);`) becomes equivalent to: - -```csharp -[Union] public struct Pet : IUnion -{ - public Pet(Cat value) => Value = value; - public Pet(Dog value) => Value = value; - public Pet(Bird value) => Value = value; - public object? Value { get; } -} -``` - ## C# language specification For more information, see the [Unions](~/_csharplang/proposals/csharp-15.0/unions.md) feature specification. diff --git a/docs/csharp/language-reference/compiler-messages/expression-tree-restrictions.md b/docs/csharp/language-reference/compiler-messages/expression-tree-restrictions.md index ebd9f7e6880de..8b7726b58b416 100644 --- a/docs/csharp/language-reference/compiler-messages/expression-tree-restrictions.md +++ b/docs/csharp/language-reference/compiler-messages/expression-tree-restrictions.md @@ -109,7 +109,7 @@ ai-usage: ai-assisted This article covers the following compiler errors: - **CS0765** - *Partial methods with only a defining declaration or removed conditional methods cannot be used in expression trees.* - **CS0831** - *An expression tree may not contain a base access.* @@ -157,51 +157,51 @@ That's by design. The text closely matches the text of the compiler error / warn - **CS9170** - *An expression tree may not contain an inline array access or conversion.* - **CS9175** - *An expression tree may not contain a collection expression.* - **CS9226** - *An expression tree may not contain an expanded form of non-array params collection parameter.* -- **CS9296** - *An expression tree may not contain an extension property access*. +- **CS9296** - *An expression tree may not contain an extension property or indexer access*. - **CS9307** - *An expression tree may not contain a named argument specification out of position*. - **CS9369** - *An expression tree may not contain a union conversion.* ## Expression tree restrictions -All of the errors in the preceding list indicate you've used a C# expression type that isn't allowed in an expression tree. In most cases, the prohibited expressions represent syntax introduced after C# 3.0. These expressions are prohibited because allowing them would create a breaking change in all libraries that parse expression trees. All libraries would need to be enhanced to parse new C# expressions if newer constructs were allowed. +All of the errors in the preceding list indicate you used a C# expression type that isn't allowed in an expression tree. In most cases, the prohibited expressions represent syntax introduced after C# 3.0. These expressions are prohibited because allowing them would create a breaking change in all libraries that parse expression trees. All libraries would need to be enhanced to parse new C# expressions if newer constructs were allowed. The following expressions are prohibited: - Invocations of [partial methods](../keywords/partial-member.md) that don't have an implementing declaration. - Invocations of [conditional methods](../preprocessor-directives.md#conditional-compilation) that have been removed. - Invocations of [local functions](../../fundamentals/building-software/local-functions.md). -- `async` lambda expressions aren't allowed. -- Using [`base`](../keywords/base.md) access to directly call a virtual method declared in a base class. +- `async` lambda expressions. +- Using [`base`](../keywords/base.md) to directly call a virtual method declared in a base class. - [assignment](../operators/assignment-operator.md) operations. -- [statement lambdas](../operators/lambda-expressions.md#statement-lambdas) aren't allowed. -- [multi-dimensional array](../builtin-types/arrays.md#multidimensional-arrays) initializers. Instead, you must create and initialize a multi-dimensional array outside of the expression tree. -- [`dynamic`](../builtin-types/reference-types.md#the-dynamic-type) operations aren't allowed. -- [pattern matching](../operators/patterns.md) expressions aren't allowed. -- [Tuple literals](../builtin-types/value-tuples.md) and many tuple operations, such as equality comparisons aren't allowed. -- [`throw` expressions](../statements/exception-handling-statements.md#the-throw-expression) aren't allowed. +- [statement lambdas](../operators/lambda-expressions.md#statement-lambdas). +- [multi-dimensional array](../builtin-types/arrays.md#multidimensional-arrays) initializers. Instead, create and initialize a multi-dimensional array outside of the expression tree. +- [`dynamic`](../builtin-types/reference-types.md#the-dynamic-type) operations. +- [pattern matching](../operators/patterns.md) expressions. +- [Tuple literals](../builtin-types/value-tuples.md) and many tuple operations, such as equality comparisons. +- [`throw` expressions](../statements/exception-handling-statements.md#the-throw-expression). - [discard](../../fundamentals/patterns/discards.md) (`_`) declarations. -- The [index and range](../operators/member-access-operators.md#indexer-access) operators aren't allowed. -- Non-destructive mutation using [`with`](../operators/with-expression.md) expressions aren't allowed. -- You can't declare or access [inline arrays](../builtin-types/struct.md#inline-arrays). -- You can't include [collection expressions](../operators/collection-expressions.md). -- [Union conversions](../builtin-types/union.md#union-conversions) aren't allowed. -- The [null propagating](../operators/member-access-operators.md#null-conditional-operators--and-) and [null coalescing](../operators/assignment-operator.md#null-coalescing-assignment) operators aren't allowed. -- [`ref struct`](../builtin-types/ref-struct.md) types, such as and aren't allowed. -- `in`, `out`, and `ref` parameters, including `out` variable declarations, aren't allowed. -- `ref` returns aren't allowed. -- Calls to methods that return by `ref` aren't allowed. -- [static abstract interface members](../keywords/interface.md#static-abstract-and-virtual-members) can't be accessed. +- The [index and range](../operators/member-access-operators.md#indexer-access) operators. +- Non-destructive mutation using [`with`](../operators/with-expression.md) expressions. +- Declaring or accessing [inline arrays](../builtin-types/struct.md#inline-arrays). +- Including [collection expressions](../operators/collection-expressions.md). +- [Union conversions](../builtin-types/union.md#union-conversions). +- The [null propagating](../operators/member-access-operators.md#null-conditional-operators--and-) and [null coalescing](../operators/assignment-operator.md#null-coalescing-assignment) operators. +- [`ref struct`](../builtin-types/ref-struct.md) types, such as and . +- `in`, `out`, and `ref` parameters, including `out` variable declarations. +- `ref` returns. +- Calls to methods that return by `ref`. +- Accessing [static abstract interface members](../keywords/interface.md#static-abstract-and-virtual-members). - [Inline arrays](../builtin-types/struct.md#inline-arrays). -- The `params` modifier is allowed only on single-dimensional arrays. Other collection types aren't allowed. +- The `params` modifier on anything other than single-dimensional arrays. Other restrictions are: -- Extension properties can't be accessed as extensions. -- Attributes can't be applied to the lambda expression, its parameters or return. +- Can't access extension properties and indexers as extensions. +- Can't apply attributes to the lambda expression, its parameters, or return. - The lambda expression must be convertible to a type derived from whose type parameter is a delegate type. -- [named and optional parameters](../../programming-guide/classes-and-structs/named-and-optional-arguments.md) are restricted. The expression can't call a method specifying named arguments, and it can't use the default value of an optional parameter. -- [Dictionary initializers](../../programming-guide/classes-and-structs/object-and-collection-initializers.md#collection-initializers) aren't allowed. Neither are extension `Add` methods. +- Restricted [named and optional parameters](../../programming-guide/classes-and-structs/named-and-optional-arguments.md). The expression can't call a method specifying named arguments, and it can't use the default value of an optional parameter. +- Can't use [Dictionary initializers](../../programming-guide/classes-and-structs/object-and-collection-initializers.md#collection-initializers) or extension `Add` methods. - The target expression must be a lambda expression. Constants and variables aren't allowed, but a lambda expression that returns a constant or variable is. - Unsafe pointer operations aren't allowed. - COM calls must include `ref` on arguments; it can't be implied. -- The unsupported `__arglist` keyword isn't allowed. +- The unsupported `__arglist` keyword. diff --git a/docs/csharp/language-reference/compiler-messages/feature-version-errors.md b/docs/csharp/language-reference/compiler-messages/feature-version-errors.md index 7f1acf12f5d62..577a924587937 100644 --- a/docs/csharp/language-reference/compiler-messages/feature-version-errors.md +++ b/docs/csharp/language-reference/compiler-messages/feature-version-errors.md @@ -153,7 +153,7 @@ helpviewer_keywords: - "CS9328" - "CS9346" - "CS9352" -ms.date: 10/05/2026 +ms.date: 10/19/2026 ai-usage: ai-assisted --- # Resolve errors and warnings for language features and versions @@ -331,7 +331,7 @@ If you can't upgrade, avoid the feature that triggered the error. The error mess - **CS9346**: *Update requires emitting explicit interface implementation, which is not supported by the runtime without restarting the application.* - **CS9352**: *The target runtime does not support extended layout types.* -These errors differ from language version errors because upgrading the `` alone doesn't resolve them. The target runtime (specified by ``) must also support the feature at the CLR/runtime level. +These errors generally require support from the target runtime (specified by ``), not just a newer ``. One exception is non-virtual static interface members: starting with C# 15, declaring and using them no longer requires default-interface-implementation runtime support. If CS8701 occurs for such a member, an SDK that supports C# 15 and `15.0` can resolve it without changing the target framework. Instance default implementations, static abstract or virtual members, and protected interface-member accessibility retain their runtime requirements. For more information, see [Static interface members and runtime support](../keywords/interface.md#static-interface-members-and-runtime-support). Upgrade the `` in your project file to a version that supports the required feature. The following list shows which features require which minimum runtime: diff --git a/docs/csharp/language-reference/compiler-messages/unsafe-code-errors.md b/docs/csharp/language-reference/compiler-messages/unsafe-code-errors.md index a87b4cf47538c..c8db5a8e9dd24 100644 --- a/docs/csharp/language-reference/compiler-messages/unsafe-code-errors.md +++ b/docs/csharp/language-reference/compiler-messages/unsafe-code-errors.md @@ -109,7 +109,7 @@ helpviewer_keywords: - "CS9396" - "CS9397" - "CS9398" -ms.date: 09/11/2026 +ms.date: 10/19/2026 ai-usage: ai-assisted --- # Resolve errors and warnings in unsafe code constructs @@ -165,7 +165,7 @@ That's by design. The text closely matches the text of the compiler error / warn - [**CS9376**](#unsafe-context-requirements): *An unsafe context is required for constructor 'constructor' marked as '`unsafe`' to satisfy the '`new()`' constraint of type parameter 'type parameter' in 'generic type or method'* - [**CS9377**](#unsafe-member-safety-contracts): *The '`unsafe`' modifier does not have any effect here under the current memory safety rules.* - [**CS9379**](#unsafe-member-safety-contracts): *Do not use '`RequiresUnsafeAttribute`' in source; use the '`unsafe`' modifier instead.* -- [**CS9388**](#unsafe-member-safety-contracts): *The '`safe`' modifier may only be used on '`extern`' members that are not marked '`unsafe`'.* +- [**CS9388**](#unsafe-member-safety-contracts): *The '`safe`' and '`unsafe`' modifiers cannot be used together.* - [**CS9389**](#unsafe-member-safety-contracts): *'`extern`' member must be marked '`unsafe`' or '`safe`'.* - [**CS9390**](#unsafe-member-safety-contracts): *Both partial member declarations must be marked '`safe`' or neither may be marked '`safe`'* - [**CS9392**](#explicit-or-extended-layout-fields): *Field in an explicit or extended layout type must be marked '`unsafe`' or '`safe`'.* @@ -251,7 +251,7 @@ These diagnostics occur when you use unsafe code constructs without the required - Mark operations that involve unsafe constructs (such as pointer dereferencing, address-of, or `sizeof` on unmanaged types) with the `unsafe` keyword (**CS9360**). Under C# 15's updated memory safety rules, the compiler identifies individual operations that require an unsafe context. - Use the `unsafe` keyword for `stackalloc` expressions without initializers when the `SkipLocalsInit` attribute is applied (**CS9361**). Without an initializer, the stack-allocated memory contains uninitialized data, which is an unsafe operation. - Use an `unsafe` context when calling members marked `unsafe` (**CS9362**), or members with pointers in their signatures (**CS9363**). Under the updated memory safety model, the compiler reports CS9362 for members that explicitly propagate the safety obligation to the caller and CS9363 for legacy compatibility cases where the signature itself contains pointers. -- Use an `unsafe` context when a `new()` constraint requires calling a constructor marked `unsafe` (**CS9376**). The generic instantiation calls the constructor implicitly, so the calling context must be unsafe. +- Use an `unsafe` context for an expression where a type argument with a requires-unsafe parameterless constructor must satisfy a `new()` or `struct` constraint (**CS9376**). For a declaration such as a base type or field type, an unsafe constructor can't satisfy the constraint; use a type with a safe parameterless constructor instead. - Move `await` outside the body or initializer of a [`fixed` statement](../statements/fixed.md) (**CS9398**). The C# 15 preview allows `await` in an unsafe context, but the pinning lifetime of a `fixed` statement still can't span an async suspension point. Await the operation before entering `fixed`, or exit the `fixed` statement before awaiting. ## Unsafe member safety contracts @@ -263,7 +263,7 @@ These diagnostics occur when you use unsafe code constructs without the required - **CS9368**: *`RequiresUnsafeAttribute` is only valid under the updated memory safety rules.* - **CS9377**: *The '`unsafe`' modifier does not have any effect here under the current memory safety rules.* - **CS9379**: *Do not use '`RequiresUnsafeAttribute`' in source; use the '`unsafe`' modifier instead.* -- **CS9388**: *The '`safe`' modifier may only be used on '`extern`' members that are not marked '`unsafe`'.* +- **CS9388**: *The '`safe`' and '`unsafe`' modifiers cannot be used together.* - **CS9389**: *'`extern`' member must be marked '`unsafe`' or '`safe`'.* - **CS9390**: *Both partial member declarations must be marked '`safe`' or neither may be marked '`safe`'* - **CS9396**: *Cannot specify '`unsafe`' or '`safe`' modifiers on both property or indexer 'property' and its accessor. Remove one of them.* @@ -278,7 +278,7 @@ These diagnostics enforce the C# 15 safety contract rules for members marked as - Enable the updated memory safety rules to use `RequiresUnsafeAttribute` (**CS9368**). This attribute is part of C# 15's refined memory safety model and isn't recognized under legacy rules. Ensure your project targets a language version that supports the updated rules. - Remove the `unsafe` modifier when it has no effect (**CS9377**). Under the current memory safety rules, certain contexts don't require or benefit from the `unsafe` modifier. The compiler warns when the modifier is meaningless so you can clean up unnecessary annotations. - Use the `unsafe` modifier directly on the member declaration instead of applying `RequiresUnsafeAttribute` in source (**CS9379**). The attribute is intended for metadata representation only; in source code, the `unsafe` keyword is the correct mechanism. -- Apply the `safe` modifier only to `extern` members that aren't already marked `unsafe` (**CS9388**). The `safe` modifier explicitly opts an extern member out of the default unsafe assumption for extern declarations. +- Choose either `safe` or `unsafe` for a declaration, not both (**CS9388**). The `safe` modifier marks the declaration as not requires-unsafe; it isn't limited to `extern` members. - Mark every `extern` member as either `unsafe` or `safe` (**CS9389**). Under the updated memory safety rules, extern members must explicitly declare their safety contract because the compiler can't verify the implementation. - Ensure both partial member declarations agree on the `safe` modifier (**CS9390**). If one partial declaration is marked `safe`, the other must also be marked `safe` to maintain a consistent safety contract. - Put `unsafe` or `safe` on either the property or indexer, or on an accessor, but not both (**CS9396**). If the property sets the contract for all accessors, place the modifier on the property itself. If only one accessor differs, put the modifier on that accessor and leave the property unmodified. diff --git a/docs/csharp/language-reference/keywords/closed.md b/docs/csharp/language-reference/keywords/closed.md index 498917b94e919..4be69262d0162 100644 --- a/docs/csharp/language-reference/keywords/closed.md +++ b/docs/csharp/language-reference/keywords/closed.md @@ -1,7 +1,7 @@ --- title: "closed modifier" description: "Learn about the closed class modifier in C#. A closed class restricts derivation to its declaring assembly so consumers can write exhaustive switch expressions over its direct descendants." -ms.date: 08/14/2026 +ms.date: 10/19/2026 f1_keywords: - "closed" - "closed_CSharpKeyword" @@ -49,7 +49,7 @@ The `closed` modifier is a class modifier: - You must declare a direct subtype of a closed class in the same assembly and module as the closed base class. - A class that derives from a closed class isn't itself closed. Apply the `closed` modifier again if you want a derived class to also be closed. -If a generic class directly derives from a `closed` class, every type parameter on the derived class must be used in the base class specification. This rule isn't about the `closed` modifier itself: a *closed constructed type* is a generic type whose type arguments are fully specified (such as `Tree`), as opposed to an *open type* like `Tree`. The rule ensures that each closed constructed type of the base class has exactly one corresponding closed constructed type among its direct descendants, so the compiler can reason about exhaustiveness. +If a generic class directly derives from a `closed` class, every type parameter on the derived class must be used in the base class specification. A *closed constructed type* is a generic type whose type arguments are fully specified (such as `Tree`), as opposed to an *open type* like `Tree`. An open type can also have some type arguments specified, such as `Dictionary`, where `TValue` is still a type parameter. For the definitions, see [Open and closed types](~/_csharpstandard/standard/types.md#843-open-and-closed-types) in the language specification. The restriction lets the compiler determine the possible constructed descendants for a given base construction. A particular base construction can have no corresponding construction of a particular descendant; the rule doesn't guarantee one. ```csharp public closed record class Tree; @@ -69,13 +69,13 @@ When the switch governing expression is nullable, `null` becomes another possibl :::code language="csharp" source="./snippets/shared/Closed.cs" id="NullableSwitch"::: -If you omit the `null` arm, the compiler warns that the pattern `null` isn't handled. The same rule applies whether the closed type is a class or a struct lifted to a nullable type. +If you omit the `null` arm, the compiler warns that the pattern `null` isn't handled. The `closed` modifier applies only to classes, including record classes. For more information about how the compiler determines exhaustiveness, including how closed hierarchies interact with generic constraints and accessibility, see [Closed hierarchy patterns](../operators/patterns.md#closed-hierarchy-patterns). ## Type parameters constrained to a closed type -The [closed hierarchies feature specification](~/_csharplang/proposals/csharp-15.0/closed-hierarchies.md#exhaustiveness-of-type-parameters-constrained-to-closed-type) treats a type parameter constrained to a closed class the same as that closed class for exhaustiveness checks: a `switch` expression whose governing value has such a type parameter is exhaustive when it handles every direct descendant of the closed constraint, regardless of whether the type parameter appears on a method or on the containing type: +The [closed hierarchies feature specification](~/_csharplang/proposals/csharp-15.0/closed-hierarchies.md#exhaustiveness-of-type-parameters-constrained-to-closed-type) treats a type parameter constrained to a closed class the same as that closed class for exhaustiveness checks. A `switch` expression whose governing value has such a type parameter is exhaustive when it handles every direct descendant of the closed constraint, regardless of whether the type parameter appears on a method or on the containing type: :::code language="csharp" source="./snippets/shared/Closed.cs" id="TypeParameterConstrained"::: diff --git a/docs/csharp/language-reference/keywords/extension.md b/docs/csharp/language-reference/keywords/extension.md index 767086916daae..245663f05c09a 100644 --- a/docs/csharp/language-reference/keywords/extension.md +++ b/docs/csharp/language-reference/keywords/extension.md @@ -1,7 +1,8 @@ --- title: "Extension member declarations" description: "Learn the syntax to declare extension members in C#. Extension members enable you to add functionality to types and interfaces in those instances where you don't have the source for the original type. Extensions are often paired with generic interfaces to implement a common set of functionality across all types that implement that interface." -ms.date: 07/08/2026 +ms.date: 10/19/2026 +ai-usage: ai-assisted f1_keywords: - "extension_CSharpKeyword" - "extension" @@ -17,21 +18,21 @@ The `extension` block specifies the type and receiver for extension members. You > [!NOTE] > All the examples in this article include XML comments for the members and the extension block. The node on the `extension` block describes the extended type and the receiver parameter. The C# compiler copies this node to the generated member for all members in the extension block. These examples demonstrate the preferred style for generating XML documentation for extension members. -:::code language="csharp" source="./snippets/extensions.cs" id="ExtensionMembers"::: +:::code language="csharp" source="./snippets/Extensions.cs" id="ExtensionMembers"::: The `extension` defines the receiver: `sequence`, which is an `IEnumerable`. The receiver type can be nongeneric, an open generic, or a closed generic type. The name `sequence` is in scope in every instance member declared in that extension. The extension method and property both access `sequence`. You access any of the extension members as though they were members of the receiver type: -:::code language="csharp" source="./snippets/extensions.cs" id="UseExtensionMethod"::: +:::code language="csharp" source="./snippets/Extensions.cs" id="UseExtensionMethod"::: You can declare any number of members in a single block, as long as they share the same receiver. You can declare as many extension blocks in a single class as well. Different extensions don't need to declare the same type or name of receiver. The extension parameter doesn't need to include the parameter name if the only members are static: -:::code language="csharp" source="./snippets/extensions.cs" id="StaticExtensions"::: +:::code language="csharp" source="./snippets/Extensions.cs" id="StaticExtensions"::: You call static extensions as though they're static members of the receiver type: -:::code language="csharp" source="./snippets/extensions.cs" id="UseStaticExtensions"::: +:::code language="csharp" source="./snippets/Extensions.cs" id="UseStaticExtensions"::: You call operators as though they're user defined operators on the type. @@ -58,7 +59,7 @@ Where you specify the type parameters for an extension member declared in an ext The following example shows an extension block for `IEnumerable` where two of the extension members require a second type parameter: -:::code language="csharp" source="./snippets/extensions.cs" id="GenericExtension"::: +:::code language="csharp" source="./snippets/Extensions.cs" id="GenericExtension"::: The members `Append` and `Prepend` specify the *extra* type parameter for the conversion. None of the members repeat the type parameter for the receiver. @@ -72,11 +73,40 @@ Starting with C# 15, you can declare *indexers* in an `extension` block. An exte The following example declares a get-only indexer on `IEnumerable` that returns the element at a specified position: -:::code language="csharp" source="./snippets/extensions.cs" id="ExtensionIndexer"::: +:::code language="csharp" source="./snippets/Extensions.cs" id="ExtensionIndexer"::: You index into the receiver as though the indexer were a member of the receiver type: -:::code language="csharp" source="./snippets/extensions.cs" id="UseExtensionIndexer"::: +:::code language="csharp" source="./snippets/Extensions.cs" id="UseExtensionIndexer"::: + +### Index and range access + +Extension members can also supply the members needed for implicit [`Index` and `Range` access](../operators/member-access-operators.md#index-from-end-operator-). A `Length` or `Count` property and an integer indexer support indexing from the end. A `Slice(int, int)` method supports range access. These members can be instance members, extension members, or a combination of both. + +For example, `Readings` wraps an array without declaring indexing members. Its extensions supply `Count`, an integer indexer, and `Slice`: + +:::code language="csharp" source="./snippets/Extensions.cs" id="IndexableReadings"::: + +These members enable ordinary indexing, indexing from the end, ranges, and [list patterns](../operators/patterns.md#list-patterns): + +:::code language="csharp" source="./snippets/Extensions.cs" id="UseIndexableReadings"::: + +### Lookup and restrictions + +For indexer lookup, the compiler tries applicable members in this order: + +1. An indexer declared on the receiver type. +2. Implicit index or range access using instance members. +3. An extension indexer. +4. Implicit index or range access using extension members. + +An earlier applicable form takes precedence over a later one. For example, an instance integer indexer with an instance `Length` property can handle `receiver[^1]` before an extension indexer that directly accepts `Index`. + +Extension indexers and related members have the following restrictions: + +- Extension indexers aren't used for string or array element access, even if you declare extensions for those types. +- An expression tree can't contain an extension property or indexer access. +- Extension `Length` and `Count` properties don't participate in collection-expression spread optimizations. ## See also diff --git a/docs/csharp/language-reference/keywords/interface.md b/docs/csharp/language-reference/keywords/interface.md index 08ee4e083c088..32d3aad82a638 100644 --- a/docs/csharp/language-reference/keywords/interface.md +++ b/docs/csharp/language-reference/keywords/interface.md @@ -1,7 +1,8 @@ --- description: "Use the `interface` keyword to define contracts that any implementing type must support. Interfaces provide the means to create common behavior among a set of unrelated types." title: "interface keyword" -ms.date: 01/21/2026 +ms.date: 10/19/2026 +ai-usage: ai-assisted f1_keywords: - "interface_CSharpKeyword" helpviewer_keywords: @@ -49,7 +50,20 @@ An interface declaration can contain the following members: Member declarations typically don't contain a body. However, an interface member can declare a body. Member bodies in an interface are the *default implementation*. By using members with bodies, the interface can provide a default implementation for classes and structs that don't provide an overriding implementation. > [!IMPORTANT] -> If you add default interfaces members, any `ref struct` that implements the interface must explicitly declare that member. +> If you add default interface members, any `ref struct` that implements the interface must explicitly declare that member. + +## Static interface members and runtime support + +Starting with C# 15, you can declare and use non-virtual static interface members even when the target runtime doesn't support default interface implementations. For example, a static helper method provides a single implementation that you call on the interface type: + +```csharp +public interface IMeasurement +{ + public static double ToMeters(double centimeters) => centimeters / 100; +} +``` + +The call `IMeasurement.ToMeters(250)` doesn't require an implementing type or runtime dispatch through that type. This compatibility change applies to non-virtual static members, not instance default implementations or `static abstract` and `static virtual` members. Those features retain their runtime requirements. The `protected`, `protected internal`, and `private protected` access modifiers on interface members also still require a runtime that supports default interface implementations. ## Static abstract and virtual members diff --git a/docs/csharp/language-reference/keywords/safe.md b/docs/csharp/language-reference/keywords/safe.md index 296445e275778..97cd9bb20085f 100644 --- a/docs/csharp/language-reference/keywords/safe.md +++ b/docs/csharp/language-reference/keywords/safe.md @@ -1,7 +1,7 @@ --- description: "safe modifier - C# Reference" title: "safe modifier" -ms.date: 09/11/2026 +ms.date: 10/19/2026 ai-usage: ai-assisted f1_keywords: - "safe_CSharpKeyword" @@ -11,11 +11,21 @@ helpviewer_keywords: --- # safe (C# Reference) -The `safe` contextual keyword attests that a declaration is sound in places where the [updated memory safety model](../unsafe-code.md#the-updated-memory-safety-model-preview) requires you to make the safety choice explicit. You apply `safe` as a modifier on a declaration that the compiler can't classify on its own, such as an `extern` member or a field in a type with explicit or extended layout. The `safe` modifier is the counterpart to [`unsafe`](unsafe.md): `safe` attests that callers need no `unsafe` context, while `unsafe` propagates the obligation to audit safety to the caller. +The `safe` contextual keyword marks a declaration as not requiring an `unsafe` context at its use site under the [updated memory safety model](../unsafe-code.md#the-updated-memory-safety-model-preview). The `safe` modifier is the counterpart to [`unsafe`](unsafe.md). An unsafe context isn't required for callers of a `safe` declaration, while `unsafe` propagates the obligation to audit safety to the caller. + +Using the `safe` keyword itself requires the [`AllowUnsafeBlocks`](../compiler-options/language.md#allowunsafeblocks) compiler option (`-unsafe`), even though callers don't need an `unsafe` context. Ordinary declarations are safe by default, so omit `safe` where it isn't required to avoid unnecessarily requiring unsafe compilation. > [!IMPORTANT] > The `safe` keyword is part of the updated memory safety model, a preview feature in C# 15 and .NET 11. Set [`LangVersion`](../compiler-options/language.md#langversion) to `preview` to enable the syntax. To also enforce the updated rules, including explicit `safe` or `unsafe` choices and requires-unsafe caller obligations, enable the `updated-memory-safety-rules` compiler feature. For activation details, see [Enable the updated memory safety rules](../compiler-options/language.md#enable-the-updated-memory-safety-rules). For the full design, see the [memory safety feature specification](~/_csharplang/proposals/unsafe-evolution.md). +## Permitted and required declarations + +You can apply `safe` to declarations that permit a requires-unsafe modifier, including methods, constructors, properties, and fields. For ordinary declarations, the modifier can make the intended contract explicit, including in source-generated code. It isn't limited to `extern` members and layout fields. + +Certain declarations require an explicit choice of `safe` or `unsafe` when the updated rules are enabled. The following sections describe `extern` members and explicit or extended layout fields. + +Unlike `unsafe`, `safe` doesn't establish a lexical context. It doesn't make unsafe operations in a member body safe or cancel an enclosing unsafe context. You can't combine the `safe` and `unsafe` modifiers on the same declaration; doing so produces CS9388. + ## Extern members An `extern` member calls into native code, so the compiler can't classify its safety. Under the updated model, you mark every `extern` declaration, including a `LibraryImport` partial method, either `safe` or `unsafe`: diff --git a/docs/csharp/language-reference/keywords/snippets/Extensions.cs b/docs/csharp/language-reference/keywords/snippets/Extensions.cs index 3b8343a37339d..287e1f3712957 100644 --- a/docs/csharp/language-reference/keywords/snippets/Extensions.cs +++ b/docs/csharp/language-reference/keywords/snippets/Extensions.cs @@ -224,8 +224,49 @@ public static class SequenceIndexer } // +// +/// Stores sensor readings. +public sealed class Readings(int[] values) +{ + /// Gets the stored readings. + public int[] Values { get; } = values; +} + +/// Provides indexing for sensor readings. +public static class ReadingExtensions +{ + /// Defines indexing members for readings. + /// The readings to access. + extension(Readings readings) + { + /// Gets the number of readings. + public int Count => readings.Values.Length; + + /// Gets a reading by position. + /// The zero-based position. + public int this[int index] => readings.Values[index]; + + /// Gets a range of readings. + /// The first position. + /// The number of readings. + public Readings Slice(int start, int length) + => new(readings.Values.AsSpan(start, length).ToArray()); + } +} +// + public static class ExtensionExamples { + public static void IndexAndRangeExample() + { + // + Readings readings = new([10, 20, 30, 40]); + Console.WriteLine(readings[^1]); // output: 40 + Console.WriteLine(readings[1..3][0]); // output: 20 + Console.WriteLine(readings is [10, .., 40]); // output: True + // + } + public static void BasicExample() { // diff --git a/docs/csharp/language-reference/operators/collection-expressions.md b/docs/csharp/language-reference/operators/collection-expressions.md index f77bed277eda6..1a30ec62dfbff 100644 --- a/docs/csharp/language-reference/operators/collection-expressions.md +++ b/docs/csharp/language-reference/operators/collection-expressions.md @@ -1,7 +1,8 @@ --- title: "Collection expressions (Collection literals)" description: Collection expressions convert to many collection types. You can write literal values, expressions, or other collections to create a new collection. -ms.date: 08/14/2026 +ms.date: 10/19/2026 +ai-usage: ai-assisted helpviewer_keywords: - "Collection expressions" --- @@ -70,8 +71,8 @@ When you convert a collection expression to a `Span` or `ReadOnlySpan`, the span Collection expressions work with any collection type that is *well-behaved*. A well-behaved collection has the following characteristics: -- The value of `Count` or `Length` on a [countable](./member-access-operators.md#index-from-end-operator-) collection produces the same value as the number of elements when enumerated. -- The types in the namespace are side-effect free. The compiler can optimize scenarios where these types might be used as intermediary values, but it doesn't expose them otherwise. +- The value of `Count` or `Length` on a [countable](./member-access-operators.md#index-from-end-operator-) collection produces the same value as the number of elements when you enumerate the collection. +- The types in the namespace are side-effect free. The compiler optimizes scenarios where these types might be used as intermediary values, but it doesn't expose them otherwise. - A call to an applicable `.AddRange(x)` member on a collection results in the same final value as iterating over `x` and adding all of its enumerated values individually to the collection by using `.Add`. All the collection types in the .NET runtime are well-behaved. @@ -107,6 +108,8 @@ Starting in C# 15, you can pass arguments to the underlying collection's constru The `with(...)` element must be the first element in the collection expression. The arguments declared in the `with(...)` element go to the appropriate constructor or create method based on the target type. You can use any valid expression for the arguments in the `with` element. +Argument expressions and element expressions are evaluated once, in left-to-right order, with the `with(...)` arguments evaluated before the collection elements. For a spread such as `.. GetItems()`, evaluation calls `GetItems()` to obtain the collection to spread. Enumeration is the separate step that reads items from that collection and adds them to the result. The compiler evaluates `GetItems()` at its left-to-right position, but can delay enumeration until after it evaluates later element expressions. Don't rely on side effects from enumeration occurring before those later expressions. + ### Constructor arguments When the target type is a class or struct that implements , the arguments in `with(...)` are evaluated and the results go to the constructor. The compiler uses overload resolution to select the best matching constructor: @@ -119,17 +122,25 @@ In the preceding example: - The `HashSet` constructor with an parameter gets called with `StringComparer.OrdinalIgnoreCase`. - For interface target types like , the compiler creates a `List` with the specified capacity. +For a target type constructed this way, `with(...)` is required if the type has no accessible parameterless constructor. Use it to supply the arguments to an accessible constructor. For example, `NamedValues` requires a name and inherits the collection behavior of `List`: + +:::code language="csharp" source="./snippets/shared/CollectionExpressionExamples.cs" id="RequiredConstructor"::: + +This collection expression supplies the required name and then adds the elements: + +:::code language="csharp" source="./snippets/shared/CollectionExpressionExamples.cs" id="RequiredConstructorUsage"::: + ### Collection builder arguments -For types with a , the arguments declared in the `with(...)` element get evaluated and the results go to the create method *before* the `ReadOnlySpan` parameter. This feature allows create methods to accept configuration parameters: +For types with a , the `with(...)` element evaluates the declared arguments and sends the results to the create method *before* the `ReadOnlySpan` parameter. This feature allows create methods to accept configuration parameters: :::code language="csharp" source="./snippets/shared/CollectionExpressionExamples.cs" id="BuilderClassWithComparer"::: -You can then use the `with(...)` element to pass the comparer: +Use the `with(...)` element to pass the comparer: :::code language="csharp" source="./snippets/shared/CollectionExpressionExamples.cs" id="WithBuilderArgumentsExample"::: -The create method gets selected by using overload resolution based on the arguments you provide. The `ReadOnlySpan` containing the collection elements is always the last parameter. +Overload resolution selects the create method based on the arguments you provide. The `ReadOnlySpan` containing the collection elements is always the last parameter. ### Interface target types @@ -149,4 +160,37 @@ The `with(...)` element has the following restrictions: - It must be the first element in the collection expression. - Arguments can't have `dynamic` type. - It's not supported for arrays or span types (`Span`, `ReadOnlySpan`). -- The arguments in `with(...)` don't affect whether a conversion exists from the collection expression to a candidate target type. The compiler ignores them during overload resolution and type inference. Only the presence of a `with(...)` element, not its arguments, affects whether the conversion exists. +- The arguments in `with(...)` don't affect whether a conversion exists from the collection expression to a candidate target type. Overload resolution and type inference for an enclosing call ignore those arguments. Only the presence of a `with(...)` element, not its arguments, affects whether that conversion exists. Once the target type is determined, the arguments do participate in overload resolution for its constructor or collection builder method. + +For example, a comparer argument doesn't tell the compiler to choose a `HashSet` overload over a `List` overload: + +```csharp +class Examples +{ + static void Print(List values) { } + static void Print(HashSet values) { } + + static void Example() + { + Print([with(StringComparer.OrdinalIgnoreCase), "one", "ONE"]); + } +} +``` + +The call produces **CS0121**: "The call is ambiguous between the following methods or properties." Although only `HashSet` has a constructor that accepts this comparer, the compiler ignores the `with(...)` arguments when it chooses the `Print` overload. Assign the collection expression to a `HashSet` variable first to select that overload. + +Similarly, `with(...)` arguments don't supply element types for generic type inference: + +```csharp +class Examples +{ + static void Use(List values) { } + + static void Example() + { + Use([with(10)]); + } +} +``` + +This call produces **CS0411**: "The type arguments can't be inferred from the usage. Try specifying the type arguments explicitly." The capacity argument doesn't determine `T`, and the collection has no elements from which to infer it. Specify the type argument, such as `Use([with(10)])`. diff --git a/docs/csharp/language-reference/operators/member-access-operators.md b/docs/csharp/language-reference/operators/member-access-operators.md index 353ecaac4f640..88568275aa8ad 100644 --- a/docs/csharp/language-reference/operators/member-access-operators.md +++ b/docs/csharp/language-reference/operators/member-access-operators.md @@ -88,7 +88,7 @@ The following example uses the .NET [!NOTE] > Single dimensional arrays are *countable*. Multidimensional arrays aren't. You can't use the `^` and `..` (range) operators in multidimensional arrays. @@ -262,7 +264,7 @@ The `..` token is also used for the [spread element](./collection-expressions.md ## Operator overloadability -You can't overload the `.`, `()`, `^`, and `..` operators. The `[]` operator is also a non-overloadable operator. Use [indexers](../../programming-guide/indexers/index.md) to support indexing with user-defined types. +You can't overload the `.`, `()`, `^`, and `..` operators. You also can't overload the `[]` operator. Use [indexers](../../programming-guide/indexers/index.md) to support indexing with user-defined types. ## C# language specification diff --git a/docs/csharp/language-reference/operators/patterns.md b/docs/csharp/language-reference/operators/patterns.md index 1bad019b7c03b..7e776007a92b4 100644 --- a/docs/csharp/language-reference/operators/patterns.md +++ b/docs/csharp/language-reference/operators/patterns.md @@ -1,7 +1,8 @@ --- title: "Patterns - Pattern matching using the is and switch expressions." description: "Learn about the patterns supported by the `is` and `switch` expressions. Combine multiple patterns using the `and`, `or`, and `not` operators." -ms.date: 08/14/2026 +ms.date: 10/19/2026 +ai-usage: ai-assisted f1_keywords: - "and_CSharpKeyword" - "or_CSharpKeyword" @@ -300,6 +301,8 @@ You can also nest a subpattern within a slice pattern, as the following example For more information, see [List pattern](~/_csharpstandard/standard/patterns.md#11211-list-pattern) in the C# language specification. +Starting with C# 15, extension indexing members can also supply the count and element access needed by a list pattern. For an example, see [Extension indexers](../keywords/extension.md#index-and-range-access). + ## Closed hierarchy patterns Starting in C# 15, a `switch` expression whose governing type is a [`closed`](../keywords/closed.md) class is *exhaustive* when its arms handle every direct descendant of that class. The compiler doesn't require a default arm because the switch is exhaustive: @@ -367,23 +370,26 @@ For more information, see the [closed modifier](../keywords/closed.md). For the ## Union patterns -Starting with C# 15, when the incoming value of a pattern is a [union type](../builtin-types/union.md), patterns generally *unwrap* the union. The pattern applies to the union's `Value` property rather than the union value itself. This behavior makes the union transparent to pattern matching: +C# 15 introduces [union types](../builtin-types/union.md). When you apply a type or declaration pattern to a union expression, the pattern tests the union's contents rather than the union instance. For example, these case types each have a `Name` property, and `Dog` also has a `Breed` property: ```csharp public record class Cat(string Name); -public record class Dog(string Name); -public union Pet(Cat, Dog); - -string Describe(Pet pet) => pet switch -{ - Dog d => d.Name, - Cat c => c.Name, -}; +public record class Dog(string Name, string Breed); ``` -Three patterns are exceptions: the discard `_` pattern, the `var` pattern, and the `not` pattern apply to the union value itself, not its `Value` property. +The following `Pet` union exposes its own read-only `Name` property, which delegates to the contained case: + +:::code language="csharp" source="../builtin-types/snippets/unions/UnionPatternMatching.cs" id="UnionWithProperty"::: + +Typed recursive patterns also test the contents: `Dog { Breed: "Labrador" }` reads the contained dog's `Breed`, a property the union doesn't have. In contrast, untyped property and positional patterns and list patterns use members of the union instance. Here, `{ Name: "Rex" }` reads the union's `Name` property, so it matches either a cat or a dog with that name: + +:::code language="csharp" source="../builtin-types/snippets/unions/UnionPatternMatching.cs" id="PropertyMatching"::: + +These rules apply in both `is` and `switch` expressions. The discard `_` pattern matches the incoming union, and a `var` pattern captures it without unwrapping. + +The `null` pattern checks whether the union's contents are null. It also succeeds when a class-based union reference or nullable union wrapper is null. The `not` pattern negates its nested pattern, so `pet is not null` tests for non-null contents. An empty untyped property pattern, `pet is { }`, instead tests the union instance: it matches a nonnullable struct union even when its contents are null. -The `null` pattern checks whether the union's `Value` is null. For class-based unions, `null` also succeeds when the union reference itself is null. +A type pattern must be compatible with at least one case type. For the preceding `Pet` declaration, `pet is Pet` produces compiler error CS8121 rather than testing the union instance. It can succeed for a recursive declaration such as `union Pet(Cat, Dog, Pet)`, because `Pet` is then a case type. Recursive unions make these tests easy to misinterpret: this pattern tests for a contained `Pet`, not the outer instance. Prefer nonrecursive union declarations. When a union type provides the *non-boxing access pattern*, the compiler calls `TryGetValue` for type-pattern checks and `HasValue` for null-pattern checks, avoiding boxing for value-type cases. Each member applies to its own pattern kind—neither is a fallback for the other. When a member is missing, the compiler checks the `Value` property for that pattern instead. diff --git a/docs/csharp/language-reference/operators/snippets/patterns/patterns.csproj b/docs/csharp/language-reference/operators/snippets/patterns/patterns.csproj index 7692041633b2d..d805edfa26c42 100644 --- a/docs/csharp/language-reference/operators/snippets/patterns/patterns.csproj +++ b/docs/csharp/language-reference/operators/snippets/patterns/patterns.csproj @@ -4,7 +4,6 @@ Exe enable net11.0 - preview enable Patterns diff --git a/docs/csharp/language-reference/operators/snippets/shared/CollectionExpressionExamples.cs b/docs/csharp/language-reference/operators/snippets/shared/CollectionExpressionExamples.cs index 783035c680c86..f19bfdf352cb1 100644 --- a/docs/csharp/language-reference/operators/snippets/shared/CollectionExpressionExamples.cs +++ b/docs/csharp/language-reference/operators/snippets/shared/CollectionExpressionExamples.cs @@ -83,6 +83,13 @@ public MySet(ReadOnlySpan items, IEqualityComparer? comparer = null) } // +// +public class NamedValues(string name) : List +{ + public string Name { get; } = name; +} +// + public class CollectionExpressionExamples { internal static void Examples() @@ -134,6 +141,7 @@ internal static void Examples() Console.WriteLine("\nTesting collection expressions with arguments:"); var examples = new CollectionExpressionExamples(); examples.CollectionArgumentsExamples(); + examples.RequiredConstructorExample(); // Additional test code for collection expressions with arguments string[] testValues = ["apple", "banana", "cherry"]; @@ -188,6 +196,15 @@ public void CollectionArgumentsExamples() } // + public void RequiredConstructorExample() + { + // + NamedValues readings = [with("temperature"), 18, 21, 24]; + Console.WriteLine($"{readings.Name}: {string.Join(", ", readings)}"); + // output: temperature: 18, 21, 24 + // + } + // public void CollectionBuilderArgumentsExample() { @@ -198,4 +215,3 @@ public void CollectionBuilderArgumentsExample() } // } - diff --git a/docs/csharp/language-reference/operators/switch-expression.md b/docs/csharp/language-reference/operators/switch-expression.md index 3eb4ecc922c66..b32d8de728be0 100644 --- a/docs/csharp/language-reference/operators/switch-expression.md +++ b/docs/csharp/language-reference/operators/switch-expression.md @@ -49,6 +49,8 @@ If none of a `switch` expression's patterns matches an input value, the runtime For [union types](../builtin-types/union.md), a `switch` expression is exhaustive when it handles all case types. A catch-all arm isn't needed. If the null state of the union's `Value` property is "maybe null," you must also handle `null` to avoid a warning. For more information, see [Union exhaustiveness](../builtin-types/union.md#union-exhaustiveness). +A default generated union can contain `null` even when all case types are nonnullable, such as an element of a newly allocated union array or a value created with `default`. The compiler doesn't necessarily warn about an omitted `null` arm in that situation, but the switch still throws if no arm matches. Handle `null` when default union contents can reach the switch. Prefer a `null` arm to a `var` or discard arm so that adding a new case type still produces a non-exhaustiveness warning. + > [!TIP] > To guarantee that a `switch` expression handles all possible input values, provide a `switch` expression arm with a [discard pattern](patterns.md#discard-pattern). diff --git a/docs/csharp/language-reference/statements/snippets/jump-statements/jump-statements.csproj b/docs/csharp/language-reference/statements/snippets/jump-statements/jump-statements.csproj index e3bb0aff834f7..5bf6c9b8cff2e 100644 --- a/docs/csharp/language-reference/statements/snippets/jump-statements/jump-statements.csproj +++ b/docs/csharp/language-reference/statements/snippets/jump-statements/jump-statements.csproj @@ -5,7 +5,6 @@ net11.0 enable enable - preview diff --git a/docs/csharp/language-reference/unsafe-code.md b/docs/csharp/language-reference/unsafe-code.md index f41c95f03c5f9..7f401737d7cbf 100644 --- a/docs/csharp/language-reference/unsafe-code.md +++ b/docs/csharp/language-reference/unsafe-code.md @@ -1,7 +1,7 @@ --- title: "Unsafe code, pointers to data, and function pointers" description: Learn about unsafe code, pointers, and function pointers. C# uses an unsafe context for operations that access unmanaged memory or invoke function pointers (unmanaged delegates). -ms.date: 09/11/2026 +ms.date: 10/19/2026 ai-usage: ai-assisted f1_keywords: - "functionPointer_CSharpKeyword" @@ -20,7 +20,7 @@ Most of the C# code you write is verifiably safe code. *Verifiably safe code* me [!INCLUDE[csharp-version-note](./includes/initial-version.md)] -C# also supports an [`unsafe`](keywords/unsafe.md) context, in which you can write *unverifiable* code. Unsafe code isn't necessarily dangerous; it's just code whose safety can't be verified by .NET tools. You use unsafe code to call native functions that require pointers, and in some cases to improve performance through direct memory access that avoids array-bounds checks. Unsafe code also introduces security and stability risks. To compile code that contains an `unsafe` context, add the [**AllowUnsafeBlocks**](compiler-options/language.md#allowunsafeblocks) compiler option. +C# also supports an [`unsafe`](keywords/unsafe.md) context, in which you can write *unverifiable* code. Unsafe code isn't necessarily dangerous; it's just code whose safety can't be verified by .NET tools. Use unsafe code to call native functions that require pointers, and in some cases to improve performance through direct memory access that avoids array-bounds checks. Unsafe code also introduces security and stability risks. To compile code that contains an `unsafe` context, add the [**AllowUnsafeBlocks**](compiler-options/language.md#allowunsafeblocks) compiler option. C# defines two models for what counts as unsafe code: the original model and an updated memory safety model that's in preview in C# 15 and .NET 11. For information about how the two models differ, see [Two models for unsafe code](#two-models-for-unsafe-code). @@ -255,7 +255,7 @@ The updated model also tightens a few related rules: - The `unsafe` modifier produces an error on a type declaration, a static constructor, and a finalizer, because the modifier has no caller to inform. - Delegates can't be `unsafe`, because a delegate is type-shaped. -- A type whose parameterless constructor is `unsafe` doesn't satisfy the `new()` constraint. +- A type whose parameterless constructor is `unsafe` can't satisfy a `new()` or `struct` constraint in a declaration, such as a base type or field type. In an expression, it can satisfy the constraint inside an unsafe context, for example `unsafe { var box = new Box(); }` when `Box` has a `new()` constraint and `NativeResource` has a requires-unsafe constructor. ### Operations that require an unsafe context @@ -336,12 +336,12 @@ The null check and the array length rule out the inputs that would let a read ru ### Safety documentation -A requires-unsafe member should document what the caller must guarantee. The updated model encourages two complementary comment styles: +A *requires-unsafe* member should document what the caller must guarantee. The updated model encourages two complementary comment styles: -- A `/// ` documentation block above the signature states the formal contract: the conditions a caller must satisfy. An analyzer can flag a requires-unsafe member that's missing one. +- A `/// ` documentation block above the signature states the formal contract: the conditions a caller must satisfy. An analyzer can flag a *requires-unsafe* member that's missing one. - A `// SAFETY:` comment inside an `unsafe` block records why the operation is sound at that spot, for the developers and auditors who read the body. -The following preview example shows both styles on a requires-unsafe `ReadByte` method: +The following preview example shows both styles on a *requires-unsafe* `ReadByte` method: ```csharp // Preview @@ -393,12 +393,14 @@ public class NativeBuffer } ``` -A `readonly unsafe` field pairs the contract with a built-in guard: `unsafe` names the invariant, and `readonly` prevents a write that could break it after construction. Marking a property or an event `unsafe` doesn't make its backing field requires-unsafe. In a type with explicit or extended layout — that is, marked with set to `LayoutKind.Explicit`, or with — you mark every field either `safe` or `unsafe`. +A `readonly unsafe` field pairs the contract with a built-in guard: `unsafe` names the invariant, and `readonly` prevents a write that could break it after construction. Marking a property or an event `unsafe` doesn't make its backing field *requires-unsafe*. In a type with explicit or extended layout — that is, marked with set to `LayoutKind.Explicit`, or with — you mark every field either `safe` or `unsafe`. ### The safe keyword The updated model adds a [`safe`](keywords/safe.md) contextual keyword that attests a declaration is sound where the compiler requires you to make the choice explicit. +Ordinary declarations are safe by default, so they don't require a `safe` modifier. Because `unsafe` code should be rare, most codebases use `safe` only where the default would otherwise be unsafe or the compiler requires an explicit choice. The modifier marks a declaration as not requires-unsafe; it doesn't establish a safe lexical context or cancel an enclosing unsafe context. You can't combine `safe` and `unsafe` on the same declaration. + An `extern` member calls into native code, so the compiler can't classify its safety. Under the updated model, you mark every `extern` declaration, including a `LibraryImport` partial method, either `safe` or `unsafe`: ```csharp diff --git a/docs/csharp/whats-new/csharp-15.md b/docs/csharp/whats-new/csharp-15.md index b9aec60a99345..d02bc0ab1665b 100644 --- a/docs/csharp/whats-new/csharp-15.md +++ b/docs/csharp/whats-new/csharp-15.md @@ -1,25 +1,26 @@ --- title: What's new in C# 15 -description: "Discover what's new in C# 15, including features such as union types, the closed modifier, extension indexers, and pointer relaxations. Try examples in your code." -ms.date: 09/11/2026 +description: "Discover what's new in C# 15, including union types, closed hierarchies, extension indexers, collection expression arguments, and static interface compatibility." +ms.date: 10/19/2026 ms.topic: whats-new ms.update-cycle: 365-days ai-usage: ai-assisted --- # What's new in C# 15 -C# 15 includes the following new features. Try these features by using the latest [Visual Studio 2026](https://visualstudio.microsoft.com/) insiders version or the [.NET 11 preview SDK](https://dotnet.microsoft.com/download/dotnet): +C# 15 includes the following new features. Try these features by using the [.NET 11 SDK](https://dotnet.microsoft.com/download/dotnet/11.0) or a compatible version of [Visual Studio 2026](https://visualstudio.microsoft.com/): - [Collection expression arguments](#collection-expression-arguments) - [Union types](#union-types) - [Closed hierarchies](#closed-hierarchies) - [Extension indexers](#extension-indexers) - [Labeled `break` and `continue`](#labeled-break-and-continue) -- [Memory safety](#memory-safety) +- [Non-virtual static interface members on older runtimes](#non-virtual-static-interface-members-on-older-runtimes) +- [Memory safety (preview feature)](#memory-safety) -C# 15 is the latest C# preview release. .NET 11 preview versions support C# 15. For more information, see [C# language versioning](../language-reference/configure-language-version.md). +C# 15 is the default language version for projects that target `net11.0` in the .NET 11 SDK. Except for memory safety, these features don't require `preview`. The .NET 11 SDK is still prerelease. For more information, see [C# language versioning](../language-reference/configure-language-version.md). -You can download the latest .NET 11 preview SDK from the [.NET downloads page](https://dotnet.microsoft.com/download). You can also download [Visual Studio 2026 insiders](https://visualstudio.microsoft.com/vs/), which includes the .NET 11 preview SDK. +You can also try the [memory safety preview feature](#memory-safety). Enable the preview language version for the syntax and pointer relaxations, and the `updated-memory-safety-rules` feature flag for the updated safety rules. The "What's new in C#" page adds new features when they're available in public preview releases. The [working set](https://github.com/dotnet/roslyn/blob/main/docs/Language%20Feature%20Status.md#working-set) section of the [roslyn feature status page](https://github.com/dotnet/roslyn/blob/main/docs/Language%20Feature%20Status.md) tracks when upcoming features are merged into the main branch. @@ -29,7 +30,7 @@ You can find any breaking changes introduced in C# 15 in our article on [breakin ## Collection expression arguments -You can pass arguments to the underlying collection's constructor or factory method by using a `with(...)` element as the first element in a collection expression. This feature enables you to specify capacity, comparers, or other constructor parameters directly within the collection expression syntax. +Use a `with(...)` element as the first element in a collection expression to pass arguments to the underlying collection's constructor or factory method. This feature enables you to specify capacity, comparers, or other constructor parameters directly within the collection expression syntax. The following example shows how to pass a capacity argument to a `List` constructor and a comparer to a `HashSet`: @@ -71,8 +72,6 @@ string name = pet switch }; ``` -The runtime includes the `UnionAttribute` and `IUnion` types beginning with .NET 11 Preview 5. Some features from the [proposal specification](~/_csharplang/proposals/csharp-15.0/unions.md) aren't yet implemented. Those features are coming in future previews. - For more information, see [Union types](../language-reference/builtin-types/union.md) in the language reference or the [feature specification](~/_csharplang/proposals/csharp-15.0/unions.md). ## Closed hierarchies @@ -155,9 +154,24 @@ The [IDE0410](../../fundamentals/code-analysis/style-rules/ide0410.md) style rul For more information, see [Jump statements](../language-reference/statements/jump-statements.md) in the language reference or the [feature specification](~/_csharplang/proposals/csharp-15.0/labeled-break-continue.md). +## Non-virtual static interface members on older runtimes + +Starting in C# 15, you can declare and use non-virtual static interface members even when the target runtime doesn't support default interface implementations. For example, an interface can provide a static helper method without requiring an implementation from each implementing type: + +```csharp +public interface IMeasurement +{ + public static double ToMeters(double centimeters) => centimeters / 100; +} +``` + +Call this helper directly on the interface, for example, `IMeasurement.ToMeters(250)`. Instance default implementations, `static abstract` and `static virtual` members, and protected interface members still require runtime support. + +For more information, see [Static interface members and runtime support](../language-reference/keywords/interface.md#static-interface-members-and-runtime-support). + ## Memory safety -C# 15 begins a multirelease effort to redefine memory safety in the language. The goal is to tie the `unsafe` context to the operations that actually access unmanaged memory, rather than to the existence of pointer types. Most memory safety vulnerabilities come from these access operations, so the language makes them stand out for reviewers and auditors. +The .NET 11 SDK includes a memory safety preview feature that begins a multirelease effort to redefine memory safety in the language. The goal is to tie the `unsafe` context to the operations that actually access unmanaged memory, rather than to the existence of pointer types. Most memory safety vulnerabilities come from these access operations, so the language makes them stand out for reviewers and auditors. When you enable the updated rules, `unsafe` on a member marks it as *requires-unsafe*: the audit obligation flows to the caller, who must use the member from an `unsafe` context. The compiler records the assembly's use of the updated rules with the `System.Runtime.CompilerServices.MemorySafetyRulesAttribute` attribute. The model also adds a `safe` contextual keyword that marks `extern` members and fields in explicit or extended layout types as safe. Together, these rules make the boundaries of potential memory unsafety explicit across a program. @@ -202,7 +216,7 @@ class Header Like the rest of the memory safety preview, `unsafe` expressions require the `preview` language version and the `AllowUnsafeBlocks` compiler option. -The compiler also recognizes the `safe` contextual keyword as a modifier on `extern` members and fields in explicit or extended layout types. Set `LangVersion` to `preview` to enable the new syntax and pointer relaxations. To also enable the updated rules, including *requires-unsafe* caller obligations, enable the `updated-memory-safety-rules` compiler feature. For project and file-based program syntax, see [Enable the updated memory safety rules](../language-reference/compiler-options/language.md#enable-the-updated-memory-safety-rules). +The compiler also recognizes the `safe` contextual keyword on declarations that can carry a safety contract, including `extern` members and fields in explicit or extended layout types. Set `LangVersion` to `preview` to enable the new syntax and pointer relaxations. To also enable the updated rules, including *requires-unsafe* caller obligations, enable the `updated-memory-safety-rules` compiler feature. For project and file-based program syntax, see [Enable the updated memory safety rules](../language-reference/compiler-options/language.md#enable-the-updated-memory-safety-rules). For more information, see [Unsafe code, pointer types, and function pointers](../language-reference/unsafe-code.md#the-updated-memory-safety-model-preview) in the language reference or the [feature specification](~/_csharplang/proposals/unsafe-evolution.md). diff --git a/docs/csharp/whats-new/tutorials/closed-hierarchies.md b/docs/csharp/whats-new/tutorials/closed-hierarchies.md index 5339f899e980c..8074a0e0895a5 100644 --- a/docs/csharp/whats-new/tutorials/closed-hierarchies.md +++ b/docs/csharp/whats-new/tutorials/closed-hierarchies.md @@ -5,7 +5,7 @@ author: billwagner ms.author: wiwagn ms.service: dotnet-csharp ms.topic: tutorial -ms.date: 07/03/2026 +ms.date: 10/19/2026 ai-usage: ai-assisted #customer intent: As a C# developer, I model a fixed set of related types so the compiler enforces that I handle every subtype. --- @@ -26,13 +26,12 @@ In this tutorial, you: ## Prerequisites -This tutorial uses preview language features. You need an SDK that supports closed hierarchies and a language version set to `preview`. To get started, you'll need: +This tutorial uses C# 15 closed hierarchies. To get started, you need: -- The .NET 11 SDK preview 5 SDK or a later version. Download it from the [.NET download site](https://dotnet.microsoft.com/download/dotnet). +- The [.NET 11 SDK](https://dotnet.microsoft.com/download/dotnet/11.0). - An editor such as Visual Studio or Visual Studio Code with the C# Dev Kit. -> [!IMPORTANT] -> Closed hierarchies are a preview feature. The syntax and behavior can change before the feature ships. Set `preview` in your project to enable it. +Projects that target `net11.0` use C# 15 by default. You don't need to set `LangVersion` to `preview`. ## Create the sample solution @@ -42,19 +41,19 @@ You build a class library, `SmartHome.Core`, that holds the closed hierarchy, a ```dotnetcli dotnet new sln -n TelemetryMonitor - dotnet new classlib --langversion preview -n SmartHome.Core - dotnet new classlib --langversion preview -n SmartHome.Extensions - dotnet new console --langversion preview -n SmartHome.App + dotnet new classlib -f net11.0 -n SmartHome.Core + dotnet new classlib -f net11.0 -n SmartHome.Extensions + dotnet new console -f net11.0 -n SmartHome.App dotnet sln add SmartHome.Core SmartHome.Extensions SmartHome.App dotnet add SmartHome.Extensions reference SmartHome.Core dotnet add SmartHome.App reference SmartHome.Core SmartHome.Extensions ``` -1. The previous commands included the `--langversion preview` to enable C# 15 preview features. In each project file, verify that the language version is set to `preview`: +1. In each project file, verify that the target framework is .NET 11. The SDK selects C# 15 for this target: ```xml - preview + net11.0 ``` @@ -70,9 +69,7 @@ Start with the sensor model. The monitor supports a fixed set of sensor kinds, s :::code language="csharp" source="snippets/shared/telemetry-monitor/SmartHome.Core/Sensors.cs" id="SensorExhaustive"::: -1. Build the project. .NET 11 preview 5 has the language support for closed hierarchies, but a necessary type won't be added until a later preview. If you get build errors, you need to add a polyfill for the `Closed` attribute. Add the following code to the `SmartHome.Core` project in a file named `ClosedPolyfill.cs`: - - :::code language="csharp" source="snippets/shared/telemetry-monitor/SmartHome.Core/ClosedPolyfill.cs"::: +1. Build the project to check the declarations and the exhaustive switch. The `closed` modifier restricts the direct subtypes of `Sensor` to the declaring assembly, and a `closed` type is implicitly abstract, so you can't instantiate it directly. Because the compiler knows the complete set of subtypes, the switch needs no default arm. If you add a new sensor type later, the compiler reports that this switch no longer covers every case. That feedback is the central benefit of a closed hierarchy. The compiler points you to every match that needs to change. The `Temperature` and `Humidity` cases are sealed because their shape is final, while `Contact` stays open as an extension point that the next section covers. For more information, see the [`closed` modifier](../../language-reference/keywords/closed.md) and [Closed hierarchy patterns](../../language-reference/operators/patterns.md#closed-hierarchy-patterns). diff --git a/docs/csharp/whats-new/tutorials/extension-members.md b/docs/csharp/whats-new/tutorials/extension-members.md index af870198da4ad..2f89d9e428d61 100644 --- a/docs/csharp/whats-new/tutorials/extension-members.md +++ b/docs/csharp/whats-new/tutorials/extension-members.md @@ -5,7 +5,7 @@ author: billwagner ms.author: wiwagn ms.service: dotnet-csharp ms.topic: tutorial -ms.date: 07/15/2026 +ms.date: 10/19/2026 ai-usage: ai-assisted #customer intent: As a C# developer, I reduce repeated code by introducing extension members for common tasks --- @@ -27,9 +27,10 @@ In this tutorial, you: ## Prerequisites -- The .NET 11 preview SDK. Download it from the [.NET download site](https://dotnet.microsoft.com/download/dotnet/11.0). -- Visual Studio 2026 with preview features enabled. Download it from the [Visual Studio page](https://visualstudio.microsoft.com). -- This sample sets `preview` because extension indexers are a C# 15 preview feature. +- The [.NET 11 SDK](https://dotnet.microsoft.com/download/dotnet/11.0). +- An editor such as Visual Studio 2026 or Visual Studio Code with the C# Dev Kit. + +This sample targets `net11.0`, which selects C# 15 by default. Extension indexers don't require `preview`. ## Create the sample application @@ -38,11 +39,11 @@ Start by creating a console application that demonstrates both traditional exten 1. Create a new console application. ```dotnetcli - dotnet new console -n PointExtensions + dotnet new console -f net11.0 -n PointExtensions cd PointExtensions ``` -1. Update the project file so the sample targets .NET 11 and uses preview language features: +1. Verify that the project file targets .NET 11: :::code language="xml" source="snippets/PointExtensions/PointExtensions.csproj"::: diff --git a/docs/csharp/whats-new/tutorials/snippets/PointExtensions/PointExtensions.csproj b/docs/csharp/whats-new/tutorials/snippets/PointExtensions/PointExtensions.csproj index 1de1aa47a7270..9c8a72d56dd5c 100644 --- a/docs/csharp/whats-new/tutorials/snippets/PointExtensions/PointExtensions.csproj +++ b/docs/csharp/whats-new/tutorials/snippets/PointExtensions/PointExtensions.csproj @@ -3,7 +3,6 @@ Exe net11.0 - preview enable enable diff --git a/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.App/SmartHome.App.csproj b/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.App/SmartHome.App.csproj index 6b21776a405c3..6376e5761db10 100644 --- a/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.App/SmartHome.App.csproj +++ b/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.App/SmartHome.App.csproj @@ -7,10 +7,9 @@ Exe - net10.0 + net11.0 enable enable - preview diff --git a/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Core/ClosedPolyfill.cs b/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Core/ClosedPolyfill.cs deleted file mode 100644 index 229927f42009d..0000000000000 --- a/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Core/ClosedPolyfill.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace System.Runtime.CompilerServices; - -[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -public sealed class ClosedAttribute : Attribute { } diff --git a/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Core/SmartHome.Core.csproj b/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Core/SmartHome.Core.csproj index 39b1711893882..7923b0fa31ddf 100644 --- a/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Core/SmartHome.Core.csproj +++ b/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Core/SmartHome.Core.csproj @@ -1,10 +1,9 @@  - net10.0 + net11.0 enable enable - preview diff --git a/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Core/UnionSupport.cs b/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Core/UnionSupport.cs deleted file mode 100644 index f735dbc2c28eb..0000000000000 --- a/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Core/UnionSupport.cs +++ /dev/null @@ -1,21 +0,0 @@ -// TEMPORARY SHIM. -// -// The unions and closed-hierarchy features rely on these support types. A later -// .NET SDK ships them in the base class library, at which point this file should -// be deleted. They're defined here so the sample compiles on the preview SDK that -// recognizes the language syntax but doesn't yet include the types. -// -// This file is intentionally NOT referenced by any tutorial snippet. - -namespace System.Runtime.CompilerServices; - -[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false)] -public class UnionAttribute : Attribute; - -public interface IUnion -{ - object? Value { get; } -} - -[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -public sealed class IsClosedTypeAttribute : Attribute; diff --git a/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Extensions/SmartHome.Extensions.csproj b/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Extensions/SmartHome.Extensions.csproj index d3227e65cc5e2..e457a805d62b8 100644 --- a/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Extensions/SmartHome.Extensions.csproj +++ b/docs/csharp/whats-new/tutorials/snippets/shared/telemetry-monitor/SmartHome.Extensions/SmartHome.Extensions.csproj @@ -5,10 +5,9 @@ - net10.0 + net11.0 enable enable - preview diff --git a/docs/csharp/whats-new/tutorials/unions.md b/docs/csharp/whats-new/tutorials/unions.md index a83e6d2349b7c..e4c9f6e8b9461 100644 --- a/docs/csharp/whats-new/tutorials/unions.md +++ b/docs/csharp/whats-new/tutorials/unions.md @@ -5,7 +5,7 @@ author: billwagner ms.author: wiwagn ms.service: dotnet-csharp ms.topic: tutorial -ms.date: 07/02/2026 +ms.date: 10/19/2026 ai-usage: ai-assisted #customer intent: As a C# developer, I model a value that can be one of several types so the compiler enforces that I handle every case. --- @@ -26,13 +26,12 @@ In this tutorial, you: ## Prerequisites -This tutorial uses preview language features. You need an SDK that supports closed hierarchies and a language version set to `preview`. To get started, you'll need: +This tutorial uses C# 15 union types. To get started, you need: -- The .NET 11 SDK preview 5 SDK or a later version. Download it from the [.NET download site](https://dotnet.microsoft.com/download/dotnet). +- The [.NET 11 SDK](https://dotnet.microsoft.com/download/dotnet/11.0). - An editor such as Visual Studio or Visual Studio Code with the C# Dev Kit. -> [!IMPORTANT] -> Union types are a preview feature. The syntax and supporting types can change before the feature ships. Set `preview` in your project to enable it. +Projects that target `net11.0` use C# 15 by default. You don't need to set `LangVersion` to `preview`. ## Create the sample solution @@ -42,17 +41,17 @@ You build a class library, `SmartHome.Core`, that holds the union types, and a c ```dotnetcli dotnet new sln -n TelemetryMonitor - dotnet new classlib --langVersion preview -n SmartHome.Core - dotnet new console --langVersion preview -n SmartHome.App + dotnet new classlib -f net11.0 -n SmartHome.Core + dotnet new console -f net11.0 -n SmartHome.App dotnet sln add SmartHome.Core SmartHome.App dotnet add SmartHome.App reference SmartHome.Core ``` -1. The previous commands included the `--langVersion preview` to enable C# 15 preview features. In each project file, verify that the language version is set to `preview`: +1. In each project file, verify that the target framework is .NET 11. The SDK selects C# 15 for this target: ```xml - preview + net11.0 ``` @@ -86,11 +85,11 @@ When a sensor read can fail, you need a type that carries either a value or an e :::code language="csharp" source="snippets/shared/telemetry-monitor/SmartHome.Core/Result.cs" id="ResultConsume"::: -The original class lets a caller incorrectly read `Value` on a failure or `Error` on a success. The union removes those invalid states: a `Result` is either a `T` that holds the successful result or an `Exception` that explains why the operation failed. Each case converts to the union implicitly, so you assign an instance of `T` or an instance of `Exception` directly to a `Result`. When you read the result, a switch verifies that you handle the success value, the failure, and null. For more information, see [Union declarations](../../language-reference/builtin-types/union.md#union-declarations) and [Union conversions](../../language-reference/builtin-types/union.md#union-conversions). +The original class lets a caller incorrectly read `Value` on a failure or `Error` on a success. The union represents each outcome with its own type: a `T` holds the successful result, and an `Exception` explains why the operation failed. Each case converts to the union implicitly, so you assign an instance of `T` or an instance of `Exception` directly to a `Result`. A default union can still contain null, so the switch also handles that possibility. In this example, `T` is unconstrained and can be nullable, so nullability analysis warns if you omit the `null` arm. For more information, see [Union declarations](../../language-reference/builtin-types/union.md#union-declarations) and [Union exhaustiveness](../../language-reference/builtin-types/union.md#union-exhaustiveness). ## Reuse a generic union across numeric types -Sensors report at different resolutions: a contact sensor uses a `byte`, a position sensor uses a `short`, and a counter uses an `int`. Rather than write a union per type, write one generic union and instantiate it with each numeric type. +Sensors report at different resolutions: a contact sensor uses a `byte`, a position sensor uses a `short`, and a counter uses an `int`. Rather than write a union for each type, write one generic union and instantiate it with each numeric type. 1. In `SmartHome.Core`, add a file named `Sample.cs` and declare the `Sample` union. It holds either an in-range reading of type `T` or a `Saturated` marker for a sensor that railed. Give the union a body that adds an `InRange` property: @@ -152,7 +151,7 @@ You built the readings layer of a smart-home telemetry monitor and, in the proce - Declared a `Reading` union and read it with an exhaustive switch, letting the compiler flag any case you don't handle. - Handled a nullable case, where the compiler requires a `null` arm. -- Replaced a hand-rolled result type with a generic `Result` union that models success or failure without invalid states. +- Replaced a hand-rolled result type with a generic `Result` union that models success or failure and handles null contents. - Reused a generic `Sample` union across several numeric types with a constraint, and added members to the union declaration. - Built a custom `[Union]` struct that avoids boxing for performance-sensitive code. From 474ba88b3175e7375dd4f35b971262b2c018f7b2 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Oct 2026 14:52:27 -0400 Subject: [PATCH 06/10] Document dependency injection disposal exception aggregation in .NET 11 (#56510) * Initial plan * Document .NET 11 dependency injection disposal exception aggregation Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> * Display full names in disposal affected API links 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> --- docs/core/compatibility/11.md | 1 + ...ependency-injection-disposal-exceptions.md | 55 +++++++++++++++++++ docs/core/compatibility/toc.yml | 2 + 3 files changed, 58 insertions(+) create mode 100644 docs/core/compatibility/extensions/11/dependency-injection-disposal-exceptions.md diff --git a/docs/core/compatibility/11.md b/docs/core/compatibility/11.md index 4d9e13554d17a..2cedbe0549f7f 100644 --- a/docs/core/compatibility/11.md +++ b/docs/core/compatibility/11.md @@ -71,6 +71,7 @@ See [Breaking changes in EF Core 11](/ef/core/what-is-new/ef-core-11.0/breaking- | Title | Type of change | |-------|-------------------| | [ChangeToken.OnChange async overloads rebind existing Task-returning callbacks](extensions/11/changetoken-onchange-async-overloads-rebind-callbacks.md) | Behavioral change | +| [Dependency injection scope disposal aggregates exceptions](extensions/11/dependency-injection-disposal-exceptions.md) | Behavioral change | | [FileConfigurationProvider doesn't raise reload token after ignored load failure](extensions/11/fileconfigurationprovider-reload-token-load-failure.md) | Behavioral change | | [FileConfigurationSource.OnLoadException callback is called for IO errors](extensions/11/fileconfigurationsource-onloadexception-io-errors.md) | Behavioral change | | [IHost.RunAsync and IHost.StopAsync throw when a BackgroundService fails](extensions/11/ihost-runasync-stopasync-throw-backgroundservice-failure.md) | Behavioral change | diff --git a/docs/core/compatibility/extensions/11/dependency-injection-disposal-exceptions.md b/docs/core/compatibility/extensions/11/dependency-injection-disposal-exceptions.md new file mode 100644 index 0000000000000..c70684e554f9e --- /dev/null +++ b/docs/core/compatibility/extensions/11/dependency-injection-disposal-exceptions.md @@ -0,0 +1,55 @@ +--- +title: "Breaking change - Dependency injection scope disposal aggregates exceptions" +description: "Learn about the breaking change in .NET 11 where dependency injection disposal continues after failures and aggregates multiple exceptions." +ms.date: 10/21/2026 +ai-usage: ai-generated +ms.custom: https://github.com/dotnet/docs/issues/55654 +--- + +# Dependency injection scope disposal aggregates exceptions + +In .NET 11, the built-in dependency injection container attempts to dispose every captured disposable service, even if a service throws an exception. This behavior applies to synchronous and asynchronous disposal of scopes and root service providers. Multiple disposal failures produce an . + +## Version introduced + +.NET 11 Preview 2 + +## Previous behavior + +Previously, scope and root provider disposal processed captured disposable services in reverse capture order but stopped at the first exception. That exception propagated unchanged, and the remaining services weren't disposed. + +For example, suppose you resolved `FirstDisposable` and then `SecondDisposable`, and both services threw during disposal. The container disposed `SecondDisposable` first. Its exception prevented disposal of `FirstDisposable`. + +## New behavior + +Starting in .NET 11, synchronous and asynchronous disposal of built-in scopes and root service providers attempts every captured disposable service in reverse capture order, even after a failure. + +After all disposal attempts finish, a single exception is rethrown unchanged. If multiple disposal operations fail, disposal throws an that contains all the exceptions. + +In the preceding example, the container attempts to dispose `SecondDisposable` and then `FirstDisposable`. Because both throw, disposal throws an `AggregateException` that contains both exceptions. + +## Type of breaking change + +This change is a [behavioral change](../../categories.md#behavioral-change). + +## Reason for change + +To give every captured service an opportunity to release resources such as timers, event handlers, and unmanaged handles, the container continues disposal after exceptions. Previously, one service's failure prevented other services from releasing their resources. + +For more information, see [dotnet/runtime PR #123342](https://github.com/dotnet/runtime/pull/123342). + +## Recommended action + +No action is required if your disposal implementations don't throw and your code doesn't rely on disposal to stop after the first failure. + +To avoid cleanup failures, prefer `Dispose()` and `DisposeAsync()` implementations that don't throw. If your code handles disposal failures, handle both the original exception for a single failure and `AggregateException` for multiple failures. Catch `AggregateException` before a general exception handler, and inspect to handle each failure. + +Don't rely on a disposal exception to prevent other services from being disposed. No compatibility switch restores the previous behavior. + +## Affected APIs + +- +- +- +- +- on instances created by the built-in container. diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index d39106c33dd8f..56373122ab837 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -72,6 +72,8 @@ items: items: - name: ChangeToken.OnChange async overloads rebind existing Task-returning callbacks href: extensions/11/changetoken-onchange-async-overloads-rebind-callbacks.md + - name: Dependency injection scope disposal aggregates exceptions + href: extensions/11/dependency-injection-disposal-exceptions.md - name: FileConfigurationProvider doesn't raise reload token after ignored load failure href: extensions/11/fileconfigurationprovider-reload-token-load-failure.md - name: FileConfigurationSource.OnLoadException callback is called for IO errors From 705acf6d28963fdb60e49ddd1c5437b3e0419a66 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Oct 2026 14:52:40 -0400 Subject: [PATCH 07/10] Document Native AOT rejection of non-blittable UnmanagedCallersOnly signatures (#56511) * Initial plan * Document Native AOT UnmanagedCallersOnly signature validation Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> * Update docs/core/compatibility/interop/11/unmanagedcallersonly-non-blittable.md Co-authored-by: Genevieve Warren <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: Bill Wagner Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- docs/core/compatibility/11.md | 1 + .../11/unmanagedcallersonly-non-blittable.md | 49 +++++++++++++++++++ docs/core/compatibility/toc.yml | 2 + docs/core/deploying/native-aot/interop.md | 3 ++ 4 files changed, 55 insertions(+) create mode 100644 docs/core/compatibility/interop/11/unmanagedcallersonly-non-blittable.md diff --git a/docs/core/compatibility/11.md b/docs/core/compatibility/11.md index 2cedbe0549f7f..87fc6a8e7174b 100644 --- a/docs/core/compatibility/11.md +++ b/docs/core/compatibility/11.md @@ -90,6 +90,7 @@ See [Breaking changes in EF Core 11](/ef/core/what-is-new/ef-core-11.0/breaking- | Title | Type of change | |-------------------------------------------------------------------|-------------------| +| [Native AOT rejects non-blittable UnmanagedCallersOnly signatures](interop/11/unmanagedcallersonly-non-blittable.md) | Behavioral change | | [NativeAOT uses lib prefix for native library outputs on Unix](interop/11/nativeaot-lib-prefix.md) | Behavioral change | ## JIT compiler diff --git a/docs/core/compatibility/interop/11/unmanagedcallersonly-non-blittable.md b/docs/core/compatibility/interop/11/unmanagedcallersonly-non-blittable.md new file mode 100644 index 0000000000000..a80fcd4a43a5b --- /dev/null +++ b/docs/core/compatibility/interop/11/unmanagedcallersonly-non-blittable.md @@ -0,0 +1,49 @@ +--- +title: "Breaking change: Native AOT rejects non-blittable UnmanagedCallersOnly signatures" +description: "Learn about the breaking change in .NET 11 where Native AOT throws InvalidProgramException for non-blittable UnmanagedCallersOnly signatures when runtime marshalling is enabled." +ms.date: 10/21/2026 +ai-usage: ai-generated +--- + +# Native AOT rejects non-blittable UnmanagedCallersOnly signatures + +In .NET 11, Native AOT enforces the requirement that methods annotated with use only blittable parameter and return types. When runtime marshalling is enabled, a call to a method with a non-blittable signature throws and terminates the process. + +## Version introduced + +.NET 11 Preview 7 + +## Previous behavior + +Previously, Native AOT accepted `[UnmanagedCallersOnly]` methods with non-blittable parameter or return types, such as `bool` and `char`, even when runtime marshalling was enabled. Calls to these methods passed values through without conversion. + +## New behavior + +Starting in .NET 11, when runtime marshalling is enabled, Native AOT throws if an unmanaged caller invokes an `[UnmanagedCallersOnly]` method with a non-blittable parameter or return type. For example, a method that returns `bool` or accepts a `char` parameter is rejected. + +Because the exception escapes the unmanaged entry point, the process terminates (fails fast). You can't catch this exception to recover from the invalid signature. + +Native AOT now enforces the same signature restrictions as CoreCLR and ReadyToRun. + +## Type of breaking change + +This change is a [behavioral change](../../categories.md#behavioral-change). + +## Reason for change + +`[UnmanagedCallersOnly]` methods don't perform marshalling. Their parameter and return types must be blittable, with the same binary representation in managed and native code. With runtime marshalling enabled, types such as `bool` and `char` don't satisfy this requirement. If the native caller expects a different representation, values passed without conversion can cause silent data corruption. + +Runtime marshalling is enabled by default for assemblies without . + +To enforce the attribute's contract and align Native AOT with CoreCLR and ReadyToRun, Native AOT now validates these signatures. For details, see [dotnet/runtime#130160](https://github.com/dotnet/runtime/pull/130160). + +## Recommended action + +Choose one of the following options: + +- **Disable runtime marshalling for supported unmanaged types.** For types such as `bool` and `char`, add `[assembly: System.Runtime.CompilerServices.DisableRuntimeMarshalling]` to the assembly that declares the `[UnmanagedCallersOnly]` method. Place the assembly attribute after any `using` directives and before type declarations. The attribute disables runtime marshalling for the entire assembly, not just the method. Under these rules, `bool` uses a one-byte representation and `char` uses a two-byte representation, without conversion. Ensure that the native caller and managed method agree on each type's exact binary representation. Other types, such as strings and arrays, remain unsupported. For details and the assembly-wide effects, see [Disabled runtime marshalling](../../../../standard/native-interop/disabled-marshalling.md). +- **Replace non-blittable types with blittable equivalents.** For example, use `byte` for a one-byte Boolean value, `int` for a four-byte Boolean value, or `ushort` for a two-byte character value, according to the native signature. Convert values explicitly inside the managed method, and update the native declaration if necessary. + +## Affected APIs + +- diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 56373122ab837..7206fa995d47a 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -94,6 +94,8 @@ items: href: globalization/11/japanese-calendar-min-date.md - name: Interop items: + - name: Native AOT rejects non-blittable UnmanagedCallersOnly signatures + href: interop/11/unmanagedcallersonly-non-blittable.md - name: NativeAOT uses lib prefix for native library outputs on Unix href: interop/11/nativeaot-lib-prefix.md - name: JIT compiler diff --git a/docs/core/deploying/native-aot/interop.md b/docs/core/deploying/native-aot/interop.md index 632a699a33e14..44af841fa39a9 100644 --- a/docs/core/deploying/native-aot/interop.md +++ b/docs/core/deploying/native-aot/interop.md @@ -4,6 +4,7 @@ description: Learn about native code interop with Native AOT. author: MichalStrehovsky ms.author: michals ms.date: 05/17/2023 +ai-usage: ai-assisted --- # Native code interop with Native AOT @@ -81,3 +82,5 @@ The Native AOT compiler exports methods annotated with if an unmanaged caller invokes such a method with a non-blittable signature, such as a `bool` return type or a `char` parameter. The exception causes the process to terminate (fail fast) and can't be caught to recover from the invalid signature. Use blittable equivalents or, for supported unmanaged types, [disable runtime marshalling](../../../standard/native-interop/disabled-marshalling.md) in the assembly that declares the method. For details, see [Native AOT rejects non-blittable UnmanagedCallersOnly signatures](../../compatibility/interop/11/unmanagedcallersonly-non-blittable.md). From ac3fa30c9d65bdf7f584394a950e4e9d2f9a827e Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 22 Oct 2026 17:31:39 -0400 Subject: [PATCH 08/10] Small fix (#56488) Fixes #55433 From 04b6223dec54f39c1311c3299f9bfbbe5a9a224e Mon Sep 17 00:00:00 2001 From: "azure-sdk-automation[bot]" <191533747+azure-sdk-automation[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 10:08:17 -0400 Subject: [PATCH 09/10] Update package index with latest published versions (#56496) Co-authored-by: azure-sdk --- docs/azure/includes/dotnet-all.md | 54 +++++++++++++++++-------------- docs/azure/includes/dotnet-new.md | 13 +++++--- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/docs/azure/includes/dotnet-all.md b/docs/azure/includes/dotnet-all.md index dd6680d908966..739f3ab39dbd7 100644 --- a/docs/azure/includes/dotnet-all.md +++ b/docs/azure/includes/dotnet-all.md @@ -134,12 +134,12 @@ | Web PubSub Chat | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Messaging.WebPubSub.Chat/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Messaging.WebPubSub.Chat-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.WebPubSub.Chat_1.0.0-beta.1/sdk/webpubsub/Azure.Messaging.WebPubSub.Chat/) | | Web PubSub Client | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Messaging.WebPubSub.Client/1.0.0) | [docs](/dotnet/api/overview/azure/Messaging.WebPubSub.Client-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.WebPubSub.Client_1.0.0/sdk/webpubsub/Azure.Messaging.WebPubSub.Client/) | | Azure client library integration for ASP.NET Core | NuGet [1.14.1](https://www.nuget.org/packages/Microsoft.Extensions.Azure/1.14.1) | [docs](/dotnet/api/overview/azure/Microsoft.Extensions.Azure-readme) | GitHub [1.14.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Extensions.Azure_1.14.1/sdk/extensions/Microsoft.Extensions.Azure/) | -| Blob Storage Key Store for .NET Data Protection | NuGet [1.5.4](https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Blobs/1.5.4) | [docs](/dotnet/api/overview/azure/Extensions.AspNetCore.DataProtection.Blobs-readme) | GitHub [1.5.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Extensions.AspNetCore.DataProtection.Blobs_1.5.4/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/) | +| Blob Storage Key Store for .NET Data Protection | NuGet [1.5.5](https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Blobs/1.5.5) | [docs](/dotnet/api/overview/azure/Extensions.AspNetCore.DataProtection.Blobs-readme) | GitHub [1.5.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Extensions.AspNetCore.DataProtection.Blobs_1.5.5/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/) | | CloudNative CloudEvents with Event Grid | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents/1.0.0) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents_1.0.0/sdk/eventgrid/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents/) | | Core - Client - Spatial | NuGet [1.1.0](https://www.nuget.org/packages/Microsoft.Azure.Core.Spatial/1.1.0)
NuGet [1.2.0-beta.1](https://www.nuget.org/packages/Microsoft.Azure.Core.Spatial/1.2.0-beta.1) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.Core.Spatial-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Core.Spatial_1.1.0/sdk/core/Microsoft.Azure.Core.Spatial/)
GitHub [1.2.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Core.Spatial_1.2.0-beta.1/sdk/core/Microsoft.Azure.Core.Spatial/) | | Core - Client - Spatial Newtonsoft Json | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Core.Spatial.NewtonsoftJson/1.0.0)
NuGet [1.1.0-beta.1](https://www.nuget.org/packages/Microsoft.Azure.Core.Spatial.NewtonsoftJson/1.1.0-beta.1) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.Core.Spatial.NewtonsoftJson-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Core.Spatial.NewtonsoftJson_1.0.0/sdk/core/Microsoft.Azure.Core.Spatial.NewtonsoftJson/)
GitHub [1.1.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Core.Spatial.NewtonsoftJson_1.1.0-beta.1/sdk/core/Microsoft.Azure.Core.Spatial.NewtonsoftJson/) | | Functions extension for Azure Tables | NuGet [1.4.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Tables/1.4.0) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.Tables-readme) | GitHub [1.4.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.Tables_1.4.0/sdk/tables/Microsoft.Azure.WebJobs.Extensions.Tables/) | -| Key Encryptor for .NET Data Protection | NuGet [1.6.4](https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Keys/1.6.4) | [docs](/dotnet/api/overview/azure/Extensions.AspNetCore.DataProtection.Keys-readme) | GitHub [1.6.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Extensions.AspNetCore.DataProtection.Keys_1.6.4/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/) | +| Key Encryptor for .NET Data Protection | NuGet [1.6.5](https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Keys/1.6.5) | [docs](/dotnet/api/overview/azure/Extensions.AspNetCore.DataProtection.Keys-readme) | GitHub [1.6.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Extensions.AspNetCore.DataProtection.Keys_1.6.5/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/) | | Secrets Configuration Provider for .NET | NuGet [1.5.2](https://www.nuget.org/packages/Azure.Extensions.AspNetCore.Configuration.Secrets/1.5.2) | [docs](/dotnet/api/overview/azure/Extensions.AspNetCore.Configuration.Secrets-readme) | GitHub [1.5.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Extensions.AspNetCore.Configuration.Secrets_1.5.2/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/) | | Storage - Common | NuGet [12.29.0](https://www.nuget.org/packages/Azure.Storage.Common/12.29.0) | [docs](/dotnet/api/overview/azure/Storage.Common-readme) | GitHub [12.29.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Storage.Common_12.29.0/sdk/storage/Azure.Storage.Common/) | | WebJobs Extensions - Event Grid | NuGet [3.5.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.EventGrid/3.5.0) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.EventGrid-readme) | GitHub [3.5.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.EventGrid_3.5.0/sdk/eventgrid/Microsoft.Azure.WebJobs.Extensions.EventGrid/) | @@ -201,7 +201,7 @@ | Provisioning - Redis | NuGet [1.1.0](https://www.nuget.org/packages/Azure.Provisioning.Redis/1.1.0) | [docs](/dotnet/api/overview/azure/Provisioning.Redis-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Redis_1.1.0/sdk/provisioning/Azure.Provisioning.Redis/) | | Provisioning - Redis Enterprise | NuGet [1.1.0](https://www.nuget.org/packages/Azure.Provisioning.RedisEnterprise/1.1.0) | [docs](/dotnet/api/overview/azure/Provisioning.RedisEnterprise-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.RedisEnterprise_1.1.0/sdk/provisioning/Azure.Provisioning.RedisEnterprise/) | | Provisioning - Resource Graph | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.ResourceGraph/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.ResourceGraph-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.ResourceGraph_1.0.0-beta.1/sdk/resourcegraph/Azure.Provisioning.ResourceGraph/) | -| Provisioning - Resourcehealth | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.ResourceHealth/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.ResourceHealth-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.ResourceHealth_1.0.0-beta.1/sdk/resourcehealth/Azure.Provisioning.ResourceHealth/) | +| Provisioning - Resource Health | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.ResourceHealth/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.ResourceHealth-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.ResourceHealth_1.0.0-beta.1/sdk/resourcehealth/Azure.Provisioning.ResourceHealth/) | | Provisioning - Search | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Provisioning.Search/1.0.0)
NuGet [1.1.0-beta.2](https://www.nuget.org/packages/Azure.Provisioning.Search/1.1.0-beta.2) | [docs](/dotnet/api/overview/azure/Provisioning.Search-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Search_1.0.0/sdk/search/Azure.Provisioning.Search/)
GitHub [1.1.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Search_1.1.0-beta.2/sdk/search/Azure.Provisioning.Search/) | | Provisioning - Security Center | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.SecurityCenter/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.SecurityCenter-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.SecurityCenter_1.0.0-beta.1/sdk/securitycenter/Azure.Provisioning.SecurityCenter/) | | Provisioning - Service Bus | NuGet [1.1.0](https://www.nuget.org/packages/Azure.Provisioning.ServiceBus/1.1.0)
NuGet [1.2.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.ServiceBus/1.2.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.ServiceBus-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.ServiceBus_1.1.0/sdk/servicebus/Azure.Provisioning.ServiceBus/)
GitHub [1.2.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.ServiceBus_1.2.0-beta.1/sdk/servicebus/Azure.Provisioning.ServiceBus/) | @@ -266,7 +266,7 @@ | Resource Management - Container Orchestrator Runtime | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.ResourceManager.ContainerOrchestratorRuntime/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerOrchestratorRuntime-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerOrchestratorRuntime_1.0.0-beta.2/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/) | | Resource Management - Container Registry | NuGet [1.4.0](https://www.nuget.org/packages/Azure.ResourceManager.ContainerRegistry/1.4.0)
NuGet [1.5.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.ContainerRegistry/1.5.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerRegistry-readme) | GitHub [1.4.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerRegistry_1.4.0/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/)
GitHub [1.5.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerRegistry_1.5.0-beta.4/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/) | | Resource Management - Container Registry Tasks | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.ContainerRegistry.Tasks/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerRegistry.Tasks-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerRegistry.Tasks_1.0.0-beta.1/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry.Tasks/) | -| Resource Management - Container Service | NuGet [1.8.0](https://www.nuget.org/packages/Azure.ResourceManager.ContainerService/1.8.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerService-readme) | GitHub [1.8.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerService_1.8.0/sdk/containerservice/Azure.ResourceManager.ContainerService/) | +| Resource Management - Container Service | NuGet [1.9.0](https://www.nuget.org/packages/Azure.ResourceManager.ContainerService/1.9.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerService-readme) | GitHub [1.9.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerService_1.9.0/sdk/containerservice/Azure.ResourceManager.ContainerService/) | | Resource Management - Container Service Fleet | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.ContainerServiceFleet/1.1.0)
NuGet [1.3.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.ContainerServiceFleet/1.3.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerServiceFleet-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerServiceFleet_1.1.0/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/)
GitHub [1.3.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerServiceFleet_1.3.0-beta.1/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/) | | Resource Management - Containerserviceaimanager | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.ContainerServiceAIManager/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerServiceAIManager-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerServiceAIManager_1.0.0-beta.1/sdk/aimanager/Azure.ResourceManager.ContainerServiceAIManager/) | | Resource Management - Containerservicepreparedimgspec | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.ContainerServicePreparedImgSpec/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerServicePreparedImgSpec-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerServicePreparedImgSpec_1.0.0-beta.1/sdk/containerservicepreparedimgspec/Azure.ResourceManager.ContainerServicePreparedImgSpec/) | @@ -354,7 +354,7 @@ | Resource Management - Logic Apps | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.Logic/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.Logic-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Logic_1.2.0/sdk/logic/Azure.ResourceManager.Logic/) | | Resource Management - Machine Learning | NuGet [1.3.0](https://www.nuget.org/packages/Azure.ResourceManager.MachineLearning/1.3.0) | [docs](/dotnet/api/overview/azure/ResourceManager.MachineLearning-readme) | GitHub [1.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.MachineLearning_1.3.0/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/) | | Resource Management - Machine Learning Compute | NuGet [1.0.0-beta.6](https://www.nuget.org/packages/Azure.ResourceManager.MachineLearningCompute/1.0.0-beta.6) | [docs](/dotnet/api/overview/azure/ResourceManager.MachineLearningCompute-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.6](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.MachineLearningCompute_1.0.0-beta.6/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/) | -| Resource Management - Maintenance | NuGet [1.1.3](https://www.nuget.org/packages/Azure.ResourceManager.Maintenance/1.1.3)
NuGet [1.2.0-beta.11](https://www.nuget.org/packages/Azure.ResourceManager.Maintenance/1.2.0-beta.11) | [docs](/dotnet/api/overview/azure/ResourceManager.Maintenance-readme) | GitHub [1.1.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Maintenance_1.1.3/sdk/maintenance/Azure.ResourceManager.Maintenance/)
GitHub [1.2.0-beta.11](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Maintenance_1.2.0-beta.11/sdk/maintenance/Azure.ResourceManager.Maintenance/) | +| Resource Management - Maintenance | NuGet [1.1.3](https://www.nuget.org/packages/Azure.ResourceManager.Maintenance/1.1.3)
NuGet [1.2.0-beta.12](https://www.nuget.org/packages/Azure.ResourceManager.Maintenance/1.2.0-beta.12) | [docs](/dotnet/api/overview/azure/ResourceManager.Maintenance-readme) | GitHub [1.1.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Maintenance_1.1.3/sdk/maintenance/Azure.ResourceManager.Maintenance/)
GitHub [1.2.0-beta.12](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Maintenance_1.2.0-beta.12/sdk/maintenance/Azure.ResourceManager.Maintenance/) | | Resource Management - Managed Grafana | NuGet [1.1.1](https://www.nuget.org/packages/Azure.ResourceManager.Grafana/1.1.1)
NuGet [1.2.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.Grafana/1.2.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.Grafana-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Grafana_1.1.1/sdk/grafana/Azure.ResourceManager.Grafana/)
GitHub [1.2.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Grafana_1.2.0-beta.4/sdk/grafana/Azure.ResourceManager.Grafana/) | | Resource Management - Managed Network | NuGet [1.0.0-beta.6](https://www.nuget.org/packages/Azure.ResourceManager.ManagedNetwork/1.0.0-beta.6) | [docs](/dotnet/api/overview/azure/ResourceManager.ManagedNetwork-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.6](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ManagedNetwork_1.0.0-beta.6/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/) | | Resource Management - Managed Network Fabric | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.ManagedNetworkFabric/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ManagedNetworkFabric-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ManagedNetworkFabric_1.2.0/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/) | @@ -468,23 +468,26 @@ | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.CertificateRegistration/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.CertificateRegistration-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.CertificateRegistration_1.0.0-beta.1/sdk/certificateregistration/Azure.Provisioning.CertificateRegistration/) | | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.Databricks/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.Databricks-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Databricks_1.0.0-beta.1/sdk/databricks/Azure.Provisioning.Databricks/) | | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.Fabric/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.Fabric-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Fabric_1.0.0-beta.1/sdk/fabric/Azure.Provisioning.Fabric/) | +| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.HealthBot/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.HealthBot_1.0.0-beta.1/sdk/healthbot/Azure.Provisioning.HealthBot/) | +| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.SerialConsole/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.SerialConsole_1.0.0-beta.1/sdk/serialconsole/Azure.Provisioning.SerialConsole/) | +| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.SiteManager/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.SiteManager_1.0.0-beta.1/sdk/sitemanager/Azure.Provisioning.SiteManager/) | | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.Sphere/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Sphere_1.0.0-beta.1/sdk/sphere/Azure.Provisioning.Sphere/) | | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.VerifiedId/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.VerifiedId-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.VerifiedId_1.0.0-beta.1/sdk/verifiedid/Azure.Provisioning.VerifiedId/) | | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.Compute.WorkloadManager/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Compute.WorkloadManager_1.0.0-beta.1/sdk/compute/Azure.ResourceManager.Compute.WorkloadManager/) | | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.PlatformValidation/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.PlatformValidation-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.PlatformValidation_1.0.0-beta.1/sdk/platformvalidation/Azure.ResourceManager.PlatformValidation/) | | .NET Function Templates | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Templates.DotNet/1.0.1) | | | -| .NET Stack | NuGet [1.0.0-preview.1](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.DotNet/1.0.0-preview.1) | | | +| .NET Stack | NuGet [1.0.0-preview.2](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.DotNet/1.0.0-preview.2) | | | | App Configuration Extension | NuGet [8.6.0](https://www.nuget.org/packages/Microsoft.Azure.AppConfiguration.Functions.Worker/8.6.0)
NuGet [8.7.0-preview](https://www.nuget.org/packages/Microsoft.Azure.AppConfiguration.Functions.Worker/8.7.0-preview) | | | | App Configuration Provider | NuGet [8.6.0](https://www.nuget.org/packages/Microsoft.Azure.AppConfiguration.AspNetCore/8.6.0)
NuGet [8.7.0-preview](https://www.nuget.org/packages/Microsoft.Azure.AppConfiguration.AspNetCore/8.7.0-preview) | | | | Azure Functions CLI | NuGet [5.0.0-preview.1](https://www.nuget.org/packages/Azure.Functions.Cli.Abstractions/5.0.0-preview.1) | | | | Azure Functions SDK | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Functions.Sdk/1.0.1) | | | -| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp/1.0.0)
NuGet [4.0.0-beta.1](https://www.nuget.org/packages/Azure.Mcp/4.0.0-beta.1) | | | -| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp.linux-arm64/1.0.0)
NuGet [4.0.0-beta.1](https://www.nuget.org/packages/Azure.Mcp.linux-arm64/4.0.0-beta.1) | | | -| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp.linux-x64/1.0.0)
NuGet [4.0.0-beta.1](https://www.nuget.org/packages/Azure.Mcp.linux-x64/4.0.0-beta.1) | | | -| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp.osx-arm64/1.0.0)
NuGet [4.0.0-beta.1](https://www.nuget.org/packages/Azure.Mcp.osx-arm64/4.0.0-beta.1) | | | -| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp.osx-x64/1.0.0)
NuGet [4.0.0-beta.1](https://www.nuget.org/packages/Azure.Mcp.osx-x64/4.0.0-beta.1) | | | -| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp.win-arm64/1.0.0)
NuGet [4.0.0-beta.1](https://www.nuget.org/packages/Azure.Mcp.win-arm64/4.0.0-beta.1) | | | -| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp.win-x64/1.0.0)
NuGet [4.0.0-beta.1](https://www.nuget.org/packages/Azure.Mcp.win-x64/4.0.0-beta.1) | | | +| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp/1.0.0)
NuGet [4.0.0-beta.2](https://www.nuget.org/packages/Azure.Mcp/4.0.0-beta.2) | | | +| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp.linux-arm64/1.0.0)
NuGet [4.0.0-beta.2](https://www.nuget.org/packages/Azure.Mcp.linux-arm64/4.0.0-beta.2) | | | +| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp.linux-x64/1.0.0)
NuGet [4.0.0-beta.2](https://www.nuget.org/packages/Azure.Mcp.linux-x64/4.0.0-beta.2) | | | +| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp.osx-arm64/1.0.0)
NuGet [4.0.0-beta.2](https://www.nuget.org/packages/Azure.Mcp.osx-arm64/4.0.0-beta.2) | | | +| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp.osx-x64/1.0.0)
NuGet [4.0.0-beta.2](https://www.nuget.org/packages/Azure.Mcp.osx-x64/4.0.0-beta.2) | | | +| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp.win-arm64/1.0.0)
NuGet [4.0.0-beta.2](https://www.nuget.org/packages/Azure.Mcp.win-arm64/4.0.0-beta.2) | | | +| Azure MCP | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Mcp.win-x64/1.0.0)
NuGet [4.0.0-beta.2](https://www.nuget.org/packages/Azure.Mcp.win-x64/4.0.0-beta.2) | | | | Azure MCP Types Internal | NuGet [0.2.804](https://www.nuget.org/packages/Microsoft.Azure.Mcp.AzTypes.Internal.Compact/0.2.804) | | | | Azure.Communication.Administration | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Communication.Administration/1.0.0-beta.3) | | | | Caching - PostgreSQL | NuGet [1.2.2](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Postgres/1.2.2) | | | @@ -516,7 +519,7 @@ | Functions Worker Extension MCP | NuGet [1.6.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Mcp/1.6.0) | | | | Functions Worker Extension MCP SDK | NuGet [1.0.0-preview.4](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Mcp.Sdk/1.0.0-preview.4) | | | | Functions Worker Extension MySQL | NuGet [1.0.131](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.MySql/1.0.131) | | | -| Go Stack | NuGet [1.0.0-preview.1](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Go/1.0.0-preview.1) | | | +| Go Stack | NuGet [1.0.0-preview.2](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Go/1.0.0-preview.2) | | | | Go Worker | NuGet [1.0.0-preview.1](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Workers.Go/1.0.0-preview.1) | | | | HTTP ASPNETCore Analyzers | NuGet [1.0.4](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.Analyzers/1.0.4) | | | | IoT Operations Connector | NuGet [1.2.0](https://www.nuget.org/packages/Azure.Iot.Operations.Connector/1.2.0)
NuGet [1.3.0-beta](https://www.nuget.org/packages/Azure.Iot.Operations.Connector/1.3.0-beta) | | | @@ -543,29 +546,30 @@ | Microsoft.Azure.DataFactoryTestingFramework.Expressions | NuGet [0.2.7](https://www.nuget.org/packages/Microsoft.Azure.DataFactoryTestingFramework.Expressions/0.2.7) | | | | Microsoft.Azure.Functions.Worker.OpenTelemetry | NuGet [1.2.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.OpenTelemetry/1.2.0) | | | | Node.js Function Templates | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Templates.Node/1.0.1) | | | -| Node.js Stack | NuGet [1.0.0-preview.1](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Node/1.0.0-preview.1) | | | +| Node.js Stack | NuGet [1.0.0-preview.2](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Node/1.0.0-preview.2) | | | | Node.js Worker | NuGet [3.13.0-preview.1](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Workers.Node/3.13.0-preview.1) | | | | OpenTelemetry Profiler | NuGet [1.0.1-beta.7](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.Profiler/1.0.1-beta.7) | | | | Python Function Templates | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Templates.Python/1.0.1) | | | -| Python Stack | NuGet [1.0.0-preview.1](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Python/1.0.0-preview.1) | | | +| Python Stack | NuGet [1.0.0-preview.2](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Python/1.0.0-preview.2) | | | | Python Worker | NuGet [4.43.0-preview.3](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Workers.Python.linux-arm64/4.43.0-preview.3) | | | | Python Worker | NuGet [4.43.0-preview.3](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Workers.Python.linux-x64/4.43.0-preview.3) | | | | Python Worker | NuGet [4.43.0-preview.3](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Workers.Python.osx-arm64/4.43.0-preview.3) | | | | Python Worker | NuGet [4.43.0-preview.3](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Workers.Python.osx-x64/4.43.0-preview.3) | | | | Python Worker | NuGet [4.43.0-preview.3](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Workers.Python.win-x64/4.43.0-preview.3) | | | -| Speech CLI | NuGet [1.52.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.CLI/1.52.0) | | | -| Speech Extension Embedded SR | NuGet [1.52.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.Embedded.SR/1.52.0) | | | -| Speech Extension Embedded TTS | NuGet [1.52.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.Embedded.TTS/1.52.0) | | | -| Speech Extension MAS | NuGet [1.52.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.MAS/1.52.0) | | | +| Speech CLI | NuGet [1.53.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.CLI/1.53.0) | | | +| Speech Extension Embedded SR | NuGet [1.53.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.Embedded.SR/1.53.0) | | | +| Speech Extension Embedded TTS | NuGet [1.53.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.Embedded.TTS/1.53.0) | | | +| Speech Extension MAS | NuGet [1.53.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.MAS/1.53.0) | | | | Speech Extension ONNX Runtime | NuGet [1.52.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.ONNX.Runtime/1.52.0) | | | | Speech Extension Telemetry | NuGet [1.52.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.Telemetry/1.52.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 | NuGet [4.1048.200-preview.3](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Host/4.1048.200-preview.3) | | | | unknown | NuGet [1.0.0-preview.1](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Java/1.0.0-preview.1) | | | -| unknown | NuGet [1.0.0-preview.1](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.PowerShell/1.0.0-preview.1) | | | +| unknown | NuGet [1.0.0-preview.2](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.PowerShell/1.0.0-preview.2) | | | | unknown | NuGet [2.19.4-preview.1](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Workers.Java/2.19.4-preview.1) | | | | unknown | NuGet [4.0.4778-preview.1](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Workers.PowerShell/4.0.4778-preview.1) | | | | unknown | NuGet [4.43.0-preview.3](https://www.nuget.org/packages/Azure.Functions.Cli.Workloads.Workers.Python/4.43.0-preview.3) | | | +| unknown | NuGet [1.0.5](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.ServiceInterop/1.0.5) | | | | unknown | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Connector/1.0.0) | | | | unknown | NuGet [2.0.0-preview3](https://www.nuget.org/packages/Microsoft.Azure.Iot.Device/2.0.0-preview3) | | | | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Microsoft.Azure.WebPubSub.Emulator/1.0.0-beta.1) | | | @@ -631,7 +635,7 @@ | Search - Common | NuGet [10.1.0](https://www.nuget.org/packages/Microsoft.Azure.Search.Common/10.1.0) | | GitHub [10.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Search.Common_10.1.0/sdk/search/Microsoft.Azure.Search.Common/) | | Search - Data | NuGet [10.1.0](https://www.nuget.org/packages/Microsoft.Azure.Search.Data/10.1.0) | | GitHub [10.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Search.Data_10.1.0/sdk/search/Microsoft.Azure.Search.Data/) | | Search - Service | NuGet [10.1.0](https://www.nuget.org/packages/Microsoft.Azure.Search.Service/10.1.0) | | GitHub [10.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Search.Service_10.1.0/sdk/search/Microsoft.Azure.Search.Service/) | -| Speech | NuGet [1.52.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech/1.52.0)
NuGet [1.47.0-beta.0.357883](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech/1.47.0-beta.0.357883) | | | +| Speech | NuGet [1.53.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech/1.53.0)
NuGet [1.47.0-beta.0.357883](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech/1.47.0-beta.0.357883) | | | | Speech Remote Conversation | NuGet [1.52.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Remoteconversation/1.52.0) | | | | Speech Xamarin iOS | NuGet [1.25.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Xamarin.iOS/1.25.0) | | | | Spell Check | NuGet [4.1.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Language.SpellCheck/4.1.0-preview.1) | | GitHub [4.1.0-preview.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Language.SpellCheck_4.1.0-preview.1/sdk/cognitiveservices/Language.SpellCheck) | @@ -654,8 +658,8 @@ | Functions extension for Azure SQL and SQL Server | NuGet [3.1.536](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Sql/3.1.536) | | | | Functions extension for Cosmos DB | NuGet [4.16.1](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.CosmosDB/4.16.1) | | GitHub [4.16.1](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.15.2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/3.15.2) | [docs](/dotnet/api/overview/azure/functions) | GitHub [3.15.2](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.19.2](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask/1.19.2) | | | +| Functions extension for Durable Task Framework | NuGet [3.16.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/3.16.0) | [docs](/dotnet/api/overview/azure/functions) | GitHub [3.16.0](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.20.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask/1.20.0) | | | | Functions extension for HTTP | NuGet [3.3.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Http/3.3.0) | | GitHub [3.3.0](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/v3.0.2/src/WebJobs.Extensions.Http) | | Functions extension for IoT Edge | NuGet [1.0.7](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.EdgeHub/1.0.7) | | GitHub [1.0.7](https://github.com/Azure/iotedge/tree/1.0.7/edge-hub) | | Functions extension for Kafka | NuGet [4.3.3](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Kafka/4.3.3) | | GitHub [4.3.3](https://github.com/Azure/azure-functions-kafka-extension/tree/3.0.0/src/Microsoft.Azure.WebJobs.Extensions.Kafka) | @@ -725,7 +729,7 @@ | SignalR - ASP.NET | NuGet [1.33.1](https://www.nuget.org/packages/Microsoft.Azure.SignalR.AspNet/1.33.1) | | GitHub [1.33.1](https://github.com/Azure/azure-signalr/tree/v1.5.0/src/Microsoft.Azure.SignalR.AspNet) | | SignalR - Benchmark | NuGet [1.0.0-preview1-10415](https://www.nuget.org/packages/Microsoft.Azure.SignalR.Benchmark/1.0.0-preview1-10415) | | GitHub [1.0.0-preview1-10415](https://github.com/azure/azure-signalr-bench) | | SignalR - Protocols | NuGet [1.33.1](https://www.nuget.org/packages/Microsoft.Azure.SignalR.Protocols/1.33.1) | | GitHub [1.33.1](https://github.com/Azure/azure-signalr/tree/v1.5.0/src/Microsoft.Azure.SignalR.Protocols) | -| SignalR - Serverless Protocols | NuGet [1.11.0](https://www.nuget.org/packages/Microsoft.Azure.SignalR.Serverless.Protocols/1.11.0) | | GitHub [1.11.0](https://github.com/Azure/azure-functions-signalrservice-extension/tree/v1.2.0/src/Microsoft.Azure.SignalR.Serverless.Protocols) | +| SignalR - Serverless Protocols | NuGet [1.11.1](https://www.nuget.org/packages/Microsoft.Azure.SignalR.Serverless.Protocols/1.11.1) | | GitHub [1.11.1](https://github.com/Azure/azure-functions-signalrservice-extension/tree/v1.2.0/src/Microsoft.Azure.SignalR.Serverless.Protocols) | | SignalR Management | NuGet [1.33.1](https://www.nuget.org/packages/Microsoft.Azure.SignalR.Management/1.33.1) | | GitHub [1.33.1](https://github.com/Azure/azure-signalr/tree/v1.5.0/src/Microsoft.Azure.SignalR.Management) | | SQL Database Elastic Scale Client | NuGet [2.4.2](https://www.nuget.org/packages/Microsoft.Azure.SqlDatabase.ElasticScale.Client/2.4.2) | | GitHub [2.4.2](https://github.com/Azure/elastic-db-tools/tree/v2.3.0/Src/ElasticScale.Client) | | SQL Database Elastic Scale Service SplitMerge | NuGet [1.2.0](https://www.nuget.org/packages/Microsoft.Azure.SqlDatabase.ElasticScale.Service.SplitMerge/1.2.0) | | | diff --git a/docs/azure/includes/dotnet-new.md b/docs/azure/includes/dotnet-new.md index aca168f809dcb..b71ead0007ad8 100644 --- a/docs/azure/includes/dotnet-new.md +++ b/docs/azure/includes/dotnet-new.md @@ -149,12 +149,12 @@ | Web PubSub Chat | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Messaging.WebPubSub.Chat/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Messaging.WebPubSub.Chat-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.WebPubSub.Chat_1.0.0-beta.1/sdk/webpubsub/Azure.Messaging.WebPubSub.Chat/) | | Web PubSub Client | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Messaging.WebPubSub.Client/1.0.0) | [docs](/dotnet/api/overview/azure/Messaging.WebPubSub.Client-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.WebPubSub.Client_1.0.0/sdk/webpubsub/Azure.Messaging.WebPubSub.Client/) | | Azure client library integration for ASP.NET Core | NuGet [1.14.1](https://www.nuget.org/packages/Microsoft.Extensions.Azure/1.14.1) | [docs](/dotnet/api/overview/azure/Microsoft.Extensions.Azure-readme) | GitHub [1.14.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Extensions.Azure_1.14.1/sdk/extensions/Microsoft.Extensions.Azure/) | -| Blob Storage Key Store for .NET Data Protection | NuGet [1.5.4](https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Blobs/1.5.4) | [docs](/dotnet/api/overview/azure/Extensions.AspNetCore.DataProtection.Blobs-readme) | GitHub [1.5.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Extensions.AspNetCore.DataProtection.Blobs_1.5.4/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/) | +| Blob Storage Key Store for .NET Data Protection | NuGet [1.5.5](https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Blobs/1.5.5) | [docs](/dotnet/api/overview/azure/Extensions.AspNetCore.DataProtection.Blobs-readme) | GitHub [1.5.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Extensions.AspNetCore.DataProtection.Blobs_1.5.5/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/) | | CloudNative CloudEvents with Event Grid | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents/1.0.0) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents_1.0.0/sdk/eventgrid/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents/) | | Core - Client - Spatial | NuGet [1.1.0](https://www.nuget.org/packages/Microsoft.Azure.Core.Spatial/1.1.0)
NuGet [1.2.0-beta.1](https://www.nuget.org/packages/Microsoft.Azure.Core.Spatial/1.2.0-beta.1) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.Core.Spatial-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Core.Spatial_1.1.0/sdk/core/Microsoft.Azure.Core.Spatial/)
GitHub [1.2.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Core.Spatial_1.2.0-beta.1/sdk/core/Microsoft.Azure.Core.Spatial/) | | Core - Client - Spatial Newtonsoft Json | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Core.Spatial.NewtonsoftJson/1.0.0)
NuGet [1.1.0-beta.1](https://www.nuget.org/packages/Microsoft.Azure.Core.Spatial.NewtonsoftJson/1.1.0-beta.1) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.Core.Spatial.NewtonsoftJson-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Core.Spatial.NewtonsoftJson_1.0.0/sdk/core/Microsoft.Azure.Core.Spatial.NewtonsoftJson/)
GitHub [1.1.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Core.Spatial.NewtonsoftJson_1.1.0-beta.1/sdk/core/Microsoft.Azure.Core.Spatial.NewtonsoftJson/) | | Functions extension for Azure Tables | NuGet [1.4.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Tables/1.4.0) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.Tables-readme) | GitHub [1.4.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.Tables_1.4.0/sdk/tables/Microsoft.Azure.WebJobs.Extensions.Tables/) | -| Key Encryptor for .NET Data Protection | NuGet [1.6.4](https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Keys/1.6.4) | [docs](/dotnet/api/overview/azure/Extensions.AspNetCore.DataProtection.Keys-readme) | GitHub [1.6.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Extensions.AspNetCore.DataProtection.Keys_1.6.4/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/) | +| Key Encryptor for .NET Data Protection | NuGet [1.6.5](https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Keys/1.6.5) | [docs](/dotnet/api/overview/azure/Extensions.AspNetCore.DataProtection.Keys-readme) | GitHub [1.6.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Extensions.AspNetCore.DataProtection.Keys_1.6.5/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/) | | Secrets Configuration Provider for .NET | NuGet [1.5.2](https://www.nuget.org/packages/Azure.Extensions.AspNetCore.Configuration.Secrets/1.5.2) | [docs](/dotnet/api/overview/azure/Extensions.AspNetCore.Configuration.Secrets-readme) | GitHub [1.5.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Extensions.AspNetCore.Configuration.Secrets_1.5.2/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/) | | Storage - Common | NuGet [12.29.0](https://www.nuget.org/packages/Azure.Storage.Common/12.29.0) | [docs](/dotnet/api/overview/azure/Storage.Common-readme) | GitHub [12.29.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Storage.Common_12.29.0/sdk/storage/Azure.Storage.Common/) | | WebJobs Extensions - Event Grid | NuGet [3.5.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.EventGrid/3.5.0) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.EventGrid-readme) | GitHub [3.5.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.EventGrid_3.5.0/sdk/eventgrid/Microsoft.Azure.WebJobs.Extensions.EventGrid/) | @@ -216,7 +216,7 @@ | Provisioning - Redis | NuGet [1.1.0](https://www.nuget.org/packages/Azure.Provisioning.Redis/1.1.0) | [docs](/dotnet/api/overview/azure/Provisioning.Redis-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Redis_1.1.0/sdk/provisioning/Azure.Provisioning.Redis/) | | Provisioning - Redis Enterprise | NuGet [1.1.0](https://www.nuget.org/packages/Azure.Provisioning.RedisEnterprise/1.1.0) | [docs](/dotnet/api/overview/azure/Provisioning.RedisEnterprise-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.RedisEnterprise_1.1.0/sdk/provisioning/Azure.Provisioning.RedisEnterprise/) | | Provisioning - Resource Graph | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.ResourceGraph/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.ResourceGraph-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.ResourceGraph_1.0.0-beta.1/sdk/resourcegraph/Azure.Provisioning.ResourceGraph/) | -| Provisioning - Resourcehealth | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.ResourceHealth/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.ResourceHealth-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.ResourceHealth_1.0.0-beta.1/sdk/resourcehealth/Azure.Provisioning.ResourceHealth/) | +| Provisioning - Resource Health | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.ResourceHealth/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.ResourceHealth-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.ResourceHealth_1.0.0-beta.1/sdk/resourcehealth/Azure.Provisioning.ResourceHealth/) | | Provisioning - Resources | NuGet [0.2.0](https://www.nuget.org/packages/Azure.Provisioning.Resources/0.2.0) | | GitHub [0.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Resources_0.2.0/sdk/provisioning/Azure.Provisioning.Resources/) | | Provisioning - Search | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Provisioning.Search/1.0.0)
NuGet [1.1.0-beta.2](https://www.nuget.org/packages/Azure.Provisioning.Search/1.1.0-beta.2) | [docs](/dotnet/api/overview/azure/Provisioning.Search-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Search_1.0.0/sdk/search/Azure.Provisioning.Search/)
GitHub [1.1.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Search_1.1.0-beta.2/sdk/search/Azure.Provisioning.Search/) | | Provisioning - Security Center | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.SecurityCenter/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.SecurityCenter-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.SecurityCenter_1.0.0-beta.1/sdk/securitycenter/Azure.Provisioning.SecurityCenter/) | @@ -285,7 +285,7 @@ | Resource Management - Container Orchestrator Runtime | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.ResourceManager.ContainerOrchestratorRuntime/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerOrchestratorRuntime-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerOrchestratorRuntime_1.0.0-beta.2/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/) | | Resource Management - Container Registry | NuGet [1.4.0](https://www.nuget.org/packages/Azure.ResourceManager.ContainerRegistry/1.4.0)
NuGet [1.5.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.ContainerRegistry/1.5.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerRegistry-readme) | GitHub [1.4.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerRegistry_1.4.0/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/)
GitHub [1.5.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerRegistry_1.5.0-beta.4/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/) | | Resource Management - Container Registry Tasks | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.ContainerRegistry.Tasks/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerRegistry.Tasks-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerRegistry.Tasks_1.0.0-beta.1/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry.Tasks/) | -| Resource Management - Container Service | NuGet [1.8.0](https://www.nuget.org/packages/Azure.ResourceManager.ContainerService/1.8.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerService-readme) | GitHub [1.8.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerService_1.8.0/sdk/containerservice/Azure.ResourceManager.ContainerService/) | +| Resource Management - Container Service | NuGet [1.9.0](https://www.nuget.org/packages/Azure.ResourceManager.ContainerService/1.9.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerService-readme) | GitHub [1.9.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerService_1.9.0/sdk/containerservice/Azure.ResourceManager.ContainerService/) | | Resource Management - Container Service Fleet | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.ContainerServiceFleet/1.1.0)
NuGet [1.3.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.ContainerServiceFleet/1.3.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerServiceFleet-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerServiceFleet_1.1.0/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/)
GitHub [1.3.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerServiceFleet_1.3.0-beta.1/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/) | | Resource Management - Containerserviceaimanager | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.ContainerServiceAIManager/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerServiceAIManager-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerServiceAIManager_1.0.0-beta.1/sdk/aimanager/Azure.ResourceManager.ContainerServiceAIManager/) | | Resource Management - Containerservicepreparedimgspec | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.ContainerServicePreparedImgSpec/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerServicePreparedImgSpec-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerServicePreparedImgSpec_1.0.0-beta.1/sdk/containerservicepreparedimgspec/Azure.ResourceManager.ContainerServicePreparedImgSpec/) | @@ -376,7 +376,7 @@ | Resource Management - Logic Apps | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.Logic/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.Logic-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Logic_1.2.0/sdk/logic/Azure.ResourceManager.Logic/) | | Resource Management - Machine Learning | NuGet [1.3.0](https://www.nuget.org/packages/Azure.ResourceManager.MachineLearning/1.3.0) | [docs](/dotnet/api/overview/azure/ResourceManager.MachineLearning-readme) | GitHub [1.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.MachineLearning_1.3.0/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/) | | Resource Management - Machine Learning Compute | NuGet [1.0.0-beta.6](https://www.nuget.org/packages/Azure.ResourceManager.MachineLearningCompute/1.0.0-beta.6) | [docs](/dotnet/api/overview/azure/ResourceManager.MachineLearningCompute-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.6](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.MachineLearningCompute_1.0.0-beta.6/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/) | -| Resource Management - Maintenance | NuGet [1.1.3](https://www.nuget.org/packages/Azure.ResourceManager.Maintenance/1.1.3)
NuGet [1.2.0-beta.11](https://www.nuget.org/packages/Azure.ResourceManager.Maintenance/1.2.0-beta.11) | [docs](/dotnet/api/overview/azure/ResourceManager.Maintenance-readme) | GitHub [1.1.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Maintenance_1.1.3/sdk/maintenance/Azure.ResourceManager.Maintenance/)
GitHub [1.2.0-beta.11](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Maintenance_1.2.0-beta.11/sdk/maintenance/Azure.ResourceManager.Maintenance/) | +| Resource Management - Maintenance | NuGet [1.1.3](https://www.nuget.org/packages/Azure.ResourceManager.Maintenance/1.1.3)
NuGet [1.2.0-beta.12](https://www.nuget.org/packages/Azure.ResourceManager.Maintenance/1.2.0-beta.12) | [docs](/dotnet/api/overview/azure/ResourceManager.Maintenance-readme) | GitHub [1.1.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Maintenance_1.1.3/sdk/maintenance/Azure.ResourceManager.Maintenance/)
GitHub [1.2.0-beta.12](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Maintenance_1.2.0-beta.12/sdk/maintenance/Azure.ResourceManager.Maintenance/) | | Resource Management - Managed Grafana | NuGet [1.1.1](https://www.nuget.org/packages/Azure.ResourceManager.Grafana/1.1.1)
NuGet [1.2.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.Grafana/1.2.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.Grafana-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Grafana_1.1.1/sdk/grafana/Azure.ResourceManager.Grafana/)
GitHub [1.2.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Grafana_1.2.0-beta.4/sdk/grafana/Azure.ResourceManager.Grafana/) | | Resource Management - Managed Network | NuGet [1.0.0-beta.6](https://www.nuget.org/packages/Azure.ResourceManager.ManagedNetwork/1.0.0-beta.6) | [docs](/dotnet/api/overview/azure/ResourceManager.ManagedNetwork-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.6](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ManagedNetwork_1.0.0-beta.6/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/) | | Resource Management - Managed Network Fabric | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.ManagedNetworkFabric/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ManagedNetworkFabric-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ManagedNetworkFabric_1.2.0/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/) | @@ -500,6 +500,9 @@ | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.CertificateRegistration/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.CertificateRegistration-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.CertificateRegistration_1.0.0-beta.1/sdk/certificateregistration/Azure.Provisioning.CertificateRegistration/) | | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.Databricks/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.Databricks-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Databricks_1.0.0-beta.1/sdk/databricks/Azure.Provisioning.Databricks/) | | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.Fabric/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.Fabric-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Fabric_1.0.0-beta.1/sdk/fabric/Azure.Provisioning.Fabric/) | +| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.HealthBot/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.HealthBot_1.0.0-beta.1/sdk/healthbot/Azure.Provisioning.HealthBot/) | +| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.SerialConsole/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.SerialConsole_1.0.0-beta.1/sdk/serialconsole/Azure.Provisioning.SerialConsole/) | +| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.SiteManager/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.SiteManager_1.0.0-beta.1/sdk/sitemanager/Azure.Provisioning.SiteManager/) | | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.Sphere/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Sphere_1.0.0-beta.1/sdk/sphere/Azure.Provisioning.Sphere/) | | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Provisioning.VerifiedId/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Provisioning.VerifiedId-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.VerifiedId_1.0.0-beta.1/sdk/verifiedid/Azure.Provisioning.VerifiedId/) | | unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.Compute.WorkloadManager/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Compute.WorkloadManager_1.0.0-beta.1/sdk/compute/Azure.ResourceManager.Compute.WorkloadManager/) | From 83a6f9f79c811bde91b6ad72e7c9a55faefc652f Mon Sep 17 00:00:00 2001 From: David Levy Date: Fri, 23 Oct 2026 09:15:27 -0500 Subject: [PATCH 10/10] docs: migrate the Dataflow database walkthrough to Microsoft.Data.SqlClient (#56458) * docs: migrate the Dataflow database walkthrough to Microsoft.Data.SqlClient Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: efb4365f-428e-4de1-8c2d-38fa3eefbe14 * docs: expand the Dataflow prerequisite include filename Fix the introduced OpenPublishing filename-incomplete suggestion without changing the shared include content or platform choices. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: efb4365f-428e-4de1-8c2d-38fa3eefbe14 --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: efb4365f-428e-4de1-8c2d-38fa3eefbe14 --- ...-batchedjoinblock-to-improve-efficiency.md | 24 ++- includes/create-sql-database.md | 36 ++++ .../cs/DataFlowBatch.csproj | 7 +- .../cs/dataflowbatchdatabase.cs | 155 +++++++---------- .../vb/Project.vbproj | 7 +- .../vb/dataflowbatchdatabase.vb | 163 ++++++++---------- 6 files changed, 192 insertions(+), 200 deletions(-) create mode 100644 includes/create-sql-database.md diff --git a/docs/standard/parallel-programming/walkthrough-using-batchblock-and-batchedjoinblock-to-improve-efficiency.md b/docs/standard/parallel-programming/walkthrough-using-batchblock-and-batchedjoinblock-to-improve-efficiency.md index 23d187acf330f..4c65c48df46cd 100644 --- a/docs/standard/parallel-programming/walkthrough-using-batchblock-and-batchedjoinblock-to-improve-efficiency.md +++ b/docs/standard/parallel-programming/walkthrough-using-batchblock-and-batchedjoinblock-to-improve-efficiency.md @@ -1,7 +1,8 @@ --- description: "Learn more about: Walkthrough: Using BatchBlock and BatchedJoinBlock to Improve Efficiency" title: "Walkthrough: Using BatchBlock and BatchedJoinBlock to Improve Efficiency" -ms.date: "03/30/2017" +ms.date: "10/19/2026" +ai-usage: ai-assisted dev_langs: - "csharp" - "vb" @@ -20,16 +21,23 @@ The TPL Dataflow Library provides the [!IMPORTANT] - > In some versions of Windows, you cannot connect to Northwind.sdf if Visual Studio is running in a non-administrator mode. To connect to Northwind.sdf, start Visual Studio or a Developer Command Prompt for Visual Studio in the **Run as administrator** mode. +[!INCLUDE [create-sql-database](../../../includes/create-sql-database.md)] + +Set the `SQL_CONNECTION_STRING` environment variable to a connection string for your development database. For example, use `Server=,;Database=;User ID=;Password=;Encrypt=true;TrustServerCertificate=false`. Set the actual secret in your local environment, not in source code. + +For a local development container with a self-signed certificate, use `TrustServerCertificate=true` only for that development connection. For production connections, use a trusted server certificate and keep certificate validation enabled. + +The example creates a uniquely named global temporary table in `tempdb`. An open connection keeps the table available to the worker connections. The program resets only its own table between demonstrations and drops it when the demonstration ends. You don't need Northwind or SQL Server Compact. ## Creating the Console Application 1. In Visual Studio, create a Visual C# or Visual Basic **Console Application** project. In this document, the project is named `DataflowBatchDatabase`. -1. Ensure that Form1.cs (Form1.vb for Visual Basic) contains the following `using` (`Imports` in Visual Basic) statements. +1. Target .NET 10 and install the [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) NuGet package. For Microsoft Entra ID authentication with Microsoft.Data.SqlClient 7 and later versions, also install [Microsoft.Data.SqlClient.Extensions.Azure](https://www.nuget.org/packages/Microsoft.Data.SqlClient.Extensions.Azure). The Dataflow APIs are included in .NET 10. + +1. Replace the generated code in Program.cs (Program.vb for Visual Basic) with the complete example, or follow the steps in this walkthrough to assemble it. Start with these `using` (`Imports` in Visual Basic) statements. [!code-csharp[TPLDataflow_BatchDatabase#1](../../../samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs#1)] [!code-vb[TPLDataflow_BatchDatabase#1](../../../samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/dataflowbatchdatabase.vb#1)] @@ -46,7 +54,7 @@ Add to the `Program` class the `Employee` class. [!code-csharp[TPLDataflow_BatchDatabase#3](../../../samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs#3)] [!code-vb[TPLDataflow_BatchDatabase#3](../../../samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/dataflowbatchdatabase.vb#3)] -The `Employee` class contains three properties, `EmployeeID`, `LastName`, and `FirstName`. These properties correspond to the `Employee ID`, `Last Name`, and `First Name` columns in the `Employees` table in the Northwind database. For this demonstration, the `Employee` class also defines the `Random` method, which creates an `Employee` object that has random values for its properties. +The `Employee` class contains three properties, `EmployeeID`, `LastName`, and `FirstName`. These properties correspond to the `Employee ID`, `Last Name`, and `First Name` columns in the temporary employee table. For this demonstration, the `Employee` class also defines the `Random` method, which creates an `Employee` object that has random values for its properties. ## Defining Employee Database Operations @@ -55,7 +63,7 @@ Add to the `Program` class the `InsertEmployees`, `GetEmployeeCount`, and `GetEm [!code-csharp[TPLDataflow_BatchDatabase#4](../../../samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs#4)] [!code-vb[TPLDataflow_BatchDatabase#4](../../../samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/dataflowbatchdatabase.vb#4)] -The `InsertEmployees` method adds new employee records to the database. The `GetEmployeeCount` method retrieves the number of entries in the `Employees` table. The `GetEmployeeID` method retrieves the identifier of the first employee that has the provided name. Each of these methods takes a connection string to the Northwind database. +The `InsertEmployees` method adds new employee records to the temporary table. The `GetEmployeeCount` method retrieves the number of entries in that table. The `GetEmployeeID` method retrieves the identifier of the first employee that has the provided name, or throws if no employee matches. Each method takes the connection string for your development database. ## Adding Employee Data to the Database Without Using Buffering @@ -88,6 +96,8 @@ This method prints information about random employees to the console. It creates The following example shows the complete code. The `Main` method compares the time that is required to perform batched database insertions versus the time to perform non-batched database insertions. It also demonstrates the use of buffered join to read employee data from the database and also report errors. +Both insertion demonstrations start with zero rows and finish with 256 rows. The final demonstration inserts 16 rows and performs 10 lookups. Each batch reuses one connection for its inserts; it still executes one command per employee. Elapsed times depend on your server and network and aren't a general performance guarantee. + [!code-csharp[TPLDataflow_BatchDatabase#100](../../../samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs#100)] [!code-vb[TPLDataflow_BatchDatabase#100](../../../samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/dataflowbatchdatabase.vb#100)] diff --git a/includes/create-sql-database.md b/includes/create-sql-database.md new file mode 100644 index 0000000000000..3aab92303024f --- /dev/null +++ b/includes/create-sql-database.md @@ -0,0 +1,36 @@ +--- +author: dlevy-msft-sql +ms.author: dlevy +ms.date: 09/14/2026 +ms.service: sql +ms.subservice: connectivity +ms.topic: include +--- + +### Create a SQL database + +Create or connect to a SQL database on one of the following platforms: + +### [Azure SQL Database](#tab/azure-sql) + +[Create a SQL database in minutes using the Azure portal](/azure/azure-sql/database/single-database-create-quickstart) + +### [SQL database in Fabric](#tab/fabric-sql) + +[Load AdventureWorks sample data in your SQL database in Microsoft Fabric](/fabric/database/sql/load-AdventureWorks-sample-data) + +### [Microsoft SQL Server](#tab/sql-server) + +[Install SQL Server from the Installation Wizard](/sql/database-engine/install-windows/install-sql-server-from-the-installation-wizard-setup) + +[AdventureWorks sample databases](/sql/samples/adventureworks-install-configure) + +### [SQL Server container](#tab/container) + +[Create a SQL Server container in Docker](/sql/linux/install-upgrade/quickstart-install-docker) + +[Create a SQL Server container with sqlcmd](/sql/tools/sqlcmd/quickstart-sqlcmd-create-container) + +[Create a SQL Server container with the MSSQL extension for VS Code](/sql/tools/visual-studio-code-extensions/mssql/mssql-local-container) + +--- diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/DataFlowBatch.csproj b/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/DataFlowBatch.csproj index a390f7ca7487f..9b0a1dd6b3425 100644 --- a/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/DataFlowBatch.csproj +++ b/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/DataFlowBatch.csproj @@ -1,12 +1,13 @@  - Library - net4.8 + Exe + net10.0 - + + diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs b/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs index e78d36f2659d8..7d2c3ec46094f 100644 --- a/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs +++ b/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs @@ -2,9 +2,8 @@ // using System; using System.Collections.Generic; -using System.Data.SqlClient; +using Microsoft.Data.SqlClient; using System.Diagnostics; -using System.IO; using System.Threading.Tasks.Dataflow; // @@ -24,20 +23,13 @@ class Program // TODO: Change this value to experiment with different batch sizes. static readonly int s_insertBatchSize = 96; - // The source database file. - // TODO: Change this value if Northwind.sdf is at a different location - // on your computer. - static readonly string s_sourceDatabase = @"C:\...\Northwind.sdf"; - - // TODO: Change this value if you require a different temporary location. - static readonly string s_scratchDatabase = @"C:\Temp\Northwind.sdf"; + static readonly string s_employeeTable = + "##DataflowEmployees_" + Guid.NewGuid().ToString("N"); //
// // Describes an employee. Each property maps to a - // column in the Employees table in the Northwind database. - // For brevity, the Employee class does not contain - // all columns from the Employees table. + // column in the sample employee table. class Employee { public int EmployeeID { get; set; } @@ -80,7 +72,7 @@ static void InsertEmployees(Employee[] employees, string connectionString) { // Create the SQL command. SqlCommand command = new SqlCommand( - "INSERT INTO Employees ([Last Name], [First Name])" + + $"INSERT INTO [{s_employeeTable}] ([Last Name], [First Name])" + "VALUES (@lastName, @firstName)", connection); @@ -103,8 +95,7 @@ static void InsertEmployees(Employee[] employees, string connectionString) } } - // Retrieves the number of entries in the Employees table in - // the Northwind database. + // Retrieves the number of entries in the sample employee table. static int GetEmployeeCount(string connectionString) { int result = 0; @@ -112,7 +103,7 @@ static int GetEmployeeCount(string connectionString) new SqlConnection(connectionString)) { SqlCommand sqlCommand = new SqlCommand( - "SELECT COUNT(*) FROM Employees", sqlConnection); + $"SELECT COUNT(*) FROM [{s_employeeTable}]", sqlConnection); sqlConnection.Open(); try @@ -135,8 +126,8 @@ static int GetEmployeeID(string lastName, string firstName, new SqlConnection(connectionString)) { SqlCommand command = new SqlCommand( - "SELECT [Employee ID] FROM Employees " + - "WHERE [Last Name] = @lastName AND [First Name] = @firstName", + $"SELECT TOP (1) [Employee ID] FROM [{s_employeeTable}] " + + "WHERE [Last Name] = @lastName AND [First Name] = @firstName ORDER BY [Employee ID]", connection); command.Parameters.Add("@lastName", System.Data.SqlDbType.NVarChar).Value = lastName; @@ -145,7 +136,10 @@ static int GetEmployeeID(string lastName, string firstName, connection.Open(); try { - return (int)command.ExecuteScalar(); + object result = command.ExecuteScalar(); + if (result == null) + throw new KeyNotFoundException("No matching employee."); + return (int)result; } finally { @@ -270,9 +264,9 @@ static void GetRandomEmployees(string connectionString, int batchSize, // the batched join block. selectEmployees.Target1.Post(e); } - catch (NullReferenceException e) + catch (KeyNotFoundException e) { - // GetEmployeeID throws NullReferenceException when there is + // GetEmployeeID throws KeyNotFoundException when there is // no such employee with the given name. When this happens, // post the Exception object to the Exception target of // the batched join block. @@ -292,79 +286,56 @@ static void GetRandomEmployees(string connectionString, int batchSize, static void Main() { - // Create a connection string for accessing the database. - // The connection string refers to the temporary database location. - string connectionString = "..."; - - // Create a Stopwatch object to time database insert operations. - Stopwatch stopwatch = new Stopwatch(); - - // Start with a clean database file by copying the source database to - // the temporary location. - File.Copy(s_sourceDatabase, s_scratchDatabase, true); - - // Demonstrate multiple insert operations without batching. - Console.WriteLine("Demonstrating non-batched database insert operations..."); - Console.WriteLine($"Original size of Employee table: {GetEmployeeCount(connectionString)}."); - stopwatch.Start(); - AddEmployees(connectionString, s_insertCount); - stopwatch.Stop(); - Console.WriteLine("New size of Employee table: {0}; elapsed insert time: {1} ms.", - GetEmployeeCount(connectionString), stopwatch.ElapsedMilliseconds); - - Console.WriteLine(); - - // Start again with a clean database file. - File.Copy(s_sourceDatabase, s_scratchDatabase, true); - - // Demonstrate multiple insert operations, this time with batching. - Console.WriteLine("Demonstrating batched database insert operations..."); - Console.WriteLine($"Original size of Employee table: {GetEmployeeCount(connectionString)}."); - stopwatch.Restart(); - AddEmployeesBatched(connectionString, s_insertBatchSize, s_insertCount); - stopwatch.Stop(); - Console.WriteLine("New size of Employee table: {0}; elapsed insert time: {1} ms.", - GetEmployeeCount(connectionString), stopwatch.ElapsedMilliseconds); - - Console.WriteLine(); - - // Start again with a clean database file. - File.Copy(s_sourceDatabase, s_scratchDatabase, true); - - // Demonstrate multiple retrieval operations with error reporting. - Console.WriteLine("Demonstrating batched join database select operations..."); - // Add a small number of employees to the database. - AddEmployeesBatched(connectionString, s_insertBatchSize, 16); - // Query for random employees. - GetRandomEmployees(connectionString, s_insertBatchSize, 10); + string connectionString = Environment.GetEnvironmentVariable("SQL_CONNECTION_STRING"); + if (string.IsNullOrWhiteSpace(connectionString)) + throw new InvalidOperationException("Set the SQL_CONNECTION_STRING environment variable."); + + // Keep the global temporary table alive while worker connections use it. + using var keeper = new SqlConnection(connectionString); + keeper.Open(); + using var setup = new SqlCommand( + $"CREATE TABLE [{s_employeeTable}] " + + "([Employee ID] int IDENTITY PRIMARY KEY, " + + "[Last Name] nvarchar(50) NOT NULL, [First Name] nvarchar(50) NOT NULL)", keeper); + setup.ExecuteNonQuery(); + + try + { + Stopwatch stopwatch = new Stopwatch(); + Console.WriteLine("Demonstrating non-batched database insert operations..."); + Console.WriteLine($"Original size of Employee table: {GetEmployeeCount(connectionString)}."); + stopwatch.Start(); + AddEmployees(connectionString, s_insertCount); + stopwatch.Stop(); + Console.WriteLine("New size of Employee table: {0}; elapsed insert time: {1} ms.", + GetEmployeeCount(connectionString), stopwatch.ElapsedMilliseconds); + Console.WriteLine(); + + using var reset = new SqlCommand($"TRUNCATE TABLE [{s_employeeTable}]", keeper); + reset.ExecuteNonQuery(); + + Console.WriteLine("Demonstrating batched database insert operations..."); + Console.WriteLine($"Original size of Employee table: {GetEmployeeCount(connectionString)}."); + stopwatch.Restart(); + AddEmployeesBatched(connectionString, s_insertBatchSize, s_insertCount); + stopwatch.Stop(); + Console.WriteLine("New size of Employee table: {0}; elapsed insert time: {1} ms.", + GetEmployeeCount(connectionString), stopwatch.ElapsedMilliseconds); + Console.WriteLine(); + + reset.ExecuteNonQuery(); + + Console.WriteLine("Demonstrating batched join database select operations..."); + AddEmployeesBatched(connectionString, s_insertBatchSize, 16); + GetRandomEmployees(connectionString, s_insertBatchSize, 10); + } + finally + { + using var cleanup = new SqlCommand($"DROP TABLE [{s_employeeTable}]", keeper); + cleanup.ExecuteNonQuery(); + } } } } -/* Sample output: -Demonstrating non-batched database insert operations... -Original size of Employee table: 15. -Adding 256 entries to Employee table... -New size of Employee table: 271; elapsed insert time: 11035 ms. - -Demonstrating batched database insert operations... -Original size of Employee table: 15. -Adding 256 entries to Employee table... -New size of Employee table: 271; elapsed insert time: 197 ms. - -Demonstrating batched join database insert operations... -Adding 16 entries to Employee table... -Selecting items from Employee table... -Received a batch... -Last=Jones First=Tom ID=21 -Last=Jones First=John ID=24 -Last=Smith First=Tom ID=26 -Last=Jones First=Tom ID=21 -There were 4 errors in this batch... -Received a batch... -Last=Smith First=Tom ID=26 -Last=Jones First=Mike ID=28 -There were 0 errors in this batch... -Finished. There were 4 total errors. -*/ // diff --git a/samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/Project.vbproj b/samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/Project.vbproj index 1fd8652dda90b..7dc10dec2a95e 100644 --- a/samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/Project.vbproj +++ b/samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/Project.vbproj @@ -1,12 +1,13 @@ - Library - net8.0 + Exe + net10.0 - + + diff --git a/samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/dataflowbatchdatabase.vb b/samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/dataflowbatchdatabase.vb index b849e45659b79..c21e3bbc7791b 100644 --- a/samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/dataflowbatchdatabase.vb +++ b/samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/dataflowbatchdatabase.vb @@ -1,8 +1,8 @@ ' ' Imports System.Data -Imports System.Data.SqlClient -Imports System.IO +Imports Microsoft.Data.SqlClient +Imports System.Collections.Generic Imports System.Threading.Tasks.Dataflow ' @@ -21,22 +21,13 @@ Namespace DataflowBatchDatabase ' TODO: Change this value to experiment with different batch sizes. Private Shared ReadOnly s_insertBatchSize As Integer = 96 - ' The source database file. - ' TODO: Change this value if Northwind.sdf is at a different location - ' on your computer. - Private Shared ReadOnly s_sourceDatabase As String = - "C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Samples\Northwind.sdf" - - ' TODO: Change this value if you require a different temporary location. - Private Shared ReadOnly s_scratchDatabase As String = - "C:\Temp\Northwind.sdf" + Private Shared ReadOnly s_employeeTable As String = + "##DataflowEmployees_" & Guid.NewGuid().ToString("N") '
' ' Describes an employee. Each property maps to a - ' column in the Employees table in the Northwind database. - ' For brevity, the Employee class does not contain - ' all columns from the Employees table. + ' column in the sample employee table. Private Class Employee Public Property EmployeeID() As Integer Public Property LastName() As String @@ -71,7 +62,7 @@ Namespace DataflowBatchDatabase Using connection As New SqlConnection(connectionString) Try ' Create the SQL command. - Dim command As New SqlCommand("INSERT INTO Employees ([Last Name], [First Name])" & "VALUES (@lastName, @firstName)", connection) + Dim command As New SqlCommand($"INSERT INTO [{s_employeeTable}] ([Last Name], [First Name]) VALUES (@lastName, @firstName)", connection) connection.Open() For i As Integer = 0 To employees.Length - 1 @@ -89,12 +80,11 @@ Namespace DataflowBatchDatabase End Using End Sub - ' Retrieves the number of entries in the Employees table in - ' the Northwind database. + ' Retrieves the number of entries in the sample employee table. Private Shared Function GetEmployeeCount(ByVal connectionString As String) As Integer Dim result As Integer = 0 Using sqlConnection As New SqlConnection(connectionString) - Dim sqlCommand As New SqlCommand("SELECT COUNT(*) FROM Employees", sqlConnection) + Dim sqlCommand As New SqlCommand($"SELECT COUNT(*) FROM [{s_employeeTable}]", sqlConnection) sqlConnection.Open() Try @@ -109,14 +99,18 @@ Namespace DataflowBatchDatabase ' Retrieves the ID of the first employee that has the provided name. Private Shared Function GetEmployeeID(ByVal lastName As String, ByVal firstName As String, ByVal connectionString As String) As Integer Using connection As New SqlConnection(connectionString) - Dim query As String = "SELECT [Employee ID] FROM Employees WHERE [Last Name] = @lastName AND [First Name] = @firstName" + Dim query As String = $"SELECT TOP (1) [Employee ID] FROM [{s_employeeTable}] WHERE [Last Name] = @lastName AND [First Name] = @firstName ORDER BY [Employee ID]" Dim command As New SqlCommand(query, connection) - command.Parameters.Add("@lastName", lastName) - command.Parameters.Add("@firstName", firstName) + command.Parameters.Add("@lastName", SqlDbType.NVarChar, 50).Value = lastName + command.Parameters.Add("@firstName", SqlDbType.NVarChar, 50).Value = firstName connection.Open() Try - Return CInt(Fix(command.ExecuteScalar())) + Dim result = command.ExecuteScalar() + If result Is Nothing Then + Throw New KeyNotFoundException("No matching employee.") + End If + Return CInt(result) Finally connection.Close() End Try @@ -223,8 +217,8 @@ Namespace DataflowBatchDatabase ' Post the Employee object to the Employee target of ' the batched join block. selectEmployees.Target1.Post(e) - Catch e As NullReferenceException - ' GetEmployeeID throws NullReferenceException when there is + Catch e As KeyNotFoundException + ' GetEmployeeID throws KeyNotFoundException when there is ' no such employee with the given name. When this happens, ' post the Exception object to the Exception target of ' the batched join block. @@ -243,79 +237,58 @@ Namespace DataflowBatchDatabase ' Shared Sub Main() - ' Create a connection string for accessing the database. - ' The connection string refers to the temporary database location. - Dim connectionString As String = String.Format( - "Data Source={0}", - s_scratchDatabase) - - ' Create a Stopwatch object to time database insert operations. - Dim stopwatch As New Stopwatch() - - ' Start with a clean database file by copying the source database to - ' the temporary location. - File.Copy(s_sourceDatabase, s_scratchDatabase, True) - - ' Demonstrate multiple insert operations without batching. - Console.WriteLine("Demonstrating non-batched database insert operations...") - Console.WriteLine("Original size of Employee table: {0}.", GetEmployeeCount(connectionString)) - stopwatch.Start() - AddEmployees(connectionString, s_insertCount) - stopwatch.Stop() - Console.WriteLine("New size of Employee table: {0}; elapsed insert time: {1} ms.", GetEmployeeCount(connectionString), stopwatch.ElapsedMilliseconds) - - Console.WriteLine() - - ' Start again with a clean database file. - File.Copy(s_sourceDatabase, s_scratchDatabase, True) - - ' Demonstrate multiple insert operations, this time with batching. - Console.WriteLine("Demonstrating batched database insert operations...") - Console.WriteLine("Original size of Employee table: {0}.", GetEmployeeCount(connectionString)) - stopwatch.Restart() - AddEmployeesBatched(connectionString, s_insertBatchSize, s_insertCount) - stopwatch.Stop() - Console.WriteLine("New size of Employee table: {0}; elapsed insert time: {1} ms.", GetEmployeeCount(connectionString), stopwatch.ElapsedMilliseconds) - - Console.WriteLine() - - ' Start again with a clean database file. - File.Copy(s_sourceDatabase, s_scratchDatabase, True) - - ' Demonstrate multiple retrieval operations with error reporting. - Console.WriteLine("Demonstrating batched join database select operations...") - ' Add a small number of employees to the database. - AddEmployeesBatched(connectionString, s_insertBatchSize, 16) - ' Query for random employees. - GetRandomEmployees(connectionString, s_insertBatchSize, 10) + Dim connectionString = Environment.GetEnvironmentVariable("SQL_CONNECTION_STRING") + If String.IsNullOrWhiteSpace(connectionString) Then + Throw New InvalidOperationException("Set the SQL_CONNECTION_STRING environment variable.") + End If + + ' Keep the global temporary table alive while worker connections use it. + Using keeper As New SqlConnection(connectionString) + keeper.Open() + Using setup As New SqlCommand( + $"CREATE TABLE [{s_employeeTable}] " & + "([Employee ID] int IDENTITY PRIMARY KEY, " & + "[Last Name] nvarchar(50) NOT NULL, [First Name] nvarchar(50) NOT NULL)", keeper) + setup.ExecuteNonQuery() + End Using + + Try + Dim stopwatch As New Stopwatch() + Console.WriteLine("Demonstrating non-batched database insert operations...") + Console.WriteLine("Original size of Employee table: {0}.", GetEmployeeCount(connectionString)) + stopwatch.Start() + AddEmployees(connectionString, s_insertCount) + stopwatch.Stop() + Console.WriteLine("New size of Employee table: {0}; elapsed insert time: {1} ms.", GetEmployeeCount(connectionString), stopwatch.ElapsedMilliseconds) + Console.WriteLine() + + Using reset As New SqlCommand($"TRUNCATE TABLE [{s_employeeTable}]", keeper) + reset.ExecuteNonQuery() + End Using + + Console.WriteLine("Demonstrating batched database insert operations...") + Console.WriteLine("Original size of Employee table: {0}.", GetEmployeeCount(connectionString)) + stopwatch.Restart() + AddEmployeesBatched(connectionString, s_insertBatchSize, s_insertCount) + stopwatch.Stop() + Console.WriteLine("New size of Employee table: {0}; elapsed insert time: {1} ms.", GetEmployeeCount(connectionString), stopwatch.ElapsedMilliseconds) + Console.WriteLine() + + Using reset As New SqlCommand($"TRUNCATE TABLE [{s_employeeTable}]", keeper) + reset.ExecuteNonQuery() + End Using + + Console.WriteLine("Demonstrating batched join database select operations...") + AddEmployeesBatched(connectionString, s_insertBatchSize, 16) + GetRandomEmployees(connectionString, s_insertBatchSize, 10) + Finally + Using cleanup As New SqlCommand($"DROP TABLE [{s_employeeTable}]", keeper) + cleanup.ExecuteNonQuery() + End Using + End Try + End Using End Sub End Class End Namespace -' Sample output: -'Demonstrating non-batched database insert operations... -'Original size of Employee table: 15. -'Adding 256 entries to Employee table... -'New size of Employee table: 271; elapsed insert time: 11035 ms. -' -'Demonstrating batched database insert operations... -'Original size of Employee table: 15. -'Adding 256 entries to Employee table... -'New size of Employee table: 271; elapsed insert time: 197 ms. -' -'Demonstrating batched join database insert operations... -'Adding 16 entries to Employee table... -'Selecting items from Employee table... -'Received a batch... -'Last=Jones First=Tom ID=21 -'Last=Jones First=John ID=24 -'Last=Smith First=Tom ID=26 -'Last=Jones First=Tom ID=21 -'There were 4 errors in this batch... -'Received a batch... -'Last=Smith First=Tom ID=26 -'Last=Jones First=Mike ID=28 -'There were 0 errors in this batch... -'Finished. There were 4 total errors. -' '