diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f8b23a5c9ad65..370028b03a602 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -833,6 +833,50 @@ updates: dotnet: patterns: - "*" # Prefer a single PR per project update. + - package-ecosystem: "nuget" + directory: "/docs/azure/sdk/snippets/protocol-convenience-methods/AzureCoreConvenience" #AzureCoreConvenience.csproj + schedule: + interval: "weekly" + day: "wednesday" + open-pull-requests-limit: 5 + groups: + # Group .NET updates together for projects. + dotnet: + patterns: + - "*" # Prefer a single PR per project update. + - package-ecosystem: "nuget" + directory: "/docs/azure/sdk/snippets/protocol-convenience-methods/AzureCoreProtocol" #AzureCoreProtocol.csproj + schedule: + interval: "weekly" + day: "wednesday" + open-pull-requests-limit: 5 + groups: + # Group .NET updates together for projects. + dotnet: + patterns: + - "*" # Prefer a single PR per project update. + - package-ecosystem: "nuget" + directory: "/docs/azure/sdk/snippets/protocol-convenience-methods/SCMConvenience" #SCMConvenience.csproj + schedule: + interval: "weekly" + day: "wednesday" + open-pull-requests-limit: 5 + groups: + # Group .NET updates together for projects. + dotnet: + patterns: + - "*" # Prefer a single PR per project update. + - package-ecosystem: "nuget" + directory: "/docs/azure/sdk/snippets/protocol-convenience-methods/SCMProtocol" #SCMProtocol.csproj + schedule: + interval: "weekly" + day: "wednesday" + open-pull-requests-limit: 5 + groups: + # Group .NET updates together for projects. + dotnet: + patterns: + - "*" # Prefer a single PR per project update. - package-ecosystem: "nuget" directory: "/docs/azure/sdk/snippets/unit-testing" #UnitTestingSampleApp.csproj schedule: @@ -2153,47 +2197,3 @@ updates: dotnet: patterns: - "*" # Prefer a single PR per project update. - - package-ecosystem: "nuget" - directory: "/docs/machine-learning/tutorials/snippets/text-classification-tf/csharp" #TextClassificationTF.csproj - schedule: - interval: "weekly" - day: "wednesday" - open-pull-requests-limit: 5 - groups: - # Group .NET updates together for projects. - dotnet: - patterns: - - "*" # Prefer a single PR per project update. - - package-ecosystem: "nuget" - directory: "/docs/orleans/deployment/snippets/consul/Silo" #Silo.csproj - schedule: - interval: "weekly" - day: "wednesday" - open-pull-requests-limit: 5 - groups: - # Group .NET updates together for projects. - dotnet: - patterns: - - "*" # Prefer a single PR per project update. - - package-ecosystem: "nuget" - directory: "/docs/orleans/deployment/snippets/service-fabric/stateless" #Orleans.ServiceFabric.Stateless.csproj - schedule: - interval: "weekly" - day: "wednesday" - open-pull-requests-limit: 5 - groups: - # Group .NET updates together for projects. - dotnet: - patterns: - - "*" # Prefer a single PR per project update. - - package-ecosystem: "nuget" - directory: "/docs/orleans/grains/snippets/timers" #Timers.csproj - schedule: - interval: "weekly" - day: "wednesday" - open-pull-requests-limit: 5 - groups: - # Group .NET updates together for projects. - dotnet: - patterns: - - "*" # Prefer a single PR per project update. diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index fc41713707668..d11b2410ebdd7 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -41,7 +41,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3 + uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 with: results_file: results.sarif results_format: sarif @@ -71,6 +71,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@2d790406f505036ef40ecba973cc774a50395aac # v3.25.13 + uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15 with: sarif_file: results.sarif diff --git a/docfx.json b/docfx.json index 7ad11e348bcd2..69317f02d8ae4 100644 --- a/docfx.json +++ b/docfx.json @@ -54,7 +54,8 @@ "csharp-12.0/*.md", "lock-object.md", "method-group-natural-type-improvements.md", - "params-collections.md" + "params-collections.md", + "ref-struct-interfaces.md" ], "src": "_csharplang/proposals", "dest": "csharp/language-reference/proposals", @@ -491,7 +492,7 @@ "_csharplang/proposals/csharp-10.0/*.md": "08/07/2021", "_csharplang/proposals/csharp-11.0/*.md": "09/30/2022", "_csharplang/proposals/csharp-12.0/*.md": "08/15/2023", - "_csharplang/proposals/*.md": "06/28/2024", + "_csharplang/proposals/*.md": "07/16/2024", "_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 7.md": "11/08/2022", "_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 8.md": "09/26/2023", "_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 9.md": "06/26/2024", @@ -663,6 +664,7 @@ "_csharplang/proposals/method-group-natural-type-improvements.md": "Method group natural type improvements", "_csharplang/proposals/params-collections.md": "Params collections", "_csharplang/proposals/ref-unsafe-in-iterators-async.md": "Allow ref and unsafe in iterators and async methods", + "_csharplang/proposals/ref-struct-interfaces.md": "Allow ref struct types to implement some interfaces", "_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 7.md": "C# compiler breaking changes since C# 10", "_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 8.md": "C# compiler breaking changes since C# 11", "_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 9.md": "C# compiler breaking changes since C# 12", @@ -780,6 +782,7 @@ "_csharplang/proposals/method-group-natural-type-improvements.md": "This proposal refines the determination of the natural type of a method group by considering candidates scope-by-scope and pruning at each scope.", "_csharplang/proposals/params-collections.md": "Allow the `params` modifier on collection types beyond arrays, including `IEnumerable` types.", "_csharplang/proposals/ref-unsafe-in-iterators-async.md": "This proposal modifies restrictions to enable ref local variables and unsafe blocks in iterators and async methods", + "_csharplang/proposals/ref-struct-interfaces.md": "This proposal provides features that enable interface authors to allow `ref struct` types to implement a particular interface", "_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 7.md": "Learn about any breaking changes since the initial release of C# 10", "_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 8.md": "Learn about any breaking changes since the initial release of C# 11", "_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 9.md": "Learn about any breaking changes since the initial release of C# 12", diff --git a/docs/ai/conceptual/vector-databases.md b/docs/ai/conceptual/vector-databases.md index 39daad696d629..2040abf125ea9 100644 --- a/docs/ai/conceptual/vector-databases.md +++ b/docs/ai/conceptual/vector-databases.md @@ -47,21 +47,7 @@ Other benefits of the RAG pattern include: ## Available vector database solutions -You can use the following resources as vector database solutions in .NET: - -| Resource | SK support | AOAI support | -|:-|:-|:-| -| [Azure AI Search](/azure/search/vector-search-overview) | ✔️ | ✔️ | -| [Azure Cache for Redis](/azure/azure-cache-for-redis/cache-tutorial-vector-similarity) | ❌ | ✔️ | -| [Azure Cosmos DB for MongoDB vCore](/azure/cosmos-db/mongodb/vcore/vector-search) | ✔️ | ✔️ | -| [Azure Cosmos DB for NoSQL](/azure/cosmos-db/vector-search) | ❌ | ✔️ | -| [Azure Cosmos DB for PostgreSQL](/azure/cosmos-db/postgresql/howto-use-pgvector) | ❌ | ✔️ | -| [Azure Database for PostgreSQL - Flexible Server](/azure/postgresql/flexible-server/how-to-use-pgvector) | ✔️ | ✔️ | -| [Azure SQL Database](/azure/azure-sql/database/ai-artificial-intelligence-intelligent-applications?&preserve-view=true#vector-search) | ✔️ | ✔️ | -| [Open-source vector databases](/azure/cosmos-db/mongodb/vcore/vector-search-ai) | ✔️ | ❌ | -| | | | - -You use [connectors](/semantic-kernel/memories/vector-db#available-connectors-to-vector-databases) to access vector databases solutions with Semantic Kernel. Because in Semantic Kernel you build connectors into the [kernel](/semantic-kernel/agents/kernel/?tabs=Csharp), you can use [planners](/semantic-kernel/agents/planners/?tabs=Csharp) to orchestrate vector database functions. +[!INCLUDE [vector-databases](../includes/vector-databases.md)] ## Related content diff --git a/docs/ai/dotnet-ai-ecosystem.md b/docs/ai/dotnet-ai-ecosystem.md index 4955fa3b69388..d07fb1dd8e387 100644 --- a/docs/ai/dotnet-ai-ecosystem.md +++ b/docs/ai/dotnet-ai-ecosystem.md @@ -27,14 +27,7 @@ Today, you can use .NET to access models built by OpenAI, using either the Azure ## Connect your data using vector stores -To increase relevancy and tailor AI applications for your own data, you'll likely need to work with a vector store. Many services provide a native SDK for .NET, which you can use directly. You can also use Semantic Kernel, which provides an extensible component model that allows you to try different vector stores without needing to learn each SDK. - -| NuGet package | Supported vector store | Maintainer or vendor | Link to docs | -|---------------|------------------------|----------------------|--------------| -| [Microsoft.SemanticKernel](https://www.nuget.org/packages/Microsoft.SemanticKernel/) | [Supported vector stores](/semantic-kernel/memories/vector-db#available-connectors-to-vector-databases) | [Semantic Kernel](https://github.com/microsoft/semantic-kernel) (Microsoft) | [Semantic Kernel: What is a vector database](/semantic-kernel/memories/vector-db) | -| [Azure.Search.Documents](https://www.nuget.org/packages/Azure.Search.Documents/) | Azure AI Search | [Azure SDK for .NET](https://github.com/Azure/azure-sdk-for-net) (Microsoft) | [Azure AI Search client library for .NET](/dotnet/api/overview/azure/search.documents-readme) | -| [Milvus.Client](https://www.nuget.org/packages/Milvus.Client) | Milvus Vector Database | [Milvus](https://milvus.io/) | [Install Milvus C# SDK](https://milvus.io/docs/v2.2.x/install-csharp.md) | -| [Qdrant.Client](https://www.nuget.org/packages/Qdrant.Client) | Qdrant Vector Database | [Qdrant](https://qdrant.tech) | [Qdrant .NET SDK](https://github.com/qdrant/qdrant-dotnet) | +[!INCLUDE [vector-databases](includes/vector-databases.md)] ## Other options diff --git a/docs/ai/includes/vector-databases.md b/docs/ai/includes/vector-databases.md new file mode 100644 index 0000000000000..54da71f3fc5fa --- /dev/null +++ b/docs/ai/includes/vector-databases.md @@ -0,0 +1,24 @@ +--- +author: alexwolfmsft +ms.author: alexwolf +ms.date: 07/29/2024 +ms.topic: include +--- + +AI applications often use data vector databases and services to improve relevancy and provide customized functionality. Many of these services provide a native SDK for .NET, which you can use directly. Semantic Kernel provides an extensible component model that enables you to use different vector stores without needing to learn each SDK. Semantic Kernel provides connectors for the following vector databases and services: + +- [Vector Database in Azure Cosmos DB for NoSQL](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL) +- [Vector Database in vCore-based Azure Cosmos DB for MongoDB](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBMongoDB) +- [Azure AI Search](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.AzureAISearch) +- [Azure PostgreSQL Server](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.Postgres) +- [Azure SQL Database](https://github.com/kbeaugrand/SemanticKernel.Connectors.Memory.SqlServer) +- [Chroma](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.Chroma) +- [DuckDB](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.DuckDB) +- [Milvus](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.Milvus) +- [MongoDB Atlas Vector Search](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.MongoDB) +- [Pinecone](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.Pinecone) +- [Postgres](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.Postgres) +- [Qdrant](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.Qdrant) +- [Redis](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.Redis) +- [Sqlite](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.Sqlite) +- [Weaviate](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.Weaviate) diff --git a/docs/azure/includes/dotnet-all.md b/docs/azure/includes/dotnet-all.md index 50fd991c86976..6a3a9f3c015a6 100644 --- a/docs/azure/includes/dotnet-all.md +++ b/docs/azure/includes/dotnet-all.md @@ -43,6 +43,7 @@ | FarmBeats | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Verticals.AgriFood.Farming/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/Verticals.AgriFood.Farming-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Verticals.AgriFood.Farming_1.0.0-beta.2/sdk/agrifood/Azure.Verticals.AgriFood.Farming/) | | Form Recognizer | NuGet [4.1.0](https://www.nuget.org/packages/Azure.AI.FormRecognizer/4.1.0) | [docs](/dotnet/api/overview/azure/AI.FormRecognizer-readme) | GitHub [4.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.FormRecognizer_4.1.0/sdk/formrecognizer/Azure.AI.FormRecognizer/) | | Functions Extensions - WebPubSub | NuGet [1.7.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/1.7.0) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub-readme) | GitHub [1.7.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub_1.7.0/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/) | +| Health Deidentification | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Health.Deidentification/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Health.Deidentification_1.0.0-beta.1/sdk/healthdataaiservices/Azure.Health.Deidentification/) | | Health Insights Cancer Profiling | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Health.Insights.CancerProfiling/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Health.Insights.CancerProfiling-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Health.Insights.CancerProfiling_1.0.0-beta.1/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/) | | Health Insights Clinical Matching | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Health.Insights.ClinicalMatching/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Health.Insights.ClinicalMatching-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Health.Insights.ClinicalMatching_1.0.0-beta.1/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/) | | Health Insights Radiology Insights | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Health.Insights.RadiologyInsights/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Health.Insights.RadiologyInsights-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Health.Insights.RadiologyInsights_1.0.0-beta.1/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/) | @@ -151,7 +152,7 @@ | Resource Management - App Compliance Automation | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.AppComplianceAutomation/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.AppComplianceAutomation-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.AppComplianceAutomation_1.0.0-beta.4/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/) | | Resource Management - App Configuration | NuGet [1.3.2](https://www.nuget.org/packages/Azure.ResourceManager.AppConfiguration/1.3.2) | [docs](/dotnet/api/overview/azure/ResourceManager.AppConfiguration-readme) | GitHub [1.3.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.AppConfiguration_1.3.2/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/) | | Resource Management - App Platform | NuGet [1.1.1](https://www.nuget.org/packages/Azure.ResourceManager.AppPlatform/1.1.1) | [docs](/dotnet/api/overview/azure/ResourceManager.AppPlatform-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.AppPlatform_1.1.1/sdk/appplatform/Azure.ResourceManager.AppPlatform/) | -| Resource Management - App Service | NuGet [1.0.2](https://www.nuget.org/packages/Azure.ResourceManager.AppService/1.0.2)
NuGet [1.1.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.AppService/1.1.0-beta.5) | [docs](/dotnet/api/overview/azure/ResourceManager.AppService-readme) | GitHub [1.0.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.AppService_1.0.2/sdk/websites/Azure.ResourceManager.AppService/)
GitHub [1.1.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.AppService_1.1.0-beta.5/sdk/websites/Azure.ResourceManager.AppService/) | +| Resource Management - App Service | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.AppService/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.AppService-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.AppService_1.2.0/sdk/websites/Azure.ResourceManager.AppService/) | | Resource Management - Application Insights | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.ApplicationInsights/1.0.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ApplicationInsights-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ApplicationInsights_1.0.0/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/) | | Resource Management - Astro | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.Astro/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.Astro-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.Astro_1.0.0-beta.1/sdk/astronomer/Azure.ResourceManager.Astro/) | | Resource Management - Attestation | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.Attestation/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.Attestation-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Attestation_1.0.0-beta.4/sdk/attestation/Azure.ResourceManager.Attestation/) | @@ -187,7 +188,7 @@ | Resource Management - Customer Insights | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.CustomerInsights/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.CustomerInsights-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CustomerInsights_1.0.0-beta.4/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/) | | Resource Management - Data Box | NuGet [1.0.3](https://www.nuget.org/packages/Azure.ResourceManager.DataBox/1.0.3) | [docs](/dotnet/api/overview/azure/ResourceManager.DataBox-readme) | GitHub [1.0.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataBox_1.0.3/sdk/databox/Azure.ResourceManager.DataBox/) | | Resource Management - Data Box Edge | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.DataBoxEdge/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DataBoxEdge-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataBoxEdge_1.1.0/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/) | -| Resource Management - Data Factory | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.DataFactory/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DataFactory-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataFactory_1.1.0/sdk/datafactory/Azure.ResourceManager.DataFactory/) | +| Resource Management - Data Factory | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.DataFactory/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DataFactory-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataFactory_1.2.0/sdk/datafactory/Azure.ResourceManager.DataFactory/) | | Resource Management - Data Lake Analytics | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.DataLakeAnalytics/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DataLakeAnalytics-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataLakeAnalytics_1.1.0/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/) | | Resource Management - Data Lake Store | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.DataLakeStore/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DataLakeStore-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataLakeStore_1.1.0/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/) | | Resource Management - Data Migration | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.DataMigration/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.DataMigration-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataMigration_1.0.0-beta.4/sdk/datamigration/Azure.ResourceManager.DataMigration/) | @@ -216,6 +217,7 @@ | Resource Management - Event Grid | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.EventGrid/1.0.1)
NuGet [1.1.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.EventGrid/1.1.0-beta.5) | [docs](/dotnet/api/overview/azure/ResourceManager.EventGrid-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventGrid_1.0.1/sdk/eventgrid/Azure.ResourceManager.EventGrid/)
GitHub [1.1.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventGrid_1.1.0-beta.5/sdk/eventgrid/Azure.ResourceManager.EventGrid/) | | Resource Management - Event Hubs | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.EventHubs/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.EventHubs-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventHubs_1.1.0/sdk/eventhub/Azure.ResourceManager.EventHubs/) | | Resource Management - Extended Location | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.ExtendedLocations/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ExtendedLocations-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ExtendedLocations_1.1.0/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/) | +| Resource Management - Fabric | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.Fabric/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Fabric_1.0.0-beta.1/sdk/fabric/Azure.ResourceManager.Fabric/) | | Resource Management - Fluid Relay | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.FluidRelay/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.FluidRelay-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.FluidRelay_1.1.0/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/) | | Resource Management - Front Door | NuGet [1.3.0](https://www.nuget.org/packages/Azure.ResourceManager.FrontDoor/1.3.0) | [docs](/dotnet/api/overview/azure/ResourceManager.FrontDoor-readme) | GitHub [1.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.FrontDoor_1.3.0/sdk/frontdoor/Azure.ResourceManager.FrontDoor/) | | Resource Management - Graph Services | NuGet [1.1.1](https://www.nuget.org/packages/Azure.ResourceManager.GraphServices/1.1.1) | [docs](/dotnet/api/overview/azure/ResourceManager.GraphServices-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.GraphServices_1.1.1/sdk/graphservices/Azure.ResourceManager.GraphServices/) | @@ -360,7 +362,7 @@ | Common | NuGet [2.2.1](https://www.nuget.org/packages/Microsoft.Azure.Common/2.2.1) | | | | Common - Dependencies | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Common.Dependencies/1.0.0) | | | | Computer Vision | NuGet [7.0.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.ComputerVision/7.0.1) | | GitHub [7.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Vision.ComputerVision_6.0.0-preview.1/sdk/cognitiveservices/Vision.ComputerVision) | -| Cosmos DB | NuGet [3.42.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.42.0) | [docs](https://learn.microsoft.com/dotnet/api/overview/azure/cosmosdb) | GitHub [3.42.0](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/3.12.0/Microsoft.Azure.Cosmos) | +| Cosmos DB | NuGet [3.42.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.42.0)
NuGet [3.43.0-preview.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.43.0-preview.0) | [docs](https://learn.microsoft.com/dotnet/api/overview/azure/cosmosdb) | GitHub [3.42.0](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/3.12.0/Microsoft.Azure.Cosmos) | | Custom Image Search | NuGet [2.1.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.BingCustomImageSearch/2.1.0-preview.1) | | GitHub [2.1.0-preview.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Search.BingCustomImageSearch_2.1.0-preview.1/sdk/cognitiveservices/Search.BingCustomImageSearch) | | Custom Image Search | NuGet [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.CustomImageSearch/2.0.0) | | | | Custom Search | NuGet [2.1.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.BingCustomSearch/2.1.0-preview.1) | | GitHub [2.1.0-preview.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Search.BingCustomSearch_2.1.0-preview.1/sdk/cognitiveservices/Search.BingCustomSearch) | @@ -447,7 +449,7 @@ | Functions - Extensions | NuGet [1.1.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Extensions/1.1.0) | | GitHub [1.1.0](https://github.com/Azure/azure-functions-dotnet-extensions) | | Functions extension for Application Insights | NuGet [1.0.0-preview4](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.ApplicationInsights/1.0.0-preview4) | | | | Functions extension for Azure Mobile Apps | NuGet [3.0.0-beta8](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.MobileApps/3.0.0-beta8) | | GitHub [3.0.0-beta8](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/v3.0.0-beta8/src/WebJobs.Extensions.MobileApps) | -| Functions extension for Azure SQL and SQL Server | NuGet [3.0.534](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Sql/3.0.534) | | | +| Functions extension for Azure SQL and SQL Server | NuGet [3.0.534](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Sql/3.0.534)
NuGet [3.1.169-preview](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Sql/3.1.169-preview) | | | | Functions extension for Cosmos DB | NuGet [4.7.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.CosmosDB/4.7.0) | | GitHub [4.7.0](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/cosmos-v3.0.7/src/WebJobs.Extensions.CosmosDB) | | Functions extension for DocumentDB | NuGet [1.3.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DocumentDB/1.3.0) | | GitHub [1.3.0](https://github.com/Azure/azure-webjobs-sdk-extensions) | | Functions extension for Durable Task Framework | NuGet [2.13.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/2.13.0)
NuGet [3.0.0-rc.2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/3.0.0-rc.2) | [docs](https://learn.microsoft.com/dotnet/api/overview/azure/functions) | GitHub [2.13.0](https://github.com/Azure/azure-functions-durable-extension/tree/v2.2.2/src/WebJobs.Extensions.DurableTask) | @@ -487,9 +489,9 @@ | Microsoft.Azure.Functions.Worker.Core | NuGet [1.18.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Core/1.18.0) | | | | Microsoft.Azure.Functions.Worker.Extensions.Abstractions | NuGet [1.3.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Abstractions/1.3.0) | | | | Microsoft.Azure.Functions.Worker.Extensions.ApplicationInsights | NuGet [1.0.0-preview4](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.ApplicationInsights/1.0.0-preview4) | | | -| Microsoft.Azure.Functions.Worker.Extensions.CosmosDB | NuGet [4.9.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.CosmosDB/4.9.0) | | | +| Microsoft.Azure.Functions.Worker.Extensions.CosmosDB | NuGet [4.10.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.CosmosDB/4.10.0) | | | | Microsoft.Azure.Functions.Worker.Extensions.EventGrid | NuGet [3.4.1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.EventGrid/3.4.1) | | | -| Microsoft.Azure.Functions.Worker.Extensions.EventHubs | NuGet [6.3.1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.EventHubs/6.3.1) | | | +| Microsoft.Azure.Functions.Worker.Extensions.EventHubs | NuGet [6.3.3](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.EventHubs/6.3.3) | | | | Microsoft.Azure.Functions.Worker.Extensions.Http | NuGet [3.2.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Http/3.2.0) | | | | Microsoft.Azure.Functions.Worker.Extensions.Kafka | NuGet [3.10.1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Kafka/3.10.1) | | | | Microsoft.Azure.Functions.Worker.Extensions.Kusto | NuGet [1.0.10-Preview](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Kusto/1.0.10-Preview) | | | @@ -498,13 +500,13 @@ | Microsoft.Azure.Functions.Worker.Extensions.Rpc | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Rpc/1.0.0) | | | | Microsoft.Azure.Functions.Worker.Extensions.SendGrid | NuGet [3.0.3](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.SendGrid/3.0.3) | | | | Microsoft.Azure.Functions.Worker.Extensions.ServiceBus | NuGet [5.20.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.ServiceBus/5.20.0) | | | -| Microsoft.Azure.Functions.Worker.Extensions.SignalRService | NuGet [1.13.2](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.SignalRService/1.13.2) | | | -| Microsoft.Azure.Functions.Worker.Extensions.Sql | NuGet [3.0.534](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Sql/3.0.534) | | | -| Microsoft.Azure.Functions.Worker.Extensions.Storage | NuGet [6.5.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Storage/6.5.0) | | | -| Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs | NuGet [6.5.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs/6.5.0) | | | +| Microsoft.Azure.Functions.Worker.Extensions.SignalRService | NuGet [1.14.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.SignalRService/1.14.0) | | | +| Microsoft.Azure.Functions.Worker.Extensions.Sql | NuGet [3.0.534](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Sql/3.0.534)
NuGet [3.1.169-preview](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Sql/3.1.169-preview) | | | +| Microsoft.Azure.Functions.Worker.Extensions.Storage | NuGet [6.6.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Storage/6.6.0) | | | +| Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs | NuGet [6.6.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs/6.6.0) | | | | Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues | NuGet [5.5.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues/5.5.0) | | | | Microsoft.Azure.Functions.Worker.Extensions.Storage.Tables | NuGet [1.0.0-preview1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Storage.Tables/1.0.0-preview1) | | | -| Microsoft.Azure.Functions.Worker.Extensions.Tables | NuGet [1.3.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Tables/1.3.0) | | | +| Microsoft.Azure.Functions.Worker.Extensions.Tables | NuGet [1.4.1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Tables/1.4.1) | | | | Microsoft.Azure.Functions.Worker.Extensions.Timer | NuGet [4.3.1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Timer/4.3.1) | | | | Microsoft.Azure.Functions.Worker.Extensions.Warmup | NuGet [4.0.2](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Warmup/4.0.2) | | | | Microsoft.Azure.Functions.Worker.Grpc | NuGet [1.16.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Grpc/1.16.0) | | | diff --git a/docs/azure/includes/dotnet-new.md b/docs/azure/includes/dotnet-new.md index c5d84b737574a..ce2943b75162b 100644 --- a/docs/azure/includes/dotnet-new.md +++ b/docs/azure/includes/dotnet-new.md @@ -44,6 +44,7 @@ | FarmBeats | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Verticals.AgriFood.Farming/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/Verticals.AgriFood.Farming-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Verticals.AgriFood.Farming_1.0.0-beta.2/sdk/agrifood/Azure.Verticals.AgriFood.Farming/) | | Form Recognizer | NuGet [4.1.0](https://www.nuget.org/packages/Azure.AI.FormRecognizer/4.1.0) | [docs](/dotnet/api/overview/azure/AI.FormRecognizer-readme) | GitHub [4.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.FormRecognizer_4.1.0/sdk/formrecognizer/Azure.AI.FormRecognizer/) | | Functions Extensions - WebPubSub | NuGet [1.7.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/1.7.0) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub-readme) | GitHub [1.7.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub_1.7.0/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/) | +| Health Deidentification | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Health.Deidentification/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Health.Deidentification_1.0.0-beta.1/sdk/healthdataaiservices/Azure.Health.Deidentification/) | | Health Insights Cancer Profiling | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Health.Insights.CancerProfiling/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Health.Insights.CancerProfiling-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Health.Insights.CancerProfiling_1.0.0-beta.1/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/) | | Health Insights Clinical Matching | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Health.Insights.ClinicalMatching/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Health.Insights.ClinicalMatching-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Health.Insights.ClinicalMatching_1.0.0-beta.1/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/) | | Health Insights Radiology Insights | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Health.Insights.RadiologyInsights/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Health.Insights.RadiologyInsights-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Health.Insights.RadiologyInsights_1.0.0-beta.1/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/) | @@ -155,7 +156,7 @@ | Resource Management - App Compliance Automation | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.AppComplianceAutomation/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.AppComplianceAutomation-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.AppComplianceAutomation_1.0.0-beta.4/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/) | | Resource Management - App Configuration | NuGet [1.3.2](https://www.nuget.org/packages/Azure.ResourceManager.AppConfiguration/1.3.2) | [docs](/dotnet/api/overview/azure/ResourceManager.AppConfiguration-readme) | GitHub [1.3.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.AppConfiguration_1.3.2/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/) | | Resource Management - App Platform | NuGet [1.1.1](https://www.nuget.org/packages/Azure.ResourceManager.AppPlatform/1.1.1) | [docs](/dotnet/api/overview/azure/ResourceManager.AppPlatform-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.AppPlatform_1.1.1/sdk/appplatform/Azure.ResourceManager.AppPlatform/) | -| Resource Management - App Service | NuGet [1.0.2](https://www.nuget.org/packages/Azure.ResourceManager.AppService/1.0.2)
NuGet [1.1.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.AppService/1.1.0-beta.5) | [docs](/dotnet/api/overview/azure/ResourceManager.AppService-readme) | GitHub [1.0.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.AppService_1.0.2/sdk/websites/Azure.ResourceManager.AppService/)
GitHub [1.1.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.AppService_1.1.0-beta.5/sdk/websites/Azure.ResourceManager.AppService/) | +| Resource Management - App Service | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.AppService/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.AppService-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.AppService_1.2.0/sdk/websites/Azure.ResourceManager.AppService/) | | Resource Management - Application Insights | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.ApplicationInsights/1.0.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ApplicationInsights-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ApplicationInsights_1.0.0/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/) | | Resource Management - Arc ScVmm | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.ArcScVmm/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.ArcScVmm-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ArcScVmm_1.0.0-beta.4/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/) | | Resource Management - Astro | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.Astro/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.Astro-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.Astro_1.0.0-beta.1/sdk/astronomer/Azure.ResourceManager.Astro/) | @@ -192,7 +193,7 @@ | Resource Management - Customer Insights | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.CustomerInsights/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.CustomerInsights-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CustomerInsights_1.0.0-beta.4/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/) | | Resource Management - Data Box | NuGet [1.0.3](https://www.nuget.org/packages/Azure.ResourceManager.DataBox/1.0.3) | [docs](/dotnet/api/overview/azure/ResourceManager.DataBox-readme) | GitHub [1.0.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataBox_1.0.3/sdk/databox/Azure.ResourceManager.DataBox/) | | Resource Management - Data Box Edge | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.DataBoxEdge/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DataBoxEdge-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataBoxEdge_1.1.0/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/) | -| Resource Management - Data Factory | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.DataFactory/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DataFactory-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataFactory_1.1.0/sdk/datafactory/Azure.ResourceManager.DataFactory/) | +| Resource Management - Data Factory | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.DataFactory/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DataFactory-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataFactory_1.2.0/sdk/datafactory/Azure.ResourceManager.DataFactory/) | | Resource Management - Data Lake Analytics | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.DataLakeAnalytics/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DataLakeAnalytics-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataLakeAnalytics_1.1.0/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/) | | Resource Management - Data Lake Store | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.DataLakeStore/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DataLakeStore-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataLakeStore_1.1.0/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/) | | Resource Management - Data Migration | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.DataMigration/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.DataMigration-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DataMigration_1.0.0-beta.4/sdk/datamigration/Azure.ResourceManager.DataMigration/) | @@ -221,6 +222,7 @@ | Resource Management - Event Grid | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.EventGrid/1.0.1)
NuGet [1.1.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.EventGrid/1.1.0-beta.5) | [docs](/dotnet/api/overview/azure/ResourceManager.EventGrid-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventGrid_1.0.1/sdk/eventgrid/Azure.ResourceManager.EventGrid/)
GitHub [1.1.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventGrid_1.1.0-beta.5/sdk/eventgrid/Azure.ResourceManager.EventGrid/) | | Resource Management - Event Hubs | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.EventHubs/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.EventHubs-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventHubs_1.1.0/sdk/eventhub/Azure.ResourceManager.EventHubs/) | | Resource Management - Extended Location | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.ExtendedLocations/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ExtendedLocations-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ExtendedLocations_1.1.0/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/) | +| Resource Management - Fabric | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.Fabric/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Fabric_1.0.0-beta.1/sdk/fabric/Azure.ResourceManager.Fabric/) | | Resource Management - Fluid Relay | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.FluidRelay/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.FluidRelay-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.FluidRelay_1.1.0/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/) | | Resource Management - Front Door | NuGet [1.3.0](https://www.nuget.org/packages/Azure.ResourceManager.FrontDoor/1.3.0) | [docs](/dotnet/api/overview/azure/ResourceManager.FrontDoor-readme) | GitHub [1.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.FrontDoor_1.3.0/sdk/frontdoor/Azure.ResourceManager.FrontDoor/) | | Resource Management - Graph Services | NuGet [1.1.1](https://www.nuget.org/packages/Azure.ResourceManager.GraphServices/1.1.1) | [docs](/dotnet/api/overview/azure/ResourceManager.GraphServices-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.GraphServices_1.1.1/sdk/graphservices/Azure.ResourceManager.GraphServices/) | diff --git a/docs/csharp/language-reference/attributes/general.md b/docs/csharp/language-reference/attributes/general.md index dfa5c5548454a..c3ea4dace702b 100644 --- a/docs/csharp/language-reference/attributes/general.md +++ b/docs/csharp/language-reference/attributes/general.md @@ -1,11 +1,23 @@ --- title: "Attributes interpreted by the compiler: Miscellaneous" -ms.date: 10/26/2023 +ms.date: 07/26/2024 description: "Learn about attributes that affect code generated by the compiler: the Conditional, Obsolete, AttributeUsage, ModuleInitializer, and SkipLocalsInit attributes." --- # Miscellaneous attributes interpreted by the C# compiler -The attributes `Conditional`, `Obsolete`, `AttributeUsage`, `AsyncMethodBuilder`, `InterpolatedStringHandler`, `ModuleInitializer`, and `Experimental` can be applied to elements in your code. They add semantic meaning to those elements. The compiler uses those semantic meanings to alter its output and report possible mistakes by developers using your code. +There are several attributes that can be applied to elements in your code that add semantic meaning to those elements: + +- [`Conditional`](#conditional-attribute): Make execution of a method dependent on a preprocessor identifier. +- [`Obsolete`](#obsolete-attribute): Mark a type or member for (potential) future removal. +- [`AttributeUsage`](#attributeusage-attribute): Declare the language elements where an attribute can be applied. +- [`AsyncMethodBuilder`](#asyncmethodbuilder-attribute): Declare an async method builder type. +- [`InterpolatedStringHandler`](#interpolatedstringhandler-and-interpolatedstringhandlerarguments-attributes): Define an interpolated string builder for a known scenario. +- [`ModuleInitializer`](#moduleinitializer-attribute): Declare a method that initializes a module. +- [`SkipLocalsInit`](#skiplocalsinit-attribute): Elide the code that initializes local variable storage to 0. +- [`UnscopedRef`](#unscopedref-attribute): Declare that a `ref` variable normally interpreted as `scoped` should be treated as unscoped. +- [`Experimental`](#experimental-attribute): Mark a type or member as experimental. + +The compiler uses those semantic meanings to alter its output and report possible mistakes by developers using your code. ## `Conditional` attribute @@ -116,7 +128,7 @@ You add the interface. -The constructor to the `AsyncMethodBuilder` attribute specifies the type of the associated builder. The builder must implement the following accessible members: +The constructor to the `AsyncMethodBuilder` attribute specifies the type of the associated builder. The builder must implement the following accessible members: * A static `Create()` method that returns the type of the builder. * A readable `Task` property that returns the async return type. @@ -205,6 +217,18 @@ To try this code yourself, set the `AllowUnsafeBlocks` compiler option in your * ``` +## `UnscopedRef` attribute + +The `UnscopedRef` attribute marks a variable declaration as unscoped, meaning the reference is allowed to escape. + +You add this attribute where the compiler treats a `ref` as implicitly `scoped`: + +- The `this` parameter for `struct` instance methods. +- `ref` parameters that refer to `ref struct` types. +- `out` parameters. + +Applying the marks the element as unscoped. + ## See also - diff --git a/docs/csharp/language-reference/attributes/global.md b/docs/csharp/language-reference/attributes/global.md index c8032fdaf2058..cfd64d0afa665 100644 --- a/docs/csharp/language-reference/attributes/global.md +++ b/docs/csharp/language-reference/attributes/global.md @@ -1,6 +1,6 @@ --- title: "Attributes interpreted by the compiler: Global attributes" -ms.date: 12/16/2020 +ms.date: 07/26/2024 description: Attributes provide metadata the compiler uses to understand more semantics of your program --- # Assembly level attributes interpreted by the C# compiler @@ -29,11 +29,11 @@ The following table shows the identity attributes. |---------------|-------------| ||Specifies the version of an assembly.| ||Specifies which culture the assembly supports.| -||Specifies whether an assembly supports side-by-side execution on the same computer, in the same process, or in the same application domain.| +||Specifies a bitwise combination of flags for an assembly, describing just-in-time (JIT) compiler options, whether the assembly is retargetable, and whether it has a full or tokenized public key. | ## Informational attributes -You use informational attributes to provide additional company or product information for an assembly. The following table shows the informational attributes defined in the namespace. +You use informational attributes to provide more company or product information for an assembly. The following table shows the informational attributes defined in the namespace. |Attribute|Purpose| |---------------|-------------| diff --git a/docs/csharp/language-reference/builtin-types/ref-struct.md b/docs/csharp/language-reference/builtin-types/ref-struct.md index cb547291204f1..07b18341646b9 100644 --- a/docs/csharp/language-reference/builtin-types/ref-struct.md +++ b/docs/csharp/language-reference/builtin-types/ref-struct.md @@ -1,7 +1,7 @@ --- title: "ref struct types" description: Learn about the ref struct type in C# -ms.date: 06/28/2024 +ms.date: 07/26/2024 --- # `ref` structure types (C# reference) @@ -9,14 +9,12 @@ You can use the `ref` modifier in the declaration of a [structure type](struct.m - A `ref struct` can't be the element type of an array. - A `ref struct` can't be a declared type of a field of a class or a non-`ref struct`. -- A `ref struct` can't implement interfaces. - A `ref struct` can't be boxed to or . -- A `ref struct` can't be a type argument. - A `ref struct` variable can't be captured in a [lambda expression](../operators/lambda-expressions.md) or a [local function](../../programming-guide/classes-and-structs/local-functions.md). - Before C# 13,`ref struct` variables can't be used in an `async` method. Beginning with C# 13, a `ref struct` variable can't be used in the same block as the [`await`](../operators/await.md) expression in an [`async`](../keywords/async.md) method. However, you can use `ref struct` variables in synchronous methods, for example, in methods that return or . - Before C# 13, a `ref struct` variable can't be used in [iterators](../../iterators.md). Beginning with C# 13, `ref struct` types and `ref` locals can be used in iterators, provided they aren't in code segments with the `yield return` statement. - -You can define a disposable `ref struct`. To do that, ensure that a `ref struct` fits the [disposable pattern](~/_csharplang/proposals/csharp-8.0/using.md#pattern-based-using). That is, it has an instance `Dispose` method, which is accessible, parameterless and has a `void` return type. You can use the [using statement or declaration](../statements/using.md) with an instance of a disposable `ref struct`. +- Before C# 13, a `ref struct` can't implement interfaces. Beginning with C# 13, a `ref` struct can implement interfaces, but must adhere to the [ref safety](~/_csharpstandard/standard/structs.md#1623-ref-modifier) rules. For example, a `ref struct` type can't be converted to the interface type because that requires a boxing conversion. +- Before C# 13, a `ref struct` can't be a type argument. Beginning with C# 13, a `ref struct` can be the type argument when the type parameter specifies the `allows ref struct` in its `where` clause. Typically, you define a `ref struct` type when you need a type that also includes data members of `ref struct` types: @@ -58,6 +56,28 @@ public readonly ref struct Span The `Span` type stores a reference through which it accesses the contiguous elements in memory. The use of a reference enables a `Span` instance to avoid copying the storage it refers to. +## The disposable pattern + +You can define a disposable `ref struct`. To do that, ensure that a `ref struct` fits the [disposable pattern](~/_csharplang/proposals/csharp-8.0/using.md#pattern-based-using). That is, it has an instance `Dispose` method, which is accessible, parameterless and has a `void` return type. You can use the [using statement or declaration](../statements/using.md) with an instance of a disposable `ref struct`. + +Beginning with C# 13, you can also implement the on `ref struct` types. However, overload resolution prefers the disposable pattern to the interface method. The compiler resolves to an `IDisposable.Dispose` method only whan a suitable `Dispose` method isn't found. + +## Restrictions for `ref struct` types that implement an interface + +These restrictions ensure that a `ref struct` type that implements an interface obeys the necessary [ref safety](~/_csharpstandard/standard/structs.md#1623-ref-modifier) rules. + +- A `ref struct` can't be converted to an instance of an interface it implements. This restriction includes the implicit conversion when you use a `ref struct` type as an argument when the parameter is an interface type. The conversion results in a boxing conversion, which violates ref safety. +- A `ref struct` that implements an interface *must* implement all interface members. The `ref struct` must implement members where the interface includes a default implementation. + +The compiler enforces these restrictions. If you write `ref struct` types that implement interfaces, each new update might include new [default interface members](../keywords/interface.md#default-interface-members). Until you provide an implementation for these new methods, your application won't compile. + +> [!IMPORTANT] +> A `ref struct` that implements an interface includes the potential for later source-breaking and binary-breaking changes. The break occurs if a `ref struct` implements an interface defined in another assembly, and that assembly provides an update which adds default members to that interface. +> +> The source-break happens when you recompile the `ref struct`: It must implement the new member, even though there is a default implementation. +> +> The binary-break happens if you upgrade the external assembly without recompiling the `ref struct` type *and* the updated code calls the default implementation of the new method. The runtime throws an exception when the default member is accessed. + ## C# language specification For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md): diff --git a/docs/csharp/language-reference/keywords/index.md b/docs/csharp/language-reference/keywords/index.md index 6e7ed51432ddf..7b9596109bf54 100644 --- a/docs/csharp/language-reference/keywords/index.md +++ b/docs/csharp/language-reference/keywords/index.md @@ -112,8 +112,9 @@ A contextual keyword is used to provide a specific meaning in the code, but it i :::row::: :::column::: [`add`](add.md) - [`and`](../operators/patterns.md#logical-patterns) + [`allows`](where-generic-type-constraint.md) [`alias`](extern-alias.md) + [`and`](../operators/patterns.md#logical-patterns) [`ascending`](ascending.md) [`args`](../../fundamentals/program-structure/top-level-statements.md#args) [`async`](async.md) @@ -122,10 +123,10 @@ A contextual keyword is used to provide a specific meaning in the code, but it i [`descending`](descending.md) [`dynamic`](../builtin-types/reference-types.md) [`equals`](equals.md) - [`file`](file.md) - [`from`](from-clause.md) :::column-end::: :::column::: + [`file`](file.md) + [`from`](from-clause.md) [`get`](get.md) [`global`](../operators/namespace-alias-qualifier.md) [`group`](group-clause.md) @@ -136,9 +137,9 @@ A contextual keyword is used to provide a specific meaning in the code, but it i [`managed` (function pointer calling convention)](../unsafe-code.md#function-pointers) [`nameof`](../operators/nameof.md) [`nint`](../builtin-types/integral-numeric-types.md) - [`not`](../operators/patterns.md#logical-patterns) :::column-end::: :::column::: + [`not`](../operators/patterns.md#logical-patterns) [`notnull`](../../programming-guide/generics/constraints-on-type-parameters.md#notnull-constraint) [`nuint`](../builtin-types/integral-numeric-types.md) [`on`](on.md) diff --git a/docs/csharp/language-reference/keywords/interface.md b/docs/csharp/language-reference/keywords/interface.md index d14aa6d3ad6cd..0bc2811b0dcd7 100644 --- a/docs/csharp/language-reference/keywords/interface.md +++ b/docs/csharp/language-reference/keywords/interface.md @@ -1,7 +1,7 @@ --- 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: 07/08/2022 +ms.date: 07/26/2024 f1_keywords: - "interface_CSharpKeyword" helpviewer_keywords: @@ -15,6 +15,10 @@ In the following example, class `ImplementationClass` must implement a method na For more information and examples, see [Interfaces](../../fundamentals/types/interfaces.md). +A top-level interface, one declared in a namespace but not nested inside another type, can be declared `public` or `internal`. The default is `internal`. Nested interface declarations, those declared inside another type, can be declared using any access modifier. + +Interface members without an implementation can't include an access modifier. Members with a default implementation can include any access modifier. + ## Example interface [!code-csharp[csrefKeywordsTypes#14](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csrefKeywordsTypes/CS/keywordsTypes.cs#14)] @@ -28,7 +32,12 @@ An interface can be a member of a namespace or a class. An interface declaration ## Default interface members -These preceding member declarations typically don't contain a body. An interface member may declare a body. Member bodies in an interface are the *default implementation*. Members with bodies permit the interface to provide a "default" implementation for classes and structs that don't provide an overriding implementation. An interface may include: +These preceding member declarations typically don't contain a body. An interface member may declare a body. Member bodies in an interface are the *default implementation*. Members with bodies permit the interface to provide a "default" implementation for classes and structs that don't provide an overriding implementation. + +> [!IMPORTANT] +> Adding default interfaces members forces any `ref struct` that implements the interface to add an explicit declaration of that member. + +An interface may include: - [Constants](const.md) - [Operators](../operators/operator-overloading.md) @@ -58,7 +67,11 @@ public interface INamed } ``` -An interface can inherit from one or more base interfaces. When an interface [overrides a method](override.md) implemented in a base interface, it must use the [explicit interface implementation](../../programming-guide/interfaces/explicit-interface-implementation.md) syntax. +An interface can inherit from one or more base interfaces. When an interface inherits from another interface, a type implementing the derived interface must implement all the members in the base interfaces as well as those declared in the derived interface, as shown in the following code: + +:::code language="csharp" source="./snippets/DefineTypes.cs" id="SnippetDerivedInterfaces"::: + +When an interface [overrides a method](override.md) implemented in a base interface, it must use the [explicit interface implementation](../../programming-guide/interfaces/explicit-interface-implementation.md) syntax. When a base type list contains a base class and interfaces, the base class must come first in the list. diff --git a/docs/csharp/language-reference/keywords/snippets/DefineTypes.cs b/docs/csharp/language-reference/keywords/snippets/DefineTypes.cs index e10518b60605d..4d8c92114aef9 100644 --- a/docs/csharp/language-reference/keywords/snippets/DefineTypes.cs +++ b/docs/csharp/language-reference/keywords/snippets/DefineTypes.cs @@ -47,3 +47,23 @@ static void Main() } // Output: My Point: x=2, y=3 // + +// +public interface I1 +{ + void M1(); +} + +public interface I2 : I1 +{ + void M2(); +} + +public class C : I2 +{ + // implements I1.M1 + public void M1() { } + // implements I2.M2 + public void M2() { } +} +// \ No newline at end of file diff --git a/docs/csharp/language-reference/keywords/snippets/GenericWhereConstraints.cs b/docs/csharp/language-reference/keywords/snippets/GenericWhereConstraints.cs index 73634507f559e..154d3d6cba2c0 100644 --- a/docs/csharp/language-reference/keywords/snippets/GenericWhereConstraints.cs +++ b/docs/csharp/language-reference/keywords/snippets/GenericWhereConstraints.cs @@ -49,6 +49,17 @@ class NotNullContainer } // + // + public class GenericRefStruct where T : allows ref struct + { + // Scoped is allowed because T might be a ref struct + public void M(scoped T parm) + { + + } + } + // + // public interface IMyInterface { } diff --git a/docs/csharp/language-reference/keywords/snippets/keywords.csproj b/docs/csharp/language-reference/keywords/snippets/keywords.csproj index ca4d0861cca83..4735d1c1abd23 100644 --- a/docs/csharp/language-reference/keywords/snippets/keywords.csproj +++ b/docs/csharp/language-reference/keywords/snippets/keywords.csproj @@ -2,10 +2,11 @@ Exe - net8.0 + net9.0 enable true Keywords.Program + preview diff --git a/docs/csharp/language-reference/keywords/where-generic-type-constraint.md b/docs/csharp/language-reference/keywords/where-generic-type-constraint.md index 4cb72836a70d3..279d63724867d 100644 --- a/docs/csharp/language-reference/keywords/where-generic-type-constraint.md +++ b/docs/csharp/language-reference/keywords/where-generic-type-constraint.md @@ -2,13 +2,14 @@ description: "where (generic type constraint) - C# Reference" title: "where (generic type constraint)" -ms.date: 04/28/2021 +ms.date: 07/26/2024 f1_keywords: - "whereconstraint" - "whereconstraint_CSharpKeyword" - "classconstraint_CSharpKeyword" - "structconstraint_CSharpKeyword" - "enumconstraint_CSharpKeyword" + - "allows_CsharpKeyword" helpviewer_keywords: - "where (generic type constraint) [C#]" --- @@ -27,17 +28,17 @@ The `where` clause can also include a base class constraint. The base class cons :::code language="csharp" source="snippets/GenericWhereConstraints.cs" ID="Snippet2"::: -In a nullable context, the nullability of the base class type is enforced. If the base class is non-nullable (for example `Base`), the type argument must be non-nullable. If the base class is nullable (for example `Base?`), the type argument may be either a nullable or non-nullable reference type. The compiler issues a warning if the type argument is a nullable reference type when the base class is non-nullable. +In a nullable context, the nullability of the base class type is enforced. If the base class is non-nullable (for example `Base`), the type argument must be non-nullable. If the base class is nullable (for example `Base?`), the type argument can be either a nullable or non-nullable reference type. The compiler issues a warning if the type argument is a nullable reference type when the base class is non-nullable. -The `where` clause can specify that the type is a `class` or a `struct`. The `struct` constraint removes the need to specify a base class constraint of `System.ValueType`. The `System.ValueType` type may not be used as a base class constraint. The following example shows both the `class` and `struct` constraints: +The `where` clause can specify that the type is a `class` or a `struct`. The `struct` constraint removes the need to specify a base class constraint of `System.ValueType`. The `System.ValueType` type can't be used as a base class constraint. The following example shows both the `class` and `struct` constraints: :::code language="csharp" source="snippets/GenericWhereConstraints.cs" ID="Snippet3"::: In a nullable context, the `class` constraint requires a type to be a non-nullable reference type. To allow nullable reference types, use the `class?` constraint, which allows both nullable and non-nullable reference types. -The `where` clause may include the `notnull` constraint. The `notnull` constraint limits the type parameter to non-nullable types. The type may be a [value type](../builtin-types/value-types.md) or a non-nullable reference type. The `notnull` constraint is available for code compiled in a [`nullable enable` context](../../nullable-references.md#nullable-contexts). Unlike other constraints, if a type argument violates the `notnull` constraint, the compiler generates a warning instead of an error. Warnings are only generated in a `nullable enable` context. +The `where` clause can include the `notnull` constraint. The `notnull` constraint limits the type parameter to non-nullable types. The type can be a [value type](../builtin-types/value-types.md) or a non-nullable reference type. The `notnull` constraint is available for code compiled in a [`nullable enable` context](../../nullable-references.md#nullable-contexts). Unlike other constraints, if a type argument violates the `notnull` constraint, the compiler generates a warning instead of an error. Warnings are only generated in a `nullable enable` context. -The addition of nullable reference types introduces a potential ambiguity in the meaning of `T?` in generic methods. If `T` is a `struct`, `T?` is the same as . However, if `T` is a reference type, `T?` means that `null` is a valid value. The ambiguity arises because overriding methods can't include constraints. The new `default` constraint resolves this ambiguity. You'll add it when a base class or interface declares two overloads of a method, one that specifies the `struct` constraint, and one that doesn't have either the `struct` or `class` constraint applied: +The addition of nullable reference types introduces a potential ambiguity in the meaning of `T?` in generic methods. If `T` is a `struct`, `T?` is the same as . However, if `T` is a reference type, `T?` means that `null` is a valid value. The ambiguity arises because overriding methods can't include constraints. The new `default` constraint resolves this ambiguity. You add it when a base class or interface declares two overloads of a method, one that specifies the `struct` constraint, and one that doesn't have either the `struct` or `class` constraint applied: :::code language="csharp" source="snippets/GenericWhereConstraints.cs" ID="BaseClass"::: @@ -50,15 +51,21 @@ You use the `default` constraint to specify that your derived class overrides th :::code language="csharp" source="snippets/GenericWhereConstraints.cs" ID="NotNull"::: -The `where` clause may also include an `unmanaged` constraint. The `unmanaged` constraint limits the type parameter to types known as [unmanaged types](../builtin-types/unmanaged-types.md). The `unmanaged` constraint makes it easier to write low-level interop code in C#. This constraint enables reusable routines across all unmanaged types. The `unmanaged` constraint can't be combined with the `class` or `struct` constraint. The `unmanaged` constraint enforces that the type must be a `struct`: +The `where` clause can also include an `unmanaged` constraint. The `unmanaged` constraint limits the type parameter to types known as [unmanaged types](../builtin-types/unmanaged-types.md). The `unmanaged` constraint makes it easier to write low-level interop code in C#. This constraint enables reusable routines across all unmanaged types. The `unmanaged` constraint can't be combined with the `class` or `struct` constraint. The `unmanaged` constraint enforces that the type must be a `struct`: :::code language="csharp" source="snippets/GenericWhereConstraints.cs" ID="Snippet4"::: -The `where` clause may also include a constructor constraint, `new()`. That constraint makes it possible to create an instance of a type parameter using the `new` operator. The [new() Constraint](new-constraint.md) lets the compiler know that any type argument supplied must have an accessible parameterless constructor. For example: +The `where` clause can also include a constructor constraint, `new()`. That constraint makes it possible to create an instance of a type parameter using the `new` operator. The [new() Constraint](new-constraint.md) lets the compiler know that any type argument supplied must have an accessible parameterless constructor. For example: :::code language="csharp" source="snippets/GenericWhereConstraints.cs" ID="Snippet5"::: -The `new()` constraint appears last in the `where` clause. The `new()` constraint can't be combined with the `struct` or `unmanaged` constraints. All types satisfying those constraints must have an accessible parameterless constructor, making the `new()` constraint redundant. +The `new()` constraint appears last in the `where` clause, unless it's followed by the `allows ref struct` anti-constraint. The `new()` constraint can't be combined with the `struct` or `unmanaged` constraints. All types satisfying those constraints must have an accessible parameterless constructor, making the `new()` constraint redundant. + +This anti-constraint declares that the type argument for `T` can be a `ref struct` type. For example: + +:::code language="csharp" source="snippets/GenericWhereConstraints.cs" ID="SnippetRefStruct"::: + +The generic type or method must obey ref safety rules for any instance of `T` because it might be a `ref struct`. The `allows ref struct` clause can't be combined with the `class` or `class?` constraint. The `allows ref struct` anti-constraint must follow all constraints for that type argument. With multiple type parameters, use one `where` clause for each type parameter, for example: diff --git a/docs/csharp/programming-guide/generics/constraints-on-type-parameters.md b/docs/csharp/programming-guide/generics/constraints-on-type-parameters.md index cb938180e6715..088a588f39c7a 100644 --- a/docs/csharp/programming-guide/generics/constraints-on-type-parameters.md +++ b/docs/csharp/programming-guide/generics/constraints-on-type-parameters.md @@ -1,7 +1,7 @@ --- title: "Constraints on type parameters" description: Learn about constraints on type parameters. Constraints tell the compiler what capabilities a type argument must have. -ms.date: 03/11/2024 +ms.date: 07/26/2024 f1_keywords: - "defaultconstraint_CSharpKeyword" - "notnull_CSharpKeyword" @@ -30,15 +30,18 @@ Constraints inform the compiler about the capabilities a type argument must have |`where T :` *\?*|The type argument must be or implement the specified interface. Multiple interface constraints can be specified. The constraining interface can also be generic. In a nullable context, `T` can be a nullable reference type, a non-nullable reference type, or a value type. `T` can't be a nullable value type.| |`where T : U`|The type argument supplied for `T` must be or derive from the argument supplied for `U`. In a nullable context, if `U` is a non-nullable reference type, `T` must be a non-nullable reference type. If `U` is a nullable reference type, `T` can be either nullable or non-nullable. | |`where T : default`|This constraint resolves the ambiguity when you need to specify an unconstrained type parameter when you override a method or provide an explicit interface implementation. The `default` constraint implies the base method without either the `class` or `struct` constraint. For more information, see the [`default` constraint](~/_csharplang/proposals/csharp-9.0/unconstrained-type-parameter-annotations.md#default-constraint) spec proposal.| +|`where T : allows ref struct`|This anti-constraint declares that the type argument for `T` can be a `ref struct` type. The generic type or method must obey ref safety rules for any instance of `T` because it might be a `ref struct`.| Some constraints are mutually exclusive, and some constraints must be in a specified order: - You can apply at most one of the `struct`, `class`, `class?`, `notnull`, and `unmanaged` constraints. If you supply any of these constraints, it must be the first constraint specified for that type parameter. -- The base class constraint, (`where T : Base` or `where T : Base?`), can't be combined with any of the constraints `struct`, `class`, `class?`, `notnull`, or `unmanaged`. +- The base class constraint (`where T : Base` or `where T : Base?`) can't be combined with any of the constraints `struct`, `class`, `class?`, `notnull`, or `unmanaged`. - You can apply at most one base class constraint, in either form. If you want to support the nullable base type, use `Base?`. - You can't name both the non-nullable and nullable form of an interface as a constraint. -- The `new()` constraint can't be combined with the `struct` or `unmanaged` constraint. If you specify the `new()` constraint, it must be the last constraint for that type parameter. +- The `new()` constraint can't be combined with the `struct` or `unmanaged` constraint. If you specify the `new()` constraint, it must be the last constraint for that type parameter. Anti-constraints, if applicable, can follow the `new()` constraint. - The `default` constraint can be applied only on override or explicit interface implementations. It can't be combined with either the `struct` or `class` constraints. +- The `allows ref struct` anti-constraint can't be combined with the `class` or `class?` constraint. +- The `allows ref struct` anti-constraint must follow all constraints for that type parameter. ## Why use constraints @@ -118,11 +121,11 @@ You can use or where T : IAdditionSubtraction The preceding syntax would require implementers to use [explicit interface implementation](../interfaces/explicit-interface-implementation.md) for those methods. Providing the extra constraint enables the interface to define the operators in terms of the type parameters. Types that implement the interface can implicitly implement the interface methods. +## Allows ref struct + +The `allows ref struct` anti-constraint declares that the corresponding type argument can be a [`ref struct`](../../language-reference/builtin-types/ref-struct.md) type. Instances of that type parameter must obey the following rules: + +- It can't be boxed. +- It participates in [ref safety rules](~/_csharpstandard/standard/structs.md#16412-safe-context-constraint). +- Instances can't be used where a `ref struct` type isn't allowed, such as `static` fields. +- Instances can be marked with the `scoped` modifier. + +The `allows ref struct` clause isn't inherited. In the following code: + +```csharp +class SomeClass + where T : allows ref struct + where S : T +{ + // etc +} +``` + +The argument for `S` can't be a `ref struct` because `S` doesn't have the `allows ref struct` clause. + +A type parameter that has the `allows ref struct` clause can't be used as a type argument unless the corresponding type parameter also has the `allows ref struct` clause. This rule is demonstrated in the following example: + +```csharp +public class Allow where T : allows ref struct +{ + +} + +public class Disallow +{ +} + +public class Example where T : allows ref struct +{ + private Allow fieldOne; // Allowed. T is allowed to be a ref struct + + private Disallow fieldTwo; // Error. T is not allowed to be a ref struct +} +``` + +The preceding sample shows that a type argument that might be a `ref struct` type can't be substituted for a type parameter that can't be a `ref struct` type. + ## See also - diff --git a/docs/csharp/programming-guide/generics/snippets/GenericWhereConstraints.cs b/docs/csharp/programming-guide/generics/snippets/GenericWhereConstraints.cs index 6f72e1ebf8e59..a2b9c907e1b7f 100644 --- a/docs/csharp/programming-guide/generics/snippets/GenericWhereConstraints.cs +++ b/docs/csharp/programming-guide/generics/snippets/GenericWhereConstraints.cs @@ -133,9 +133,14 @@ public interface IEmployee } // - class EmployeeList where T : Employee, System.Collections.Generic.IList, IDisposable, new() + class EmployeeList where T : notnull, Employee, IComparable, new() { // ... + public void AddDefault() + { + T t = new T(); + // ... + } } // diff --git a/docs/csharp/specification/toc.yml b/docs/csharp/specification/toc.yml index 226cac9d0431e..5c3661abc9054 100644 --- a/docs/csharp/specification/toc.yml +++ b/docs/csharp/specification/toc.yml @@ -223,6 +223,8 @@ items: href: ../../../_csharplang/proposals/csharp-8.0/default-interface-methods.md - name: Static abstracts in interfaces href: ../../../_csharplang/proposals/csharp-11.0/static-abstracts-in-interfaces.md + - name: Allow ref struct interfaces + href: ../../../_csharplang/proposals/ref-struct-interfaces.md - name: Attributes items: - name: Generic attributes diff --git a/docs/csharp/whats-new/csharp-13.md b/docs/csharp/whats-new/csharp-13.md index bdc7ad3933082..06d8aaae2b9bd 100644 --- a/docs/csharp/whats-new/csharp-13.md +++ b/docs/csharp/whats-new/csharp-13.md @@ -1,7 +1,7 @@ --- title: What's new in C# 13 description: Get an overview of the new features in C# 13. Follow the release of new preview features as .NET 9 and C# 13 previews are released. -ms.date: 05/17/2024 +ms.date: 07/26/2024 ms.topic: whats-new --- # What's new in C# 13 @@ -14,6 +14,8 @@ C# 13 includes the following new features. You can try these features using the - [Method group natural type improvements](#method-group-natural-type) - [Implicit indexer access in object initializers](#implicit-index-access) - [Enable `ref` locals and `unsafe` contexts in iterators and async methods](#ref-and-unsafe-in-iterators-and-async-methods) +- [Enable `ref struct` types to implement interfaces](#ref-struct-interfaces). +- [Allow ref struct types](#allows-ref-struct) as arguments for type parameters in generics. C# 13 is supported on **.NET 9**. For more information, see [C# language versioning](../language-reference/configure-language-version.md). @@ -43,7 +45,7 @@ You can use `\e` as a [character literal](~/_csharpstandard/standard/lexical-str ## Method group natural type -This feature makes small optimizations to overload resolution involving method groups. The previous behavior was for the compiler to construct the full set of candidate methods for a method group. If a natural type was needed, the natural type was determined from the full set of candidate methods. +This feature makes small optimizations to overload resolution involving method groups. A *method groups* is a method and all overloads with the same name. The previous behavior was for the compiler to construct the full set of candidate methods for a method group. If a natural type was needed, the natural type was determined from the full set of candidate methods. The new behavior is to prune the set of candidate methods at each scope, removing those candidate methods that aren't applicable. Typically, the removed methods are generic methods with the wrong arity, or constraints that aren't satisfied. The process continues to the next outer scope only if no candidate methods are found. This process more closely follows the general algorithm for overload resolution. If all candidate methods found at a given scope don't match, the method group doesn't have a natural type. @@ -84,6 +86,16 @@ This relaxed restriction enables the compiler to allow verifiably safe use of `r In the same fashion, C# 13 allows `unsafe` contexts in iterator methods. However, all `yield return` and `yield break` statements must be in safe contexts. +## `ref struct` interfaces + +Prior to C# 13, `ref struct` types weren't allowed to implement interfaces. Beginning with C# 13, they can. To ensure ref safety rules, a `ref struct` type can't be converted to an interface type. That is a boxing conversion, and could violate ref safety. Learn more in the updates on [`ref struct` types](../language-reference/builtin-types/ref-struct.md#restrictions-for-ref-struct-types-that-implement-an-interface). + +## `allows ref struct` + +Prior to C# 13, `ref struct` types couldn't be declared as the type argument for a generic type or method. Now, generic type declarations can add an anti-constraint, `allows ref struct`. This anti-constraint declares that the type argument supplied for that type parameter can be a `ref struct` type. The compiler enforces ref safety rules on all instances of that type parameter. + +This enables types such as and to be used with generic algorithms, where applicable. You can learn more in the updates for [`where`](../language-reference/keywords/where-generic-type-constraint.md) and the programming guide article on [generic constraints](../programming-guide/generics/constraints-on-type-parameters.md). + ## See also - [What's new in .NET 9](../../core/whats-new/dotnet-9/overview.md) diff --git a/samples/snippets/core/testing/unit-testing-using-nunit/csharp/PrimeService.Tests/PrimeService.Tests.csproj b/samples/snippets/core/testing/unit-testing-using-nunit/csharp/PrimeService.Tests/PrimeService.Tests.csproj index 5f704da36fc52..ac2aedf77bf2f 100644 --- a/samples/snippets/core/testing/unit-testing-using-nunit/csharp/PrimeService.Tests/PrimeService.Tests.csproj +++ b/samples/snippets/core/testing/unit-testing-using-nunit/csharp/PrimeService.Tests/PrimeService.Tests.csproj @@ -10,7 +10,7 @@ - + all diff --git a/samples/snippets/core/testing/unit-testing-vb-nunit/vb/PrimeService.Tests/PrimeService.Tests.vbproj b/samples/snippets/core/testing/unit-testing-vb-nunit/vb/PrimeService.Tests/PrimeService.Tests.vbproj index ee78241f0cd23..c85fe0bd682a7 100644 --- a/samples/snippets/core/testing/unit-testing-vb-nunit/vb/PrimeService.Tests/PrimeService.Tests.vbproj +++ b/samples/snippets/core/testing/unit-testing-vb-nunit/vb/PrimeService.Tests/PrimeService.Tests.vbproj @@ -9,7 +9,7 @@ - +