diff --git a/.openpublishing.redirection.csharp.json b/.openpublishing.redirection.csharp.json index b1ed3d04e88c3..6c7877e96a4e3 100644 --- a/.openpublishing.redirection.csharp.json +++ b/.openpublishing.redirection.csharp.json @@ -10,15 +10,15 @@ }, { "source_path_from_root": "/redirections/proposals/csharp-7.0/local-functions.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/statements#1264-local-function-declarations" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/statements#1364-local-function-declarations" }, { "source_path_from_root": "/redirections/proposals/csharp-7.0/throw-expression.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1115-the-throw-expression-operator" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1215-the-throw-expression-operator" }, { "source_path_from_root": "/redirections/proposals/csharp-7.0/out-var.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1117-declaration-expressions" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1217-declaration-expressions" }, { "source_path_from_root": "/redirections/proposals/csharp-7.0/pattern-matching.md", @@ -34,7 +34,7 @@ }, { "source_path_from_root": "/redirections/proposals/csharp-7.1/target-typed-default.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#11719-default-value-expressions" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#12719-default-value-expressions" }, { "source_path_from_root": "/redirections/proposals/csharp-7.1/infer-tuple-names.md", @@ -50,11 +50,11 @@ }, { "source_path_from_root": "/redirections/proposals/csharp-7.2/non-trailing-named-arguments.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#11621-general" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#12621-general" }, { "source_path_from_root": "/redirections/proposals/csharp-7.2/private-protected.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/classes#1436-access-modifiers" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/classes#1536-access-modifiers" }, { "source_path_from_root": "/redirections/proposals/csharp-7.2/readonly-ref.md", @@ -62,7 +62,7 @@ }, { "source_path_from_root": "/redirections/proposals/csharp-7.2/readonly-struct.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/structs#1524-struct-interfaces" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/structs#1624-struct-interfaces" }, { "source_path_from_root": "/redirections/proposals/csharp-7.2/span-safety.md", @@ -70,23 +70,23 @@ }, { "source_path_from_root": "/redirections/proposals/csharp-7.3/auto-prop-field-attrs.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/attributes#213-attribute-specification" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/attributes#223-attribute-specification" }, { "source_path_from_root": "/redirections/proposals/csharp-7.3/blittable.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/classes#1425-type-parameter-constraints" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/classes#1525-type-parameter-constraints" }, { "source_path_from_root": "/redirections/proposals/csharp-7.3/expression-variables-in-initializers.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1117-declaration-expressions" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1217-declaration-expressions" }, { "source_path_from_root": "/redirections/proposals/csharp-7.3/improved-overload-candidates.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#11642-applicable-function-member" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#12642-applicable-function-member" }, { "source_path_from_root": "/redirections/proposals/csharp-7.3/indexing-movable-fixed-fields.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#2283-fixed-size-buffers-in-expressions" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#2383-fixed-size-buffers-in-expressions" }, { "source_path_from_root": "/redirections/proposals/csharp-7.3/leading-digit-separator.md", @@ -94,7 +94,7 @@ }, { "source_path_from_root": "/redirections/proposals/csharp-7.3/pattern-based-fixed.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#227-the-fixed-statement" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#237-the-fixed-statement" }, { "source_path_from_root": "/redirections/proposals/csharp-7.3/ref-local-reassignment.md", @@ -106,7 +106,7 @@ }, { "source_path_from_root": "/redirections/proposals/csharp-7.3/tuple-equality.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#111211-tuple-equality-operators" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#121211-tuple-equality-operators" }, { "source_path_from_root": "/redirections/proposals/csharp-10.0/generic-attributes.md", @@ -1312,6 +1312,10 @@ "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-8.0/index.md", "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-8.0/nullable-reference-types" }, + { + "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-8.0/static-local-functions.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/statements.md#1364-local-function-declarations" + }, { "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-9.0/index.md", "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-9.0/records" @@ -1324,6 +1328,10 @@ "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-11.0/index.md", "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-11.0/static-abstracts-in-interfaces" }, + { + "source_path_from_root": "/docs/csharp/language-reference/specifications.md", + "redirect_url": "/dotnet/csharp/specifications" + }, { "source_path_from_root": "/docs/csharp/linq/create-a-nested-group.md", "redirect_url": "/dotnet/csharp/linq/standard-query-operators/grouping-data" diff --git a/.openpublishing.redirection.framework.json b/.openpublishing.redirection.framework.json index bce63e5baa30f..48974d5b4cdbd 100644 --- a/.openpublishing.redirection.framework.json +++ b/.openpublishing.redirection.framework.json @@ -1898,6 +1898,66 @@ "source_path_from_root": "/docs/framework/network-programming/httplistener.md", "redirect_url": "/dotnet/api/system.net.httplistener" }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/index.md", + "redirect_url": "/dotnet/framework/reflection-and-codedom/reflection" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/accessing-custom-attributes.md", + "redirect_url": "/dotnet/fundamentals/reflection/accessing-custom-attributes" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/collectible-assemblies.md", + "redirect_url": "/dotnet/fundamentals/reflection/collectible-assemblies" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/dynamically-loading-and-using-types.md", + "redirect_url": "/dotnet/fundamentals/reflection/dynamically-loading-and-using-types" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/emitting-dynamic-methods-and-assemblies.md", + "redirect_url": "/dotnet/fundamentals/reflection/emitting-dynamic-methods-and-assemblies" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/get-type-member-information.md", + "redirect_url": "/dotnet/fundamentals/reflection/get-type-member-information" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/how-to-define-a-generic-method-with-reflection-emit.md", + "redirect_url": "/dotnet/fundamentals/reflection/how-to-define-a-generic-method-with-reflection-emit" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/how-to-define-a-generic-type-with-reflection-emit.md", + "redirect_url": "/dotnet/fundamentals/reflection/how-to-define-a-generic-type-with-reflection-emit" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/how-to-define-and-execute-dynamic-methods.md", + "redirect_url": "/dotnet/fundamentals/reflection/how-to-define-and-execute-dynamic-methods" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/how-to-examine-and-instantiate-generic-types-with-reflection.md", + "redirect_url": "/dotnet/fundamentals/reflection/how-to-examine-and-instantiate-generic-types-with-reflection" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/how-to-hook-up-a-delegate-using-reflection.md", + "redirect_url": "/dotnet/fundamentals/reflection/how-to-hook-up-a-delegate-using-reflection" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/reflection-and-generic-types.md", + "redirect_url": "/dotnet/fundamentals/reflection/reflection-and-generic-types" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/reflection.md", + "redirect_url": "/dotnet/fundamentals/reflection/reflection" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/specifying-fully-qualified-type-names.md", + "redirect_url": "/dotnet/fundamentals/reflection/specifying-fully-qualified-type-names" + }, + { + "source_path_from_root": "/docs/framework/reflection-and-codedom/viewing-type-information.md", + "redirect_url": "/dotnet/fundamentals/reflection/viewing-type-information" + }, { "source_path_from_root": "/docs/framework/resources/creating-resource-files-for-desktop-apps.md", "redirect_url": "/dotnet/core/extensions/create-resource-files", diff --git a/docfx.json b/docfx.json index fa740336ad420..482aed5b78ab3 100644 --- a/docfx.json +++ b/docfx.json @@ -67,6 +67,7 @@ "csharp-8.0/notnull-constraint.md", "csharp-8.0/obsolete-accessor.md", "csharp-8.0/shadowing-in-nested-functions.md", + "csharp-8.0/static-local-functions.md", "csharp-8.0/unconstrained-null-coalescing.md", "csharp-8.0/nullable-reference-types-specification.md" ] @@ -591,7 +592,6 @@ "_csharplang/proposals/csharp-8.0/using.md": "Pattern based using and using declarations", "_csharplang/proposals/csharp-8.0/null-coalescing-assignment.md": "Null coalescing assignment", "_csharplang/proposals/csharp-8.0/readonly-instance-members.md": "Readonly instance members", - "_csharplang/proposals/csharp-8.0/static-local-functions.md": "Static local functions", "_csharplang/proposals/csharp-8.0/nested-stackalloc.md": "Nested stackalloc expressions", "_csharplang/proposals/csharp-9.0/covariant-returns.md": "Covariant return types", "_csharplang/proposals/csharp-9.0/extending-partial-methods.md": "Extending partial methods", @@ -705,7 +705,6 @@ "_csharplang/proposals/csharp-8.0/using.md": "This feature specification supports pattern based using and using declarations to simplify resource cleanup.", "_csharplang/proposals/csharp-8.0/null-coalescing-assignment.md": "This feature specification describes the syntax to support null coalescing assignment expressions using the '??=' operator.", "_csharplang/proposals/csharp-8.0/readonly-instance-members.md": "This feature specification describes the syntax for declaring and using readonly instance members.", - "_csharplang/proposals/csharp-8.0/static-local-functions.md": "This feature specification describes static local functions, which are local functions that cannot access variables in the enclosing scope.", "_csharplang/proposals/csharp-8.0/nested-stackalloc.md": "This feature specification describes nested stackalloc expressions, which provides nested arrays of stackalloc storage.", "_csharplang/proposals/csharp-9.0/covariant-returns.md": "This feature specification describes covariant return types, where overriding member declarations can return a type derived from the overridden member declaration.", "_csharplang/proposals/csharp-9.0/extending-partial-methods.md": "This feature specification describes extensions to partial methods. These extensions enable source generators to create or call partial methods.", diff --git a/docs/ai/get-started-app-chat-scaling-with-azure-container-apps.md b/docs/ai/get-started-app-chat-scaling-with-azure-container-apps.md index 1804ca2b9b836..2babbad8cd0d2 100644 --- a/docs/ai/get-started-app-chat-scaling-with-azure-container-apps.md +++ b/docs/ai/get-started-app-chat-scaling-with-azure-container-apps.md @@ -3,7 +3,7 @@ title: Scale Azure OpenAI for .NET chat sample using RAG description: Learn how to add load balancing to your application to extend the chat app beyond the Azure OpenAI token and model quota limits. ms.date: 03/11/2024 ms.topic: get-started -ms.custom: devx-track-java, devx-track-java-ai +ms.custom: devx-track-dotnet, devx-track-dotnet-ai # CustomerIntent: As a .NET developer new to Azure OpenAI, I want to scale my Azure OpenAI capacity to avoid rate limit errors with Azure Container Apps. --- diff --git a/docs/architecture/microservices/multi-container-microservice-net-applications/rabbitmq-event-bus-development-test-environment.md b/docs/architecture/microservices/multi-container-microservice-net-applications/rabbitmq-event-bus-development-test-environment.md index f570083d18892..72d9c1bddd8e3 100644 --- a/docs/architecture/microservices/multi-container-microservice-net-applications/rabbitmq-event-bus-development-test-environment.md +++ b/docs/architecture/microservices/multi-container-microservice-net-applications/rabbitmq-event-bus-development-test-environment.md @@ -112,6 +112,9 @@ For production scenarios check the additional resources below, specific for Rabb A production-ready solution with support for RabbitMQ. +- **Peregrine Connect** - Simplify your integration with efficient design, deployment, and management of apps, APIs, and workflows \ + + - **NServiceBus** - Fully-supported commercial service bus with advanced management and monitoring tooling for .NET \ diff --git a/docs/azure/includes/dotnet-all.md b/docs/azure/includes/dotnet-all.md index 037bd4781b0a8..95449afcda217 100644 --- a/docs/azure/includes/dotnet-all.md +++ b/docs/azure/includes/dotnet-all.md @@ -57,7 +57,7 @@ | Media Analytics Edge | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Media.Analytics.Edge/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Media.Analytics.Edge-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Media.Analytics.Edge_1.0.0-beta.1/sdk/mediaservices/Azure.Media.Analytics.Edge) | | Metrics Advisor | NuGet [1.1.0](https://www.nuget.org/packages/Azure.AI.MetricsAdvisor/1.1.0) | [docs](/dotnet/api/overview/azure/AI.MetricsAdvisor-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.MetricsAdvisor_1.1.0/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/) | | Microsoft Purview | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Analytics.Purview.DataMap/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Analytics.Purview.DataMap-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.DataMap_1.0.0-beta.1/sdk/purview/Azure.Analytics.Purview.DataMap/) | -| Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents | NuGet [1.0.0-beta.5](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/1.0.0-beta.5) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents_1.0.0-beta.5/sdk/entra/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/) | +| Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents | NuGet [1.0.0-beta.6](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/1.0.0-beta.6) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.6](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents_1.0.0-beta.6/sdk/entra/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/) | | Mixed Reality Authentication | NuGet [1.2.0](https://www.nuget.org/packages/Azure.MixedReality.Authentication/1.2.0) | [docs](/dotnet/api/overview/azure/MixedReality.Authentication-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.MixedReality.Authentication_1.2.0/sdk/mixedreality/Azure.MixedReality.Authentication/) | | Monitor Ingestion | NuGet [1.1.1](https://www.nuget.org/packages/Azure.Monitor.Ingestion/1.1.1) | [docs](/dotnet/api/overview/azure/Monitor.Ingestion-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Ingestion_1.1.1/sdk/monitor/Azure.Monitor.Ingestion/) | | Monitor Query | NuGet [1.2.0](https://www.nuget.org/packages/Azure.Monitor.Query/1.2.0)
NuGet [1.3.0-beta.2](https://www.nuget.org/packages/Azure.Monitor.Query/1.3.0-beta.2) | [docs](/dotnet/api/overview/azure/Monitor.Query-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Query_1.2.0/sdk/monitor/Azure.Monitor.Query/)
GitHub [1.3.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Query_1.3.0-beta.2/sdk/monitor/Azure.Monitor.Query/) | @@ -91,6 +91,12 @@ | Tables | NuGet [12.8.3](https://www.nuget.org/packages/Azure.Data.Tables/12.8.3) | [docs](/dotnet/api/overview/azure/Data.Tables-readme) | GitHub [12.8.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Data.Tables_12.8.3/sdk/tables/Azure.Data.Tables/) | | Text Analytics | NuGet [5.3.0](https://www.nuget.org/packages/Azure.AI.TextAnalytics/5.3.0) | [docs](/dotnet/api/overview/azure/AI.TextAnalytics-readme) | GitHub [5.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.TextAnalytics_5.3.0/sdk/textanalytics/Azure.AI.TextAnalytics/) | | Text Translation | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.AI.Translation.Text/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/AI.Translation.Text-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Translation.Text_1.0.0-beta.1/sdk/translation/Azure.AI.Translation.Text/) | +| unknown | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Communication.CallingServer/1.0.0-beta.3) | | GitHub [1.0.0-beta.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.CallingServer_1.0.0-beta.3/sdk/communication/Azure.Communication.CallingServer/) | +| unknown | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Core.Expressions.DataFactory/1.0.0) | | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Core.Expressions.DataFactory_1.0.0/sdk/core/Azure.Core.Expressions.DataFactory/) | +| unknown | NuGet [1.0.0-preview.5](https://www.nuget.org/packages/Azure.IoT.ModelsRepository/1.0.0-preview.5) | | GitHub [1.0.0-preview.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.IoT.ModelsRepository_1.0.0-preview.5/sdk/modelsrepository/Azure.IoT.ModelsRepository/) | +| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.IoT.TimeSeriesInsights/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.IoT.TimeSeriesInsights_1.0.0-beta.1/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/) | +| unknown | NuGet [0.1.0-beta.2](https://www.nuget.org/packages/Azure.Provisioning/0.1.0-beta.2) | | GitHub [0.1.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning_0.1.0-beta.2/sdk/provisioning/Azure.Provisioning/) | +| unknown | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Security.CodeTransparency/1.0.0-beta.2) | | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Security.CodeTransparency_1.0.0-beta.2/sdk/confidentialledger/Azure.Security.CodeTransparency/) | | Video Analyzer Edge | NuGet [1.0.0-beta.6](https://www.nuget.org/packages/Azure.Media.VideoAnalyzer.Edge/1.0.0-beta.6) | [docs](/dotnet/api/overview/azure/Media.VideoAnalyzer.Edge-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.6](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Media.VideoAnalyzer.Edge_1.0.0-beta.6/sdk/videoanalyzer/Azure.Media.VideoAnalyzer.Edge/) | | Vision Common | NuGet [0.15.1-beta.1](https://www.nuget.org/packages/Azure.AI.Vision.Common/0.15.1-beta.1) | | GitHub [0.15.1-beta.1](https://msasg.visualstudio.com/Skyman/_git/Carbon) | | Web PubSub | NuGet [1.3.0](https://www.nuget.org/packages/Azure.Messaging.WebPubSub/1.3.0) | [docs](/dotnet/api/overview/azure/Messaging.WebPubSub-readme) | GitHub [1.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.WebPubSub_1.3.0/sdk/webpubsub/Azure.Messaging.WebPubSub/) | @@ -149,7 +155,7 @@ | Resource Management - Container Service | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.ContainerService/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerService-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerService_1.2.0/sdk/containerservice/Azure.ResourceManager.ContainerService/) | | Resource Management - Container Service Fleet | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.ContainerServiceFleet/1.0.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerServiceFleet-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerServiceFleet_1.0.0/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/) | | Resource Management - Content Delivery Network | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.Cdn/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.Cdn-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Cdn_1.2.0/sdk/cdn/Azure.ResourceManager.Cdn/) | -| Resource Management - Cosmos DB | NuGet [1.3.2](https://www.nuget.org/packages/Azure.ResourceManager.CosmosDB/1.3.2)
NuGet [1.4.0-beta.6](https://www.nuget.org/packages/Azure.ResourceManager.CosmosDB/1.4.0-beta.6) | [docs](/dotnet/api/overview/azure/ResourceManager.CosmosDB-readme) | GitHub [1.3.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CosmosDB_1.3.2/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/)
GitHub [1.4.0-beta.6](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CosmosDB_1.4.0-beta.6/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/) | +| Resource Management - Cosmos DB | NuGet [1.3.2](https://www.nuget.org/packages/Azure.ResourceManager.CosmosDB/1.3.2)
NuGet [1.4.0-beta.7](https://www.nuget.org/packages/Azure.ResourceManager.CosmosDB/1.4.0-beta.7) | [docs](/dotnet/api/overview/azure/ResourceManager.CosmosDB-readme) | GitHub [1.3.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CosmosDB_1.3.2/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/)
GitHub [1.4.0-beta.7](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CosmosDB_1.4.0-beta.7/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/) | | Resource Management - Cosmos DB for PostgreSQL | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.CosmosDBForPostgreSql/1.0.0)
NuGet [1.1.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.CosmosDBForPostgreSql/1.1.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.CosmosDBForPostgreSql-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CosmosDBForPostgreSql_1.0.0/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/)
GitHub [1.1.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CosmosDBForPostgreSql_1.1.0-beta.1/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/) | | Resource Management - Costmanagement | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.CostManagement/1.0.1) | [docs](/dotnet/api/overview/azure/ResourceManager.CostManagement-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CostManagement_1.0.1/sdk/costmanagement/Azure.ResourceManager.CostManagement/) | | 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/) | @@ -170,6 +176,7 @@ | Resource Management - Dev Spaces | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.DevSpaces/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.DevSpaces-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.DevSpaces_1.0.0-beta.4/sdk/devspaces/Azure.ResourceManager.DevSpaces/) | | Resource Management - Device Provisioning Services | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.DeviceProvisioningServices/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DeviceProvisioningServices-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DeviceProvisioningServices_1.2.0/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/) | | Resource Management - Device Update | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.DeviceUpdate/1.0.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DeviceUpdate-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DeviceUpdate_1.0.0/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/) | +| Resource Management - Deviceregistry | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.DeviceRegistry/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DeviceRegistry_1.0.0-beta.1/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/) | | Resource Management - DevTest Labs | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.DevTestLabs/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DevTestLabs-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DevTestLabs_1.1.0/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/) | | Resource Management - Digital Twins | NuGet [1.3.0](https://www.nuget.org/packages/Azure.ResourceManager.DigitalTwins/1.3.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DigitalTwins-readme) | GitHub [1.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DigitalTwins_1.3.0/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/) | | Resource Management - DNS | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.Dns/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.Dns-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Dns_1.1.0/sdk/dns/Azure.ResourceManager.Dns/) | @@ -180,7 +187,7 @@ | Resource Management - ElasticSan | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.ElasticSan/1.0.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ElasticSan-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ElasticSan_1.0.0/sdk/elasticsan/Azure.ResourceManager.ElasticSan/) | | Resource Management - Energy Services | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.ResourceManager.EnergyServices/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/ResourceManager.EnergyServices-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.EnergyServices_1.0.0-beta.2/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/) | | Resource Management - Event Grid | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.EventGrid/1.0.1)
NuGet [1.1.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.EventGrid/1.1.0-beta.4) | [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.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventGrid_1.1.0-beta.4/sdk/eventgrid/Azure.ResourceManager.EventGrid/) | -| Resource Management - Event Hubs | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.EventHubs/1.0.1)
NuGet [1.1.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.EventHubs/1.1.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.EventHubs-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventHubs_1.0.1/sdk/eventhub/Azure.ResourceManager.EventHubs/)
GitHub [1.1.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventHubs_1.1.0-beta.4/sdk/eventhub/Azure.ResourceManager.EventHubs/) | +| Resource Management - Event Hubs | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.EventHubs/1.0.1)
NuGet [1.1.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.EventHubs/1.1.0-beta.5) | [docs](/dotnet/api/overview/azure/ResourceManager.EventHubs-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventHubs_1.0.1/sdk/eventhub/Azure.ResourceManager.EventHubs/)
GitHub [1.1.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventHubs_1.1.0-beta.5/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 - 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.2.0](https://www.nuget.org/packages/Azure.ResourceManager.FrontDoor/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.FrontDoor-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.FrontDoor_1.2.0/sdk/frontdoor/Azure.ResourceManager.FrontDoor/) | @@ -237,7 +244,7 @@ | Resource Management - Peering | NuGet [1.2.1](https://www.nuget.org/packages/Azure.ResourceManager.Peering/1.2.1) | [docs](/dotnet/api/overview/azure/ResourceManager.Peering-readme) | GitHub [1.2.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Peering_1.2.1/sdk/peering/Azure.ResourceManager.Peering/) | | Resource Management - Playwrighttesting | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.PlaywrightTesting/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.PlaywrightTesting-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.PlaywrightTesting_1.0.0-beta.1/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/) | | Resource Management - Policy Insights | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.PolicyInsights/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.PolicyInsights-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.PolicyInsights_1.2.0/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/) | -| Resource Management - PostgreSQL | NuGet [1.1.3](https://www.nuget.org/packages/Azure.ResourceManager.PostgreSql/1.1.3)
NuGet [1.2.0-beta.3](https://www.nuget.org/packages/Azure.ResourceManager.PostgreSql/1.2.0-beta.3) | [docs](/dotnet/api/overview/azure/ResourceManager.PostgreSql-readme) | GitHub [1.1.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.PostgreSql_1.1.3/sdk/postgresql/Azure.ResourceManager.PostgreSql/)
GitHub [1.2.0-beta.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.PostgreSql_1.2.0-beta.3/sdk/postgresql/Azure.ResourceManager.PostgreSql/) | +| Resource Management - PostgreSQL | NuGet [1.1.3](https://www.nuget.org/packages/Azure.ResourceManager.PostgreSql/1.1.3)
NuGet [1.2.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.PostgreSql/1.2.0-beta.5) | [docs](/dotnet/api/overview/azure/ResourceManager.PostgreSql-readme) | GitHub [1.1.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.PostgreSql_1.1.3/sdk/postgresql/Azure.ResourceManager.PostgreSql/)
GitHub [1.2.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.PostgreSql_1.2.0-beta.5/sdk/postgresql/Azure.ResourceManager.PostgreSql/) | | Resource Management - Power BI Dedicated | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.PowerBIDedicated/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.PowerBIDedicated-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.PowerBIDedicated_1.0.0-beta.4/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/) | | Resource Management - Private DNS | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.PrivateDns/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.PrivateDns-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.PrivateDns_1.1.0/sdk/privatedns/Azure.ResourceManager.PrivateDns/) | | Resource Management - Provider Hub | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.ProviderHub/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ProviderHub-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ProviderHub_1.1.0/sdk/providerhub/Azure.ResourceManager.ProviderHub/) | @@ -264,14 +271,14 @@ | Resource Management - Security DevOps | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.SecurityDevOps/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.SecurityDevOps-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.SecurityDevOps_1.0.0-beta.4/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/) | | Resource Management - Security Insights | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.SecurityInsights/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.SecurityInsights-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.SecurityInsights_1.1.0/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/) | | Resource Management - Self Help | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.SelfHelp/1.0.0)
NuGet [1.1.0-beta.2](https://www.nuget.org/packages/Azure.ResourceManager.SelfHelp/1.1.0-beta.2) | [docs](/dotnet/api/overview/azure/ResourceManager.SelfHelp-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.SelfHelp_1.0.0/sdk/selfhelp/Azure.ResourceManager.SelfHelp/)
GitHub [1.1.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.SelfHelp_1.1.0-beta.2/sdk/selfhelp/Azure.ResourceManager.SelfHelp/) | -| Resource Management - Service Bus | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.ServiceBus/1.0.1)
NuGet [1.1.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.ServiceBus/1.1.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.ServiceBus-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceBus_1.0.1/sdk/servicebus/Azure.ResourceManager.ServiceBus/)
GitHub [1.1.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceBus_1.1.0-beta.4/sdk/servicebus/Azure.ResourceManager.ServiceBus/) | +| Resource Management - Service Bus | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.ServiceBus/1.0.1)
NuGet [1.1.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.ServiceBus/1.1.0-beta.5) | [docs](/dotnet/api/overview/azure/ResourceManager.ServiceBus-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceBus_1.0.1/sdk/servicebus/Azure.ResourceManager.ServiceBus/)
GitHub [1.1.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceBus_1.1.0-beta.5/sdk/servicebus/Azure.ResourceManager.ServiceBus/) | | Resource Management - Service Fabric | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.ServiceFabric/1.1.0)
NuGet [1.2.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.ServiceFabric/1.2.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.ServiceFabric-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceFabric_1.1.0/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/)
GitHub [1.2.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceFabric_1.2.0-beta.1/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/) | | Resource Management - Service Fabric Managed Clusters | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.ServiceFabricManagedClusters/1.0.1)
NuGet [1.1.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.ServiceFabricManagedClusters/1.1.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.ServiceFabricManagedClusters-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceFabricManagedClusters_1.0.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/)
GitHub [1.1.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceFabricManagedClusters_1.1.0-beta.4/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/) | | Resource Management - Service Linker | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.ServiceLinker/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ServiceLinker-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceLinker_1.1.0/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/) | | Resource Management - Service Networking | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.ServiceNetworking/1.0.1) | [docs](/dotnet/api/overview/azure/ResourceManager.ServiceNetworking-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceNetworking_1.0.1/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/) | | Resource Management - SignalR | NuGet [1.1.1](https://www.nuget.org/packages/Azure.ResourceManager.SignalR/1.1.1) | [docs](/dotnet/api/overview/azure/ResourceManager.SignalR-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.SignalR_1.1.1/sdk/signalr/Azure.ResourceManager.SignalR/) | | Resource Management - Sphere | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.Sphere/1.0.0) | [docs](/dotnet/api/overview/azure/ResourceManager.Sphere-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Sphere_1.0.0/sdk/sphere/Azure.ResourceManager.Sphere/) | -| Resource Management - SQL | NuGet [1.2.1](https://www.nuget.org/packages/Azure.ResourceManager.Sql/1.2.1)
NuGet [1.3.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.Sql/1.3.0-beta.5) | [docs](/dotnet/api/overview/azure/ResourceManager.Sql-readme) | GitHub [1.2.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Sql_1.2.1/sdk/sqlmanagement/Azure.ResourceManager.Sql/)
GitHub [1.3.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Sql_1.3.0-beta.5/sdk/sqlmanagement/Azure.ResourceManager.Sql/) | +| Resource Management - SQL | NuGet [1.2.1](https://www.nuget.org/packages/Azure.ResourceManager.Sql/1.2.1)
NuGet [1.3.0-beta.6](https://www.nuget.org/packages/Azure.ResourceManager.Sql/1.3.0-beta.6) | [docs](/dotnet/api/overview/azure/ResourceManager.Sql-readme) | GitHub [1.2.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Sql_1.2.1/sdk/sqlmanagement/Azure.ResourceManager.Sql/)
GitHub [1.3.0-beta.6](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Sql_1.3.0-beta.6/sdk/sqlmanagement/Azure.ResourceManager.Sql/) | | Resource Management - SQL Virtual Machine | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.SqlVirtualMachine/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.SqlVirtualMachine-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.SqlVirtualMachine_1.1.0/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/) | | Resource Management - Storage | NuGet [1.2.1](https://www.nuget.org/packages/Azure.ResourceManager.Storage/1.2.1) | [docs](/dotnet/api/overview/azure/ResourceManager.Storage-readme) | GitHub [1.2.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Storage_1.2.1/sdk/storage/Azure.ResourceManager.Storage/) | | Resource Management - Storage Cache | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.StorageCache/1.2.0)
NuGet [1.3.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.StorageCache/1.3.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.StorageCache-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.StorageCache_1.2.0/sdk/storagecache/Azure.ResourceManager.StorageCache/)
GitHub [1.3.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.StorageCache_1.3.0-beta.1/sdk/storagecache/Azure.ResourceManager.StorageCache/) | @@ -288,12 +295,12 @@ | Resource Management - Workload Monitor | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.WorkloadMonitor/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.WorkloadMonitor-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.WorkloadMonitor_1.0.0-beta.4/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/) | | Resource Management - Workloads | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.Workloads/1.1.0)
NuGet [1.2.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.Workloads/1.2.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.Workloads-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Workloads_1.1.0/sdk/workloads/Azure.ResourceManager.Workloads/)
GitHub [1.2.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Workloads_1.2.0-beta.1/sdk/workloads/Azure.ResourceManager.Workloads/) | | Spring App Discovery | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.SpringAppDiscovery/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.SpringAppDiscovery-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.SpringAppDiscovery_1.0.0-beta.1/sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/) | +| Standby Pool | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.StandbyPool/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.StandbyPool_1.0.0-beta.1/sdk/standbypool/Azure.ResourceManager.StandbyPool/) | +| unknown | NuGet [1.0.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.ScVmm/1.0.0-beta.5) | | GitHub [1.0.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ScVmm_1.0.0-beta.5/sdk/scvmm/Azure.ResourceManager.ScVmm/) | | Azure.Communication.Administration | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Communication.Administration/1.0.0-beta.3) | | | -| Azure.Communication.CallingServer | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Communication.CallingServer/1.0.0-beta.3) | | | -| Azure.Core.Expressions.DataFactory | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Core.Expressions.DataFactory/1.0.0) | | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Core.Expressions.DataFactory_1.0.0/sdk/core/Azure.Core.Expressions.DataFactory/) | | Communication Calling Windows Client | NuGet [1.5.0](https://www.nuget.org/packages/Azure.Communication.Calling.WindowsClient/1.5.0) | | | -| Unknown Display Name | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Security.CodeTransparency/1.0.0-beta.1) | | | | Unknown Display Name | NuGet [12.0.0-beta.1](https://www.nuget.org/packages/Azure.Storage.DataMovement.Files.Shares/12.0.0-beta.1) | | | +| Unknown Display Name | NuGet [0.7.6](https://www.nuget.org/packages/DotNetty.Common/0.7.6) | | | | Unknown Display Name | NuGet [1.0.2](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.Analyzers/1.0.2) | | | | Unknown Display Name | NuGet [4.0.2945](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.ItemTemplates.NetCore/4.0.2945) | | | | Unknown Display Name | NuGet [4.0.2945](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.ItemTemplates.NetFx/4.0.2945) | | | @@ -322,7 +329,7 @@ | Common - Authentication | NuGet [1.7.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Common.Authentication/1.7.0-preview) | | | | 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.37.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.37.1)
NuGet [3.39.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.39.0-preview.1) | [docs](/dotnet/api/overview/azure/cosmosdb) | GitHub [3.37.1](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/3.12.0/Microsoft.Azure.Cosmos) | +| Cosmos DB | NuGet [3.37.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.37.1)
NuGet [3.39.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.39.0-preview.1) | [docs](https://learn.microsoft.com/dotnet/api/overview/azure/cosmosdb) | GitHub [3.37.1](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) | @@ -339,16 +346,15 @@ | Entity Search | NuGet [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.EntitySearch/2.0.0) | | | | Event Hubs - Service Fabric Processor | NuGet [0.5.4](https://www.nuget.org/packages/Microsoft.Azure.EventHubs.ServiceFabricProcessor/0.5.4) | | GitHub [0.5.4](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.EventHubs.ServiceFabricProcessor_0.5.4/sdk/eventhub/Microsoft.Azure.EventHubs.ServiceFabricProcessor/) | | Face | NuGet [2.8.0-preview.3](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.Face/2.8.0-preview.3) | | GitHub [2.8.0-preview.3](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Vision.Face_2.6.0-preview.1/sdk/cognitiveservices/Vision.Face) | -| Feature Management | NuGet [3.0.0](https://www.nuget.org/packages/Microsoft.FeatureManagement/3.0.0) | [docs](/dotnet/api/microsoft.featuremanagement) | | +| Feature Management | NuGet [3.0.0](https://www.nuget.org/packages/Microsoft.FeatureManagement/3.0.0) | [docs](https://learn.microsoft.com/dotnet/api/microsoft.featuremanagement) | | | Gallery | NuGet [2.6.2-preview](https://www.nuget.org/packages/Microsoft.Azure.Gallery/2.6.2-preview) | | | | HDInsight - Job | NuGet [3.0.0-preview.3](https://www.nuget.org/packages/Microsoft.Azure.HDInsight.Job/3.0.0-preview.3) | | GitHub [3.0.0-preview.3](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.HDInsight.Job_3.0.0-preview.3/sdk/hdinsight/Microsoft.Azure.HDInsight.Job/) | | Image Search | NuGet [2.1.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.BingImageSearch/2.1.0-preview.1) | | GitHub [2.1.0-preview.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Search.BingImageSearch_2.1.0-preview.1/sdk/cognitiveservices/Search.BingImageSearch) | | Image Search | NuGet [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.ImageSearch/2.0.0) | | | | IoT Edge Function | NuGet [3.5.3](https://www.nuget.org/packages/Microsoft.Azure.IoT.Edge.Function/3.5.3) | | | -| IoT Models Repository | NuGet [1.0.0-preview.5](https://www.nuget.org/packages/Azure.IoT.ModelsRepository/1.0.0-preview.5) | | | | IoT Plug and Play - Devices Client | NuGet [1.42.2](https://www.nuget.org/packages/Microsoft.Azure.Devices.Client/1.42.2)
NuGet [2.0.0-preview007](https://www.nuget.org/packages/Microsoft.Azure.Devices.Client/2.0.0-preview007) | | | -| Kusto Data | NuGet [9.3.1](https://www.nuget.org/packages/Microsoft.Azure.Kusto.Data/9.3.1) | [docs](/azure/data-explorer/kusto/api/netfx/about-kusto-data) | GitHub [9.3.1](https://github.com/Azure/azure-kusto-dotnet) | -| Kusto Ingest | NuGet [9.3.1](https://www.nuget.org/packages/Microsoft.Azure.Kusto.Ingest/9.3.1) | [docs](/azure/data-explorer/kusto/api/netfx/about-kusto-ingest) | GitHub [9.3.1](https://github.com/Azure/azure-kusto-dotnet) | +| Kusto Data | NuGet [9.3.1](https://www.nuget.org/packages/Microsoft.Azure.Kusto.Data/9.3.1) | [docs](https://learn.microsoft.com/azure/data-explorer/kusto/api/netfx/about-kusto-data) | GitHub [9.3.1](https://github.com/Azure/azure-kusto-dotnet) | +| Kusto Ingest | NuGet [9.3.1](https://www.nuget.org/packages/Microsoft.Azure.Kusto.Ingest/9.3.1) | [docs](https://learn.microsoft.com/azure/data-explorer/kusto/api/netfx/about-kusto-ingest) | GitHub [9.3.1](https://github.com/Azure/azure-kusto-dotnet) | | Local Search | NuGet [1.0.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.BingLocalSearch/1.0.0-preview.1) | | GitHub [1.0.0-preview.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Search.BingLocalSearch_1.0.0-preview.1/sdk/cognitiveservices/Search.BingLocalSearch) | | Local Search | NuGet [0.9.0-preview](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.LocalSearch/0.9.0-preview) | | | | LUIS Authoring | NuGet [3.1.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring/3.1.0)
NuGet [3.2.0-preview.5](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring/3.2.0-preview.5) | | GitHub [3.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring_3.2.0-preview.3/sdk/cognitiveservices/Language.LUIS.Authoring) | @@ -379,7 +385,7 @@ | Notification Hubs | NuGet [4.2.0](https://www.nuget.org/packages/Microsoft.Azure.NotificationHubs/4.2.0) | | GitHub [4.2.0](https://github.com/Azure/azure-notificationhubs-dotnet) | | Personalizer | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Personalizer/1.0.0) | | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Personalizer_1.0.0/sdk/cognitiveservices/Personalizer) | | Quantum Jobs | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Quantum.Jobs/1.0.0-beta.3) | | | -| Relay | NuGet [3.0.1](https://www.nuget.org/packages/Microsoft.Azure.Relay/3.0.1) | [docs](/dotnet/api/overview/azure/service-bus-relay) | GitHub [3.0.1](https://github.com/Azure/azure-relay-dotnet/tree/2.0.1) | +| Relay | NuGet [3.0.1](https://www.nuget.org/packages/Microsoft.Azure.Relay/3.0.1) | [docs](https://learn.microsoft.com/dotnet/api/overview/azure/service-bus-relay) | GitHub [3.0.1](https://github.com/Azure/azure-relay-dotnet/tree/2.0.1) | | Schema Registry - Avro | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Microsoft.Azure.Kafka.SchemaRegistry.Avro/1.0.0-beta.1) | | | | Schema Registry - JSON | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Microsoft.Azure.Kafka.SchemaRegistry.Json/1.0.0-beta.1) | | | | 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/) | @@ -390,10 +396,9 @@ | 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) | | Spring Cloud Client | NuGet [2.0.0-preview.3](https://www.nuget.org/packages/Microsoft.Azure.SpringCloud.Client/2.0.0-preview.3) | | | -| Storage - Files Data Lake | NuGet [2.0.0-alpha.2](https://www.nuget.org/packages/Microsoft.Azure.DataLake.Store/2.0.0-alpha.2) | [docs](/dotnet/api/overview/azure/data-lake-store) | GitHub [2.0.0-alpha.2](https://github.com/Azure/azure-data-lake-store-net/tree/1.2.3-alpha) | +| Storage - Files Data Lake | NuGet [2.0.0-alpha.2](https://www.nuget.org/packages/Microsoft.Azure.DataLake.Store/2.0.0-alpha.2) | [docs](https://learn.microsoft.com/dotnet/api/overview/azure/data-lake-store) | GitHub [2.0.0-alpha.2](https://github.com/Azure/azure-data-lake-store-net/tree/1.2.3-alpha) | | Synapse Analytics | NuGet [0.1.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Synapse/0.1.0-preview) | | GitHub [0.1.0-preview](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Synapse_0.1.0-preview/sdk/synapse/Microsoft.Azure.Synapse/) | | Tables | NuGet [2.1.2](https://www.nuget.org/packages/Microsoft.Azure.CosmosDB.Table/2.1.2) | | | -| Time Series Insights | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.IoT.TimeSeriesInsights/1.0.0-beta.1) | | | | Video Search | NuGet [2.1.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.BingVideoSearch/2.1.0-preview.1) | | GitHub [2.1.0-preview.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Search.BingVideoSearch_2.1.0-preview.1/sdk/cognitiveservices/Search.BingVideoSearch) | | Video Search | NuGet [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.VideoSearch/2.0.0) | | | | Vision Content Moderator | NuGet [2.1.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.ContentModerator/2.1.0-preview.1) | | GitHub [2.1.0-preview.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Vision.ContentModerator_2.1.0-preview.1/sdk/cognitiveservices/Vision.ContentModerator) | @@ -418,7 +423,7 @@ | Functions extension for Blob Storage | NuGet [5.2.2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/5.2.2) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs-readme) | | | Functions extension for Cosmos DB | NuGet [4.5.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.CosmosDB/4.5.0) | | GitHub [4.5.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.1](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/3.0.0-rc.1) | [docs](/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) | +| 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.1](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/3.0.0-rc.1) | [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) | | Functions extension for Durable Task Framework - isolated worker | NuGet [1.1.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask/1.1.0)
NuGet [1.2.0-rc.1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask/1.2.0-rc.1) | | | | Functions extension for HTTP | NuGet [3.2.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Http/3.2.0) | | GitHub [3.2.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) | diff --git a/docs/azure/includes/dotnet-new.md b/docs/azure/includes/dotnet-new.md index 0962d8abfd17a..ddb05db6834d8 100644 --- a/docs/azure/includes/dotnet-new.md +++ b/docs/azure/includes/dotnet-new.md @@ -58,7 +58,7 @@ | Media Analytics Edge | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Media.Analytics.Edge/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Media.Analytics.Edge-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Media.Analytics.Edge_1.0.0-beta.1/sdk/mediaservices/Azure.Media.Analytics.Edge) | | Metrics Advisor | NuGet [1.1.0](https://www.nuget.org/packages/Azure.AI.MetricsAdvisor/1.1.0) | [docs](/dotnet/api/overview/azure/AI.MetricsAdvisor-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.MetricsAdvisor_1.1.0/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/) | | Microsoft Purview | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Analytics.Purview.DataMap/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Analytics.Purview.DataMap-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.DataMap_1.0.0-beta.1/sdk/purview/Azure.Analytics.Purview.DataMap/) | -| Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents | NuGet [1.0.0-beta.5](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/1.0.0-beta.5) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents_1.0.0-beta.5/sdk/entra/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/) | +| Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents | NuGet [1.0.0-beta.6](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/1.0.0-beta.6) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.6](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents_1.0.0-beta.6/sdk/entra/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/) | | Mixed Reality Authentication | NuGet [1.2.0](https://www.nuget.org/packages/Azure.MixedReality.Authentication/1.2.0) | [docs](/dotnet/api/overview/azure/MixedReality.Authentication-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.MixedReality.Authentication_1.2.0/sdk/mixedreality/Azure.MixedReality.Authentication/) | | Monitor Ingestion | NuGet [1.1.1](https://www.nuget.org/packages/Azure.Monitor.Ingestion/1.1.1) | [docs](/dotnet/api/overview/azure/Monitor.Ingestion-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Ingestion_1.1.1/sdk/monitor/Azure.Monitor.Ingestion/) | | Monitor Query | NuGet [1.2.0](https://www.nuget.org/packages/Azure.Monitor.Query/1.2.0)
NuGet [1.3.0-beta.2](https://www.nuget.org/packages/Azure.Monitor.Query/1.3.0-beta.2) | [docs](/dotnet/api/overview/azure/Monitor.Query-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Query_1.2.0/sdk/monitor/Azure.Monitor.Query/)
GitHub [1.3.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Query_1.3.0-beta.2/sdk/monitor/Azure.Monitor.Query/) | @@ -93,6 +93,12 @@ | Tables | NuGet [12.8.3](https://www.nuget.org/packages/Azure.Data.Tables/12.8.3) | [docs](/dotnet/api/overview/azure/Data.Tables-readme) | GitHub [12.8.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Data.Tables_12.8.3/sdk/tables/Azure.Data.Tables/) | | Text Analytics | NuGet [5.3.0](https://www.nuget.org/packages/Azure.AI.TextAnalytics/5.3.0) | [docs](/dotnet/api/overview/azure/AI.TextAnalytics-readme) | GitHub [5.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.TextAnalytics_5.3.0/sdk/textanalytics/Azure.AI.TextAnalytics/) | | Text Translation | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.AI.Translation.Text/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/AI.Translation.Text-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Translation.Text_1.0.0-beta.1/sdk/translation/Azure.AI.Translation.Text/) | +| unknown | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Communication.CallingServer/1.0.0-beta.3) | | GitHub [1.0.0-beta.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.CallingServer_1.0.0-beta.3/sdk/communication/Azure.Communication.CallingServer/) | +| unknown | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Core.Expressions.DataFactory/1.0.0) | | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Core.Expressions.DataFactory_1.0.0/sdk/core/Azure.Core.Expressions.DataFactory/) | +| unknown | NuGet [1.0.0-preview.5](https://www.nuget.org/packages/Azure.IoT.ModelsRepository/1.0.0-preview.5) | | GitHub [1.0.0-preview.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.IoT.ModelsRepository_1.0.0-preview.5/sdk/modelsrepository/Azure.IoT.ModelsRepository/) | +| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.IoT.TimeSeriesInsights/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.IoT.TimeSeriesInsights_1.0.0-beta.1/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/) | +| unknown | NuGet [0.1.0-beta.2](https://www.nuget.org/packages/Azure.Provisioning/0.1.0-beta.2) | | GitHub [0.1.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning_0.1.0-beta.2/sdk/provisioning/Azure.Provisioning/) | +| unknown | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Security.CodeTransparency/1.0.0-beta.2) | | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Security.CodeTransparency_1.0.0-beta.2/sdk/confidentialledger/Azure.Security.CodeTransparency/) | | Video Analyzer Edge | NuGet [1.0.0-beta.6](https://www.nuget.org/packages/Azure.Media.VideoAnalyzer.Edge/1.0.0-beta.6) | [docs](/dotnet/api/overview/azure/Media.VideoAnalyzer.Edge-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.6](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Media.VideoAnalyzer.Edge_1.0.0-beta.6/sdk/videoanalyzer/Azure.Media.VideoAnalyzer.Edge/) | | Vision Common | NuGet [0.15.1-beta.1](https://www.nuget.org/packages/Azure.AI.Vision.Common/0.15.1-beta.1) | | GitHub [0.15.1-beta.1](https://msasg.visualstudio.com/Skyman/_git/Carbon) | | Web PubSub | NuGet [1.3.0](https://www.nuget.org/packages/Azure.Messaging.WebPubSub/1.3.0) | [docs](/dotnet/api/overview/azure/Messaging.WebPubSub-readme) | GitHub [1.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.WebPubSub_1.3.0/sdk/webpubsub/Azure.Messaging.WebPubSub/) | @@ -151,7 +157,7 @@ | Resource Management - Container Service | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.ContainerService/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerService-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerService_1.2.0/sdk/containerservice/Azure.ResourceManager.ContainerService/) | | Resource Management - Container Service Fleet | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.ContainerServiceFleet/1.0.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ContainerServiceFleet-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ContainerServiceFleet_1.0.0/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/) | | Resource Management - Content Delivery Network | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.Cdn/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.Cdn-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Cdn_1.2.0/sdk/cdn/Azure.ResourceManager.Cdn/) | -| Resource Management - Cosmos DB | NuGet [1.3.2](https://www.nuget.org/packages/Azure.ResourceManager.CosmosDB/1.3.2)
NuGet [1.4.0-beta.6](https://www.nuget.org/packages/Azure.ResourceManager.CosmosDB/1.4.0-beta.6) | [docs](/dotnet/api/overview/azure/ResourceManager.CosmosDB-readme) | GitHub [1.3.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CosmosDB_1.3.2/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/)
GitHub [1.4.0-beta.6](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CosmosDB_1.4.0-beta.6/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/) | +| Resource Management - Cosmos DB | NuGet [1.3.2](https://www.nuget.org/packages/Azure.ResourceManager.CosmosDB/1.3.2)
NuGet [1.4.0-beta.7](https://www.nuget.org/packages/Azure.ResourceManager.CosmosDB/1.4.0-beta.7) | [docs](/dotnet/api/overview/azure/ResourceManager.CosmosDB-readme) | GitHub [1.3.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CosmosDB_1.3.2/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/)
GitHub [1.4.0-beta.7](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CosmosDB_1.4.0-beta.7/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/) | | Resource Management - Cosmos DB for PostgreSQL | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.CosmosDBForPostgreSql/1.0.0)
NuGet [1.1.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.CosmosDBForPostgreSql/1.1.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.CosmosDBForPostgreSql-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CosmosDBForPostgreSql_1.0.0/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/)
GitHub [1.1.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CosmosDBForPostgreSql_1.1.0-beta.1/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/) | | Resource Management - Costmanagement | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.CostManagement/1.0.1) | [docs](/dotnet/api/overview/azure/ResourceManager.CostManagement-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.CostManagement_1.0.1/sdk/costmanagement/Azure.ResourceManager.CostManagement/) | | 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/) | @@ -172,6 +178,7 @@ | Resource Management - Dev Spaces | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.DevSpaces/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.DevSpaces-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.DevSpaces_1.0.0-beta.4/sdk/devspaces/Azure.ResourceManager.DevSpaces/) | | Resource Management - Device Provisioning Services | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.DeviceProvisioningServices/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DeviceProvisioningServices-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DeviceProvisioningServices_1.2.0/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/) | | Resource Management - Device Update | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.DeviceUpdate/1.0.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DeviceUpdate-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DeviceUpdate_1.0.0/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/) | +| Resource Management - Deviceregistry | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.DeviceRegistry/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DeviceRegistry_1.0.0-beta.1/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/) | | Resource Management - DevTest Labs | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.DevTestLabs/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DevTestLabs-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DevTestLabs_1.1.0/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/) | | Resource Management - Digital Twins | NuGet [1.3.0](https://www.nuget.org/packages/Azure.ResourceManager.DigitalTwins/1.3.0) | [docs](/dotnet/api/overview/azure/ResourceManager.DigitalTwins-readme) | GitHub [1.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.DigitalTwins_1.3.0/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/) | | Resource Management - DNS | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.Dns/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.Dns-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Dns_1.1.0/sdk/dns/Azure.ResourceManager.Dns/) | @@ -182,7 +189,7 @@ | Resource Management - ElasticSan | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.ElasticSan/1.0.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ElasticSan-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ElasticSan_1.0.0/sdk/elasticsan/Azure.ResourceManager.ElasticSan/) | | Resource Management - Energy Services | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.ResourceManager.EnergyServices/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/ResourceManager.EnergyServices-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.EnergyServices_1.0.0-beta.2/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/) | | Resource Management - Event Grid | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.EventGrid/1.0.1)
NuGet [1.1.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.EventGrid/1.1.0-beta.4) | [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.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventGrid_1.1.0-beta.4/sdk/eventgrid/Azure.ResourceManager.EventGrid/) | -| Resource Management - Event Hubs | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.EventHubs/1.0.1)
NuGet [1.1.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.EventHubs/1.1.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.EventHubs-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventHubs_1.0.1/sdk/eventhub/Azure.ResourceManager.EventHubs/)
GitHub [1.1.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventHubs_1.1.0-beta.4/sdk/eventhub/Azure.ResourceManager.EventHubs/) | +| Resource Management - Event Hubs | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.EventHubs/1.0.1)
NuGet [1.1.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.EventHubs/1.1.0-beta.5) | [docs](/dotnet/api/overview/azure/ResourceManager.EventHubs-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventHubs_1.0.1/sdk/eventhub/Azure.ResourceManager.EventHubs/)
GitHub [1.1.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.EventHubs_1.1.0-beta.5/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 - 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.2.0](https://www.nuget.org/packages/Azure.ResourceManager.FrontDoor/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.FrontDoor-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.FrontDoor_1.2.0/sdk/frontdoor/Azure.ResourceManager.FrontDoor/) | @@ -240,7 +247,7 @@ | Resource Management - Peering | NuGet [1.2.1](https://www.nuget.org/packages/Azure.ResourceManager.Peering/1.2.1) | [docs](/dotnet/api/overview/azure/ResourceManager.Peering-readme) | GitHub [1.2.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Peering_1.2.1/sdk/peering/Azure.ResourceManager.Peering/) | | Resource Management - Playwrighttesting | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.PlaywrightTesting/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.PlaywrightTesting-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.PlaywrightTesting_1.0.0-beta.1/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/) | | Resource Management - Policy Insights | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.PolicyInsights/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.PolicyInsights-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.PolicyInsights_1.2.0/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/) | -| Resource Management - PostgreSQL | NuGet [1.1.3](https://www.nuget.org/packages/Azure.ResourceManager.PostgreSql/1.1.3)
NuGet [1.2.0-beta.3](https://www.nuget.org/packages/Azure.ResourceManager.PostgreSql/1.2.0-beta.3) | [docs](/dotnet/api/overview/azure/ResourceManager.PostgreSql-readme) | GitHub [1.1.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.PostgreSql_1.1.3/sdk/postgresql/Azure.ResourceManager.PostgreSql/)
GitHub [1.2.0-beta.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.PostgreSql_1.2.0-beta.3/sdk/postgresql/Azure.ResourceManager.PostgreSql/) | +| Resource Management - PostgreSQL | NuGet [1.1.3](https://www.nuget.org/packages/Azure.ResourceManager.PostgreSql/1.1.3)
NuGet [1.2.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.PostgreSql/1.2.0-beta.5) | [docs](/dotnet/api/overview/azure/ResourceManager.PostgreSql-readme) | GitHub [1.1.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.PostgreSql_1.1.3/sdk/postgresql/Azure.ResourceManager.PostgreSql/)
GitHub [1.2.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.PostgreSql_1.2.0-beta.5/sdk/postgresql/Azure.ResourceManager.PostgreSql/) | | Resource Management - Power BI Dedicated | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.PowerBIDedicated/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.PowerBIDedicated-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.PowerBIDedicated_1.0.0-beta.4/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/) | | Resource Management - Private DNS | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.PrivateDns/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.PrivateDns-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.PrivateDns_1.1.0/sdk/privatedns/Azure.ResourceManager.PrivateDns/) | | Resource Management - Provider Hub | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.ProviderHub/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ProviderHub-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ProviderHub_1.1.0/sdk/providerhub/Azure.ResourceManager.ProviderHub/) | @@ -267,14 +274,14 @@ | Resource Management - Security DevOps | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.SecurityDevOps/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.SecurityDevOps-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.SecurityDevOps_1.0.0-beta.4/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/) | | Resource Management - Security Insights | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.SecurityInsights/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.SecurityInsights-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.SecurityInsights_1.1.0/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/) | | Resource Management - Self Help | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.SelfHelp/1.0.0)
NuGet [1.1.0-beta.2](https://www.nuget.org/packages/Azure.ResourceManager.SelfHelp/1.1.0-beta.2) | [docs](/dotnet/api/overview/azure/ResourceManager.SelfHelp-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.SelfHelp_1.0.0/sdk/selfhelp/Azure.ResourceManager.SelfHelp/)
GitHub [1.1.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.SelfHelp_1.1.0-beta.2/sdk/selfhelp/Azure.ResourceManager.SelfHelp/) | -| Resource Management - Service Bus | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.ServiceBus/1.0.1)
NuGet [1.1.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.ServiceBus/1.1.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.ServiceBus-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceBus_1.0.1/sdk/servicebus/Azure.ResourceManager.ServiceBus/)
GitHub [1.1.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceBus_1.1.0-beta.4/sdk/servicebus/Azure.ResourceManager.ServiceBus/) | +| Resource Management - Service Bus | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.ServiceBus/1.0.1)
NuGet [1.1.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.ServiceBus/1.1.0-beta.5) | [docs](/dotnet/api/overview/azure/ResourceManager.ServiceBus-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceBus_1.0.1/sdk/servicebus/Azure.ResourceManager.ServiceBus/)
GitHub [1.1.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceBus_1.1.0-beta.5/sdk/servicebus/Azure.ResourceManager.ServiceBus/) | | Resource Management - Service Fabric | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.ServiceFabric/1.1.0)
NuGet [1.2.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.ServiceFabric/1.2.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.ServiceFabric-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceFabric_1.1.0/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/)
GitHub [1.2.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceFabric_1.2.0-beta.1/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/) | | Resource Management - Service Fabric Managed Clusters | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.ServiceFabricManagedClusters/1.0.1)
NuGet [1.1.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.ServiceFabricManagedClusters/1.1.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.ServiceFabricManagedClusters-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceFabricManagedClusters_1.0.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/)
GitHub [1.1.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceFabricManagedClusters_1.1.0-beta.4/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/) | | Resource Management - Service Linker | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.ServiceLinker/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.ServiceLinker-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceLinker_1.1.0/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/) | | Resource Management - Service Networking | NuGet [1.0.1](https://www.nuget.org/packages/Azure.ResourceManager.ServiceNetworking/1.0.1) | [docs](/dotnet/api/overview/azure/ResourceManager.ServiceNetworking-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ServiceNetworking_1.0.1/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/) | | Resource Management - SignalR | NuGet [1.1.1](https://www.nuget.org/packages/Azure.ResourceManager.SignalR/1.1.1) | [docs](/dotnet/api/overview/azure/ResourceManager.SignalR-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.SignalR_1.1.1/sdk/signalr/Azure.ResourceManager.SignalR/) | | Resource Management - Sphere | NuGet [1.0.0](https://www.nuget.org/packages/Azure.ResourceManager.Sphere/1.0.0) | [docs](/dotnet/api/overview/azure/ResourceManager.Sphere-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Sphere_1.0.0/sdk/sphere/Azure.ResourceManager.Sphere/) | -| Resource Management - SQL | NuGet [1.2.1](https://www.nuget.org/packages/Azure.ResourceManager.Sql/1.2.1)
NuGet [1.3.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.Sql/1.3.0-beta.5) | [docs](/dotnet/api/overview/azure/ResourceManager.Sql-readme) | GitHub [1.2.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Sql_1.2.1/sdk/sqlmanagement/Azure.ResourceManager.Sql/)
GitHub [1.3.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Sql_1.3.0-beta.5/sdk/sqlmanagement/Azure.ResourceManager.Sql/) | +| Resource Management - SQL | NuGet [1.2.1](https://www.nuget.org/packages/Azure.ResourceManager.Sql/1.2.1)
NuGet [1.3.0-beta.6](https://www.nuget.org/packages/Azure.ResourceManager.Sql/1.3.0-beta.6) | [docs](/dotnet/api/overview/azure/ResourceManager.Sql-readme) | GitHub [1.2.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Sql_1.2.1/sdk/sqlmanagement/Azure.ResourceManager.Sql/)
GitHub [1.3.0-beta.6](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Sql_1.3.0-beta.6/sdk/sqlmanagement/Azure.ResourceManager.Sql/) | | Resource Management - SQL Virtual Machine | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.SqlVirtualMachine/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.SqlVirtualMachine-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.SqlVirtualMachine_1.1.0/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/) | | Resource Management - Storage | NuGet [1.2.1](https://www.nuget.org/packages/Azure.ResourceManager.Storage/1.2.1) | [docs](/dotnet/api/overview/azure/ResourceManager.Storage-readme) | GitHub [1.2.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Storage_1.2.1/sdk/storage/Azure.ResourceManager.Storage/) | | Resource Management - Storage Cache | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.StorageCache/1.2.0)
NuGet [1.3.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.StorageCache/1.3.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.StorageCache-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.StorageCache_1.2.0/sdk/storagecache/Azure.ResourceManager.StorageCache/)
GitHub [1.3.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.StorageCache_1.3.0-beta.1/sdk/storagecache/Azure.ResourceManager.StorageCache/) | @@ -291,3 +298,5 @@ | Resource Management - Workload Monitor | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.ResourceManager.WorkloadMonitor/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/ResourceManager.WorkloadMonitor-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.WorkloadMonitor_1.0.0-beta.4/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/) | | Resource Management - Workloads | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.Workloads/1.1.0)
NuGet [1.2.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.Workloads/1.2.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.Workloads-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Workloads_1.1.0/sdk/workloads/Azure.ResourceManager.Workloads/)
GitHub [1.2.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Workloads_1.2.0-beta.1/sdk/workloads/Azure.ResourceManager.Workloads/) | | Spring App Discovery | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.SpringAppDiscovery/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.SpringAppDiscovery-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.SpringAppDiscovery_1.0.0-beta.1/sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/) | +| Standby Pool | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.StandbyPool/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.StandbyPool_1.0.0-beta.1/sdk/standbypool/Azure.ResourceManager.StandbyPool/) | +| unknown | NuGet [1.0.0-beta.5](https://www.nuget.org/packages/Azure.ResourceManager.ScVmm/1.0.0-beta.5) | | GitHub [1.0.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.ScVmm_1.0.0-beta.5/sdk/scvmm/Azure.ResourceManager.ScVmm/) | diff --git a/docs/breadcrumb/toc.yml b/docs/breadcrumb/toc.yml index b3d1d0780fd57..afe158b2c49c8 100644 --- a/docs/breadcrumb/toc.yml +++ b/docs/breadcrumb/toc.yml @@ -170,7 +170,7 @@ items: topicHref: /dotnet/framework/performance/index - name: Dynamic programming tocHref: /dotnet/framework/reflection-and-codedom/ - topicHref: /dotnet/framework/reflection-and-codedom/index + topicHref: /dotnet/framework/reflection-and-codedom/dynamic-language-runtime-overview - name: Resources in desktop apps tocHref: /dotnet/framework/resources/ topicHref: /dotnet/framework/resources/index diff --git a/docs/core/deploying/native-aot/interop.md b/docs/core/deploying/native-aot/interop.md index f0f3b3f2ef4d9..665287e9cba91 100644 --- a/docs/core/deploying/native-aot/interop.md +++ b/docs/core/deploying/native-aot/interop.md @@ -79,4 +79,5 @@ Examples: The Native AOT compiler exports methods annotated with with a nonempty `EntryPoint` property as public C entry points. This makes it possible to either dynamically or statically link the AOT compiled modules into external -programs. For more information, see [NativeLibrary sample](https://github.com/dotnet/samples/tree/main/core/nativeaot/NativeLibrary/README.md). +programs. Only methods marked `UnmanagedCallersOnly` in the published assembly are considered. Methods in project references or NuGet packages won't be exported. +For more information, see [NativeLibrary sample](https://github.com/dotnet/samples/tree/main/core/nativeaot/NativeLibrary/README.md). diff --git a/docs/core/deploying/single-file/overview.md b/docs/core/deploying/single-file/overview.md index 734cf495a1543..d0a910d209dca 100644 --- a/docs/core/deploying/single-file/overview.md +++ b/docs/core/deploying/single-file/overview.md @@ -13,7 +13,7 @@ Bundling all application-dependent files into a single binary provides an applic The size of the single file in a self-contained application is large since it includes the runtime and the framework libraries. In .NET 6, you can [publish trimmed](../trimming/trim-self-contained.md) to reduce the total size of trim-compatible applications. The single file deployment option can be combined with [ReadyToRun](../ready-to-run.md) and [Trim](../trimming/trim-self-contained.md) publish options. -> [IMPORTANT] +> [!IMPORTANT] > To run a single file app on Windows 7, you must use .NET Runtime 6.0.3 or later. ## Sample project file diff --git a/docs/core/docker/publish-as-container.md b/docs/core/docker/publish-as-container.md index 5de4952dca87b..252418d6946b3 100644 --- a/docs/core/docker/publish-as-container.md +++ b/docs/core/docker/publish-as-container.md @@ -1,7 +1,7 @@ --- title: Containerize an app with dotnet publish description: In this tutorial, you'll learn how to containerize a .NET application with dotnet publish command and without the use of a Dockerfile. -ms.date: 03/20/2024 +ms.date: 03/27/2024 ms.topic: tutorial zone_pivot_groups: dotnet-version-7-8 --- @@ -83,7 +83,7 @@ Attempting to cancel the build... The worker template loops indefinitely. Use the cancel command Ctrl+C to stop it. -:::zone pivot="dotnet-7-0" +:::zone pivot="dotnet-7-0,dotnet-8-0" ## Add NuGet package @@ -101,7 +101,10 @@ To enable SDK container support, set the `EnableSdkContainerSupport` property to ``` -Otherwise, if you're not using .NET SDK version 8.0.200 or later, you need to add the required [Microsoft.NET.Build.Containers](https://www.nuget.org/packages/Microsoft.NET.Build.Containers) NuGet package to publish non-web projects as a container. To add the `Microsoft.NET.Build.Containers` NuGet package to the worker template, run the following [dotnet add package](../tools/dotnet-add-package.md) command: +:::zone-end +:::zone pivot="dotnet-7-0" + +You need to reference the required [Microsoft.NET.Build.Containers](https://www.nuget.org/packages/Microsoft.NET.Build.Containers) NuGet package to publish non-web projects as a container. To add the `Microsoft.NET.Build.Containers` NuGet package to the worker template, run the following [dotnet add package](../tools/dotnet-add-package.md) command: ```dotnetcli dotnet add package Microsoft.NET.Build.Containers diff --git a/docs/core/porting/net-framework-tech-unavailable.md b/docs/core/porting/net-framework-tech-unavailable.md index 6907136db1d88..55d840734edf2 100644 --- a/docs/core/porting/net-framework-tech-unavailable.md +++ b/docs/core/porting/net-framework-tech-unavailable.md @@ -59,7 +59,7 @@ Windows Workflow Foundation (WF) is not supported in .NET 6+. For an alternative - - -In .NET 9, a persisted `AssemblyBuilder` was implemented and the method was added back to the reflection emit library. To learn more about how to use this API, see [System.Reflection.Emit.AssemblyBuilder class](../../fundamentals/runtime-libraries/system-reflection-emit-assemblybuilder.md#persistable-dynamic-assemblies-in-net-core). +In .NET 9, a persisted `AssemblyBuilder` was implemented and the method was added back to the reflection emit library. To learn more about how to use this API, see [System.Reflection.Emit.AssemblyBuilder class](../../fundamentals/runtime-libraries/system-reflection-emit-assemblybuilder.md#persistable-dynamic-assemblies-in-net). For more information, see [dotnet/runtime issue 15704](https://github.com/dotnet/runtime/issues/15704). diff --git a/docs/core/tools/dotnet-test.md b/docs/core/tools/dotnet-test.md index 8000f4a591c06..d62a895eaf13d 100644 --- a/docs/core/tools/dotnet-test.md +++ b/docs/core/tools/dotnet-test.md @@ -1,7 +1,7 @@ --- title: dotnet test command description: The dotnet test command is used to execute unit tests in a given project. -ms.date: 03/17/2022 +ms.date: 03/27/2024 --- # dotnet test @@ -52,7 +52,7 @@ dotnet test -h|--help The `dotnet test` command is used to execute unit tests in a given solution. The `dotnet test` command builds the solution and runs a test host application for each test project in the solution. The test host executes tests in the given project using a test framework, for example: MSTest, NUnit, or xUnit, and reports the success or failure of each test. If all tests are successful, the test runner returns 0 as an exit code; otherwise if any test fails, it returns 1. -For multi-targeted projects, tests are run for each targeted framework. The test host and the unit test framework are packaged as NuGet packages and are restored as ordinary dependencies for the project. +For multi-targeted projects, tests are run for each targeted framework. The test host and the unit test framework are packaged as NuGet packages and are restored as ordinary dependencies for the project. Starting with the .NET 9 SDK, these tests are run in parallel by default. To disable parallel execution, set the `TestTfmsInParallel` MSBuild property to `false`. For more information, see [Run tests in parallel](../whats-new/dotnet-9/overview.md#run-tests-in-parallel) and the [example command line later in this article](#testtfmsinparallel). Test projects specify the test runner using an ordinary `` element, as seen in the following sample project file: @@ -325,6 +325,14 @@ Where `Microsoft.NET.Test.Sdk` is the test host, `xunit` is the test framework. dotnet test ~/projects/test1/test1.csproj -p:DefineConstants="DEV" ``` + + +- Run the tests in the `test1` project, setting the MSBuild `TestTfmsInParallel` property to `false`: + + ```dotnetcli + dotnet test ~/projects/test1/test1.csproj -p:TestTfmsInParallel=false + ``` + ## Filter option details `--filter ` diff --git a/docs/core/tools/sdk-errors/netsdk1045.md b/docs/core/tools/sdk-errors/netsdk1045.md index 2130f1c0c33b4..f857918e362e0 100644 --- a/docs/core/tools/sdk-errors/netsdk1045.md +++ b/docs/core/tools/sdk-errors/netsdk1045.md @@ -36,6 +36,10 @@ Each version of the .NET SDK is available in both x86 and x64 architecture. The If the version you need isn't installed, find the one you need at the [.NET Downloads](https://dotnet.microsoft.com/download/dotnet) page. +### Visual Studio version + +The .NET SDK might have been installed with Visual Studio 2022, so upgrading to a later version of Visual Studio might install a later .NET SDK and resolve this error. For more information, see [Update Visual Studio](/visualstudio/install/update-visual-studio). + ## Preview not enabled If you have a preview installed of the requested .NET SDK version, you also need to set the option to enable previews in Visual Studio. Go to **Tools** > **Options** > **Environment** > **Preview Features**, and make sure that **Use previews of the .NET Core SDK** is checked. diff --git a/docs/core/whats-new/dotnet-8/containers.md b/docs/core/whats-new/dotnet-8/containers.md index c6216987381f2..c99005a3157ba 100644 --- a/docs/core/whats-new/dotnet-8/containers.md +++ b/docs/core/whats-new/dotnet-8/containers.md @@ -33,6 +33,8 @@ The default container tag is now `latest`. This default is in line with other to The container images now use [Debian 12 (Bookworm)](https://wiki.debian.org/DebianBookworm). Debian is the default Linux distro in the .NET container images. +For more information, see [Debian container images upgraded to Debian 12](../../compatibility/containers/8.0/debian-version.md). + ### Non-root user Images include a `non-root` user. This user makes the images `non-root` capable. To run as `non-root`, add the following line at the end of your Dockerfile (or a similar instruction in your Kubernetes manifests): @@ -45,6 +47,8 @@ USER app The default port also changed from port `80` to `8080`. To support this change, a new environment variable `ASPNETCORE_HTTP_PORTS` is available to make it easier to change ports. The variable accepts a list of ports, which is simpler than the format required by `ASPNETCORE_URLS`. If you change the port back to port `80` using one of these variables, you can't run as `non-root`. +For more information, see [Default ASP.NET Core port changed from 80 to 8080](../../compatibility/containers/8.0/aspnet-port.md) and [New non-root 'app' user in Linux images](../../compatibility/containers/8.0/app-user.md). + ### Chiseled Ubuntu images [Chiseled Ubuntu images](https://hub.docker.com/r/ubuntu/dotnet-deps) are available for .NET 8. Chiseled images have a reduced attacked surface because they're ultra-small, have no package manager or shell, and are `non-root`. This type of image is for developers who want the benefit of appliance-style computing. Chiseled images are published to the [.NET nightly artifact registry](https://mcr.microsoft.com/product/dotnet/nightly/aspnet/tags). diff --git a/docs/csharp/advanced-topics/reflection-and-attributes/generics-and-reflection.md b/docs/csharp/advanced-topics/reflection-and-attributes/generics-and-reflection.md index 6a168ac29bede..82e1df08ea0de 100644 --- a/docs/csharp/advanced-topics/reflection-and-attributes/generics-and-reflection.md +++ b/docs/csharp/advanced-topics/reflection-and-attributes/generics-and-reflection.md @@ -10,7 +10,7 @@ helpviewer_keywords: Because the Common Language Runtime (CLR) has access to generic type information at run time, you can use reflection to obtain information about generic types in the same way as for nongeneric types. For more information, see [Generics in the Runtime](../../programming-guide/generics/generics-in-the-run-time.md). -The namespace also contains new members that support generics. See [How to: Define a Generic Type with Reflection Emit](../../../framework/reflection-and-codedom/how-to-define-a-generic-type-with-reflection-emit.md). +The namespace also contains new members that support generics. See [How to: Define a Generic Type with Reflection Emit](../../../fundamentals/reflection/how-to-define-a-generic-type-with-reflection-emit.md). For a list of the invariant conditions for terms used in generic reflection, see the property remarks: @@ -38,5 +38,5 @@ In addition, members of the class enable run ## See also - [Generics](../../fundamentals/types/generics.md) -- [Reflection and Generic Types](../../../framework/reflection-and-codedom/reflection-and-generic-types.md) +- [Reflection and Generic Types](../../../fundamentals/reflection/reflection-and-generic-types.md) - [Generics](../../../standard/generics/index.md) diff --git a/docs/csharp/advanced-topics/reflection-and-attributes/index.md b/docs/csharp/advanced-topics/reflection-and-attributes/index.md index 999ea58f3f811..2d4c56c9bbd29 100644 --- a/docs/csharp/advanced-topics/reflection-and-attributes/index.md +++ b/docs/csharp/advanced-topics/reflection-and-attributes/index.md @@ -14,7 +14,7 @@ Attributes have the following properties: - Attributes can accept arguments in the same way as methods and properties. - Your program can examine its own metadata or the metadata in other programs by using reflection. -Reflection provides objects (of type ) that describe assemblies, modules, and types. You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object and invoke its methods or access its fields and properties. If you're using attributes in your code, reflection enables you to access them. For more information, see [Attributes](../../../standard/attributes/index.md). +[Reflection](../../../fundamentals/reflection/reflection.md) provides objects (of type ) that describe assemblies, modules, and types. You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object and invoke its methods or access its fields and properties. If you're using attributes in your code, reflection enables you to access them. For more information, see [Attributes](../../../standard/attributes/index.md). Here's a simple example of reflection using the method - inherited by all types from the `Object` base class - to obtain the type of a variable: @@ -136,17 +136,17 @@ Reflection is useful in the following situations: - When you have to access attributes in your program's metadata. For more information, see [Retrieving Information Stored in Attributes](../../../standard/attributes/retrieving-information-stored-in-attributes.md). - For examining and instantiating types in an assembly. - For building new types at run time. Use classes in . -- For performing late binding, accessing methods on types created at run time. See the article [Dynamically Loading and Using Types](../../../framework/reflection-and-codedom/dynamically-loading-and-using-types.md). +- For performing late binding, accessing methods on types created at run time. See the article [Dynamically Loading and Using Types](../../../fundamentals/reflection/dynamically-loading-and-using-types.md). ## Related sections For more information: -- [Common Attributes (C#)](../../language-reference/attributes/global.md) -- [Caller Information (C#)](../../language-reference/attributes/caller-information.md) +- [Common Attributes (C#)](../../language-reference/attributes/global.md) +- [Caller Information (C#)](../../language-reference/attributes/caller-information.md) - [Attributes](../../../standard/attributes/index.md) -- [Reflection](../../../framework/reflection-and-codedom/reflection.md) -- [Viewing Type Information](../../../framework/reflection-and-codedom/viewing-type-information.md) -- [Reflection and Generic Types](../../../framework/reflection-and-codedom/reflection-and-generic-types.md) +- [Reflection](../../../fundamentals/reflection/reflection.md) +- [View Type Information](../../../fundamentals/reflection/viewing-type-information.md) +- [Reflection and Generic Types](../../../fundamentals/reflection/reflection-and-generic-types.md) - - [Retrieving Information Stored in Attributes](../../../standard/attributes/retrieving-information-stored-in-attributes.md) diff --git a/docs/csharp/fundamentals/exceptions/exception-handling.md b/docs/csharp/fundamentals/exceptions/exception-handling.md index 1515e73f0d002..e03d54d6f6ff1 100644 --- a/docs/csharp/fundamentals/exceptions/exception-handling.md +++ b/docs/csharp/fundamentals/exceptions/exception-handling.md @@ -61,6 +61,6 @@ For more information, see [Exceptions](~/_csharpstandard/standard/exceptions.md) ## See also -- [C# reference](../../language-reference/index.md) +- [C# reference](../../language-reference/index.yml) - [Exception-handling statements](../../language-reference/statements/exception-handling-statements.md) - [using statement](../../language-reference/statements/using.md) diff --git a/docs/csharp/fundamentals/program-structure/main-command-line.md b/docs/csharp/fundamentals/program-structure/main-command-line.md index 9fffe133c6819..892314df5a690 100644 --- a/docs/csharp/fundamentals/program-structure/main-command-line.md +++ b/docs/csharp/fundamentals/program-structure/main-command-line.md @@ -20,7 +20,9 @@ There can only be one entry point in a C# program. If you have more than one cla :::code language="csharp" source="snippets/main-command-line/TestClass.cs"::: -You can also use [Top-level statements](top-level-statements.md) in one file as the entry point for your application: +You can also use Top-level statements in one file as the entry point for your application. +Just as the `Main` method, top-level statements can also [return values](#main-return-values) and access [command-line arguments](#command-line-arguments). +For more information, see [Top-level statements](top-level-statements.md). :::code language="csharp" source="snippets/top-level-statements-1/Program.cs"::: diff --git a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/Program.cs b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/Program.cs index ed6df786a791d..adc7fb0366e4c 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/Program.cs +++ b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/Program.cs @@ -1,7 +1,15 @@ using System.Text; StringBuilder builder = new(); -builder.AppendLine("Hello"); -builder.AppendLine("World!"); +builder.AppendLine("The following arguments are passed:"); + +// Display the command line arguments using the args variable. +foreach (var arg in args) +{ + builder.AppendLine($"Argument={arg}"); +} Console.WriteLine(builder.ToString()); + +// Return a success code. +return 0; diff --git a/docs/csharp/index.yml b/docs/csharp/index.yml index 0afd1711e43cc..592c3f599f18f 100644 --- a/docs/csharp/index.yml +++ b/docs/csharp/index.yml @@ -1,162 +1,342 @@ -### YamlMime:Landing +### YamlMime:Hub -title: "C# documentation" -summary: "Learn how to write any application using the C# programming language on the .NET platform." +#root section (Required) +title: C# language documentation +summary: > + The C# guide contains articles, tutorials, and code samples to help you get started with C# and the .NET platform. Experienced developers can learn about new + features in the What's new section. Experienced developers can learn details of language behavior from the reference and language specifications. +brand: dotnet metadata: - title: "C# docs - get started, tutorials, reference." - description: "Learn C# programming - for beginning developers, developers new to C#, and experienced C# / .NET developers" - ms.topic: landing-page # Required - ms.date: 04/05/2023 + title: C# Guide - .NET managed language + description: The C# guide has everything you need to learn C# and get started writing .NET apps. Learn C# programming - for beginning developers, developers new to C#, and experienced C# / .NET developers. + ms.service: dotnet-csharp + ms.topic: hub-page + author: billwagner + ms.author: wiwagn + ms.date: 03/15/2024 -landingContent: - - title: "Learn to program in C#" - linkLists: - - linkListType: get-started - links: - - text: Learn C# | Tutorials, courses, videos, and more - url: https://dotnet.microsoft.com/learn/csharp - - linkListType: video - links: - - text: "C# beginner video series" - url: https://aka.ms/dotnet/beginnervideos/youtube/csharp - - linkListType: tutorial - links: - - text: "Self-guided tutorials" - url: https://learn.microsoft.com/users/dotnet/collections/yz26f8y64n7k07?WT.mc_id=dotnet-35129-website - - text: "In-browser tutorial" - url: ./tour-of-csharp/tutorials/hello-world.yml - - linkListType: reference - links: - - text: "C# on Q&A" - url: /answers/topics/dotnet-csharp.html - - text: "Languages on .NET tech community forums" - url: https://techcommunity.microsoft.com/t5/languages/bd-p/languages - - text: "C# on Stack Overflow" - url: https://stackoverflow.com/questions/tagged/c%23 - - text: "C# on Discord" - url: https://aka.ms/csharp-discord +# highlightedContent section (Optional; Remove if not applicable.) +# Maximum of 8 items +highlightedContent: +# itemType: architecture | concept | deploy | download | get-started | how-to-guide | training | overview | quickstart | reference | sample | tutorial | video | whats-new + items: + # Card + - title: Tour of C# + itemType: get-started + url: ./tour-of-csharp/index.md + # Card + - title: C# fundamentals + itemType: concept + url: ./fundamentals/program-structure/index.md + # Card + - title: What's new in C# + itemType: whats-new + url: ./whats-new/csharp-13.md + # Card + - title: Learn C# video series + itemType: video + url: https://aka.ms/dotnet/beginnervideos/learn/csharp + # Card + - title: C# learning paths + itemType: training + url: https://learn.microsoft.com/collections/yz26f8y64n7k07 + # Card + - title: Foundational C# Certification - freeCodeCamp + itemType: training + url: https://www.freecodecamp.org/learn/foundational-c-sharp-with-microsoft/ - - title: "C# fundamentals" - linkLists: - - linkListType: overview - links: - - text: "A tour of C#" - url: tour-of-csharp/index.md - - text: "Inside a C# program" - url: ./fundamentals/program-structure/index.md - - text: "C# highlights video series" - url: https://youtube.com/playlist?list=PLdo4fOcmZ0oU3ZLx6Ul1_HPrr6lFPIn9O - - linkListType: concept - links: - - text: "Type system" - url: ./fundamentals/types/index.md - - text: "Object oriented programming" - url: ./fundamentals/object-oriented/index.md - - text: "Functional techniques" - url: ./fundamentals/functional/pattern-matching.md - - text: "Exceptions" - url: ./fundamentals/exceptions/index.md - - text: "Coding style" - url: ./fundamentals/coding-style/identifier-names.md - - linkListType: tutorial - links: - - text: Display command-line - url: ./fundamentals/tutorials/how-to-display-command-line-arguments.md - - text: Intro to classes - url: ./fundamentals/tutorials/classes.md - - text: Object oriented C# - url: ./fundamentals/tutorials/oop.md - - text: Converting types - url: ./fundamentals/tutorials/safely-cast-using-pattern-matching-is-and-as-operators.md - - text: Pattern matching - url: ./fundamentals/tutorials/pattern-matching.md - - text: Use LINQ to query data - url: tutorials/working-with-linq.md - - title: "Key concepts" - linkLists: - - linkListType: overview - links: - - text: C# language strategy - url: ./tour-of-csharp/strategy.md - - text: "Programming concepts" - url: ./programming-guide/concepts/index.md - - linkListType: quickstart - links: - - text: "Methods" - url: ./methods.md - - text: "Properties" - url: ./properties.md - - text: "Indexers" - url: ./indexers.md - - text: "Iterators" - url: ./iterators.md - - text: "Delegates" - url: ./delegates-overview.md - - text: "Events" - url: ./events-overview.md - - linkListType: concept - links: - - text: "Nullable reference types" - url: ./nullable-references.md - - text: "Nullable reference migrations" - url: ./nullable-migration-strategies.md - - text: "Language Integrated Query (LINQ)" - url: linq/index.md - - text: "Versioning" - url: ./versioning.md - - - title: "What's new" - linkLists: - - linkListType: whats-new - links: - - text: "What's new in C# 13" - url: whats-new/csharp-13.md - - text: "What's new in C# 12" - url: whats-new/csharp-12.md - - text: "What's new in C# 11" - url: whats-new/csharp-11.md - - text: "What's new in C# 10" - url: whats-new/csharp-10.md - - linkListType: tutorial - links: - - text: Explore record types - url: whats-new/tutorials/records.md - - text: Explore top level statements - url: whats-new/tutorials/top-level-statements.md - - text: Explore new patterns - url: whats-new/tutorials/patterns-objects.md - - text: Write a custom string interpolation handler - url: whats-new/tutorials/interpolated-string-handler.md - - linkListType: reference - links: - - text: Breaking changes in the C# compiler - url: whats-new/breaking-changes.md - - text: Version compatibility - url: whats-new/version-update-considerations.md - - - title: "C# language reference" - linkLists: - - linkListType: reference - links: - - text: "Language reference" - url: language-reference/index.md - - text: "C# keywords" - url: language-reference/keywords/index.md - - text: "C# operators and expressions" - url: language-reference/operators/index.md - - text: Configure language version - url: language-reference/configure-language-version.md - - text: "C# language specification - C# 7 draft in progress" - url: ../../_csharpstandard/standard/README.md - - title: "Stay in touch" - linkLists: - - linkListType: reference - links: - - text: ".NET developer community" - url: https://dotnet.microsoft.com/platform/community - - text: "YouTube" - url: https://www.youtube.com/dotnet - - text: "Twitter" - url: https://twitter.com/DotNet +# productDirectory section (Optional; Remove if not applicable.) +productDirectory: + title: Learn to program with C# + summary: Major concepts and features of the C# language + items: + # Card + - title: Get started with C# + # imageSrc should be square in ratio with no white space + imageSrc: ../media/logo_csharp.png + links: + - url: tour-of-csharp/index.md + text: A tour of C# + - url: ./tour-of-csharp/tutorials/index.md + text: Beginner C# tutorials + - url: ./tour-of-csharp/tutorials/hello-world.yml + text: Try C# in your browser + - url: ./fundamentals/program-structure/index.md + text: "Inside a C# program" + - url: https://aka.ms/dotnet/beginnervideos/learn/csharp + text: "C# for beginners video series" + - url: https://aka.ms/csharp-certification + text: Foundational C# Certification + + - title: C# fundamentals + # imageSrc should be square in ratio with no white space + imageSrc: ../media/dotnet-bot.svg + links: + - url: ./fundamentals/types/index.md + text: Type system + - url: ./fundamentals/object-oriented/index.md + text: "Object oriented programming" + - url: ./fundamentals/functional/pattern-matching.md + text: "Functional techniques" + - url: ./fundamentals/exceptions/index.md + text: "Exceptions" + - url: ./fundamentals/coding-style/identifier-names.md + text: "Coding style" + - url: ./tour-of-csharp/strategy.md + text: C# language strategy + + # Card + - title: Language concepts + # imageSrc should be square in ratio with no white space + imageSrc: ../media/dotnet-bot_presenting.svg + links: + - url: ./programming-guide/concepts/index.md + text: "Programming concepts" + - url: ./linq/index.md + text: LINQ + - url: ./asynchronous-programming/index.md + text: Asynchronous programming + - title: Advanced language concepts + # imageSrc should be square in ratio with no white space + imageSrc: ../media/dotnet-bot_jetpack-faceing-right.svg + links: + - url: ./advanced-topics/reflection-and-attributes/index.md + text: Reflection and attributes + - url: ./advanced-topics/interface-implementation/default-interface-methods-versions.md + text: Interface implementations + - url: ./advanced-topics/expression-trees/index.md + text: Expression trees + - url: ./advanced-topics/interop/index.md + text: Native interoperability + - url: ./advanced-topics/performance/index.md + text: Performance engineering + - url: ./roslyn-sdk/index.md + text: .NET compiler platform (roslyn) SDK + +conceptualContent: +# itemType: reference + # Supports up to 3 subsections + sections: + - title: C# reference + summary: > + Read C# language reference material, and the C# language specifications. The C# reference provides an informative reference for the C# language. + The C# language specification is the normative reference for the C# language. It's the official source for C# language syntax and semantics. + Feature specifications document features not yet incorporated in the standard. + items: + # Card + - title: Language reference + summary: The C# language reference provides an informative explanation of the C# language. + links: + - url: ./language-reference/index.yml + itemType: reference + text: C# language reference + - url: ./language-reference/builtin-types/value-types.md + itemType: reference + text: Built-in types + - url: ./language-reference/keywords/index.md + itemType: reference + text: Keywords + - url: ./language-reference/operators/index.md + itemType: reference + text: Operators + - url: ./language-reference/statements/declarations.md + itemType: reference + text: Statements + - url: ./language-reference/tokens/index.md + itemType: reference + text: Special characters + - url: ./language-reference/xmldoc/index.md + itemType: reference + text: Documentation comments + # Card + - title: C# Language reference + summary: Unsafe code and compiler options + links: + - url: ./language-reference/attributes/global.md + itemType: reference + text: Special attributes + - url: ./language-reference/unsafe-code.md + itemType: reference + text: Unsafe code + - url: ./language-reference/preprocessor-directives.md + itemType: reference + text: Preprocessor directives + - url: ./language-reference/compiler-options/index.md + itemType: reference + text: Compiler options + + # Card + - title: C# specification + summary: The official specification for the C# language + links: + - url: ./specification/index.yml + itemType: reference + text: Standard and specifications + - url: ./specification/overview.md + itemType: reference + text: The specification process + - url: ../../_csharpstandard/standard/README.md + itemType: reference + text: C# draft standard + - url: ../../_csharplang/proposals/csharp-10.0/enhanced-line-directives.md + itemType: reference + text: Feature specifications + +# tools section (Optional; Remove if not applicable.) +tools: + title: Build C# apps with the Visual Studio family + summary: Choose Visual Studio or Visual Studio Code to build your C# applications. + items: + # Card + - title: Visual Studio + # imageSrc should be square in ratio with no white space + imageSrc: /visualstudio/media/vs-ide-2022.svg + url: /visualstudio/windows + # Card + - title: Visual Studio Code + imageSrc: /visualstudio/media/vs-code-logo.svg + url: https://code.visualstudio.com/docs/csharp/get-started + +# additionalContent section (Optional; Remove if not applicable.) +# Card with links style +additionalContent: + # Supports up to 4 subsections + sections: + - title: Create your application # < 60 chars (optional) + summary: "You can choose web, mobile, desktop, gaming, IoT, and more." # < 160 chars (optional) + items: + # Card + - title: Web + links: + - url: /aspnet/core/tutorials + text: ASP.NET Core tutorials + - url: /aspnet/core + text: What is ASP.NET Core? + - url: /aspnet/core/tutorials/first-mvc-app/start-mvc + text: ASP.NET Core in Visual Studio + - url: /aspnet/mvc/overview/deployment/docker-aspnetmvc + text: ASP.NET MVC apps in Windows containers + - url: /aspnet/core/blazor/ + text: "Blazor: Interactive client-side web UI with .NET" + - url: ../fsharp/scenarios/web-development.md + text: F# for web development + # Card + - title: Mobile + links: + - url: /dotnet/maui + text: .NET Multi-platform App UI (.NET MAUI) + - url: /xamarin/xamarin-forms + text: Xamarin.Forms + - url: /xamarin/ios + text: Xamarin.iOS + - url: /xamarin/android + text: Xamarin.Android + - url: /azure/developer/mobile-apps + text: Develop Xamarin apps with Azure + # Card + - title: Desktop + links: + - url: /uwp + text: Universal Windows apps + - url: /dotnet/desktop/wpf/ + text: Windows Presentation Foundation (.NET 5+) + - url: /dotnet/desktop/wpf/?view=netframeworkdesktop-4.8&preserve-view=true + text: Windows Presentation Foundation (.NET Framework) + - url: /dotnet/desktop/winforms/ + text: Windows Forms (.NET 5+) + - url: /dotnet/desktop/winforms/?view=netframeworkdesktop-4.8&preserve-view=true + text: Windows Forms (.NET Framework) + - url: /dotnet/maui + text: .NET Multi-platform App UI (.NET MAUI) + - url: /xamarin/mac + text: Xamarin for macOS + # Card + - title: Microservices + links: + - url: ../architecture/dapr-for-net-developers/index.md + text: Dapr for .NET developers + - url: ../architecture/cloud-native/index.md + text: Cloud native .NET apps + - url: ../architecture/serverless/index.md + text: Serverless apps with Azure + - url: ../architecture/microservices/index.md + text: Architecture for containerized .NET apps + - url: ../core/extensions/cloud-service.md + text: Deploy a Worker Service to Azure + # Card + - title: Cloud + links: + - url: ../azure/index.yml + text: Azure for .NET developers + - url: /dotnet/aspire + text: .NET Aspire (Preview) + - url: ../azure/migration/app-service.md?preserve-view=true&view=azure-dotnet + text: Migrate on-premises .NET web apps or services + - url: ../azure/key-azure-services.md + text: Azure services for .NET developers + - url: ../azure/sdk/azure-sdk-for-dotnet.md + text: Azure SDK for .NET + - url: ../fsharp/using-fsharp-on-azure/deploying-and-managing.md + text: Deploy Azure resources with F# + # Card + - title: Machine learning and AI + links: + - url: ../machine-learning/index.yml + text: Build custom AI solutions with ML.NET + - url: /azure/cognitive-services/ + text: Azure Cognitive Services + - url: /azure/machine-learning + text: Azure Machine Learning + - url: ../fsharp/scenarios/machine-learning.md + text: F# for machine learning + # Card + - title: Game development + links: + - url: https://visualstudio.microsoft.com/vs/features/game-development/?utm_medium=microsoft&utm_source=learn.microsoft.com&utm_campaign=inline+link + text: Game development with Visual Studio + - url: https://docs.cryengine.com/display/CEPROG/C%23+Programming + text: Learn how to use CRYENGINE to build games with C# + - url: https://docs.monogame.net/?page=main + text: Build games with C# using the MonoGame library + - url: https://docs.unity3d.com/Manual/index.html + text: Learn how to use Unity to build 2D and 3D games with C# + # Card + - title: Internet of things (IoT) + links: + - url: ../iot/index.yml + text: .NET IoT libraries + - url: ../iot/quickstarts/sensehat.md + text: Get started in 5 minutes + - url: ../iot/tutorials/blink-led.md + text: Blink an LED + - url: https://aka.ms/dotnet/beginnervideos/youtube/iot + text: .NET IoT 101 video series + + - title: API and language reference # < 60 chars (optional) + summary: Search the .NET API and language reference documentation. # < 160 chars (optional) + items: + # Card + - title: ".NET API reference" + summary: API reference documentation for .NET + url: ../../api/index.md?view=net-8.0 + # Card + - title: ".NET Framework API reference" + summary: API reference documentation for .NET Framework + url: ../../api/index.md?view=netframework-4.8&preserve-view=true + # Card + - title: "ASP.NET Core API reference" + summary: API reference documentation for ASP.NET Core + url: ../../api/index.md?view=view=aspnetcore-8.0&preserve-view=true + # Card + - title: "ML.NET API reference" + summary: API reference documentation for ML.NET + url: ../../api/index.md?view=ml-dotnet&preserve-view=true + # Card + - title: ".NET Platform Extensions API reference" + summary: API reference documentation for .NET Platform Extensions + url: ../../api/index.md?view=dotnet-plat-ext-8.0&preserve-view=true + + # footer (Optional; Remove if not applicable.) + footer: "Are you interested in contributing to the .NET docs? For more information, see our [contributor guide](/contribute/dotnet/dotnet-contribute)." diff --git a/docs/csharp/language-reference/builtin-types/bool.md b/docs/csharp/language-reference/builtin-types/bool.md index 359a73dc8ab28..4f65cf9a4c31d 100644 --- a/docs/csharp/language-reference/builtin-types/bool.md +++ b/docs/csharp/language-reference/builtin-types/bool.md @@ -44,6 +44,5 @@ For more information, see [The bool type](~/_csharpstandard/standard/types.md#83 ## See also -- [C# reference](../index.md) - [Value types](value-types.md) - [true and false operators](../operators/true-false-operators.md) diff --git a/docs/csharp/language-reference/builtin-types/built-in-types.md b/docs/csharp/language-reference/builtin-types/built-in-types.md index c996183138ac7..6b2904cd320a4 100644 --- a/docs/csharp/language-reference/builtin-types/built-in-types.md +++ b/docs/csharp/language-reference/builtin-types/built-in-types.md @@ -48,5 +48,4 @@ The [`void`](void.md) keyword represents the absence of a type. You use it as th ## See also - [Use language keywords instead of framework type names (style rule IDE0049)](../../../fundamentals/code-analysis/style-rules/ide0049.md) -- [C# reference](../index.md) - [Default values of C# types](default-values.md) diff --git a/docs/csharp/language-reference/builtin-types/char.md b/docs/csharp/language-reference/builtin-types/char.md index 54b9ceeeb9b5e..048549b695473 100644 --- a/docs/csharp/language-reference/builtin-types/char.md +++ b/docs/csharp/language-reference/builtin-types/char.md @@ -52,7 +52,6 @@ For more information, see the [Integral types](~/_csharpstandard/standard/types. ## See also -- [C# reference](../index.md) - [Value types](value-types.md) - [Strings](../../programming-guide/strings/index.md) - diff --git a/docs/csharp/language-reference/builtin-types/default-values.md b/docs/csharp/language-reference/builtin-types/default-values.md index c723943032c5e..a0c65b23b6953 100644 --- a/docs/csharp/language-reference/builtin-types/default-values.md +++ b/docs/csharp/language-reference/builtin-types/default-values.md @@ -60,5 +60,4 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [Constructors](../../programming-guide/classes-and-structs/constructors.md) diff --git a/docs/csharp/language-reference/builtin-types/enum.md b/docs/csharp/language-reference/builtin-types/enum.md index 8122a3e48efd5..c94520172635a 100644 --- a/docs/csharp/language-reference/builtin-types/enum.md +++ b/docs/csharp/language-reference/builtin-types/enum.md @@ -81,7 +81,6 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [Enumeration format strings](../../../standard/base-types/enumeration-format-strings.md) - [Design guidelines - Enum design](../../../standard/design-guidelines/enum.md) - [Design guidelines - Enum naming conventions](../../../standard/design-guidelines/names-of-classes-structs-and-interfaces.md#naming-enumerations) diff --git a/docs/csharp/language-reference/builtin-types/floating-point-numeric-types.md b/docs/csharp/language-reference/builtin-types/floating-point-numeric-types.md index 0ed0bc65f38e1..79b8f4eebb37a 100644 --- a/docs/csharp/language-reference/builtin-types/floating-point-numeric-types.md +++ b/docs/csharp/language-reference/builtin-types/floating-point-numeric-types.md @@ -113,7 +113,6 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [Value types](value-types.md) - [Integral types](integral-numeric-types.md) - [Standard numeric format strings](../../../standard/base-types/standard-numeric-format-strings.md) diff --git a/docs/csharp/language-reference/builtin-types/integral-numeric-types.md b/docs/csharp/language-reference/builtin-types/integral-numeric-types.md index d4b23d4158afc..9e438f5fef31e 100644 --- a/docs/csharp/language-reference/builtin-types/integral-numeric-types.md +++ b/docs/csharp/language-reference/builtin-types/integral-numeric-types.md @@ -157,7 +157,6 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [Value types](value-types.md) - [Floating-point types](floating-point-numeric-types.md) - [Standard numeric format strings](../../../standard/base-types/standard-numeric-format-strings.md) diff --git a/docs/csharp/language-reference/builtin-types/nullable-reference-types.md b/docs/csharp/language-reference/builtin-types/nullable-reference-types.md index 506ca8116d88f..60fd27d408295 100644 --- a/docs/csharp/language-reference/builtin-types/nullable-reference-types.md +++ b/docs/csharp/language-reference/builtin-types/nullable-reference-types.md @@ -76,5 +76,4 @@ For more information, see the following proposals for the [C# language specifica ## See also -- [C# reference](../index.md) - [Nullable value types](nullable-value-types.md) diff --git a/docs/csharp/language-reference/builtin-types/nullable-value-types.md b/docs/csharp/language-reference/builtin-types/nullable-value-types.md index 246e927c6ff94..ccd76a4831057 100644 --- a/docs/csharp/language-reference/builtin-types/nullable-value-types.md +++ b/docs/csharp/language-reference/builtin-types/nullable-value-types.md @@ -123,7 +123,6 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [What exactly does 'lifted' mean?](/archive/blogs/ericlippert/what-exactly-does-lifted-mean) - - diff --git a/docs/csharp/language-reference/builtin-types/numeric-conversions.md b/docs/csharp/language-reference/builtin-types/numeric-conversions.md index 133107524b6f2..ea7cb71c2ffa3 100644 --- a/docs/csharp/language-reference/builtin-types/numeric-conversions.md +++ b/docs/csharp/language-reference/builtin-types/numeric-conversions.md @@ -108,5 +108,4 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [Casting and type conversions](../../programming-guide/types/casting-and-type-conversions.md) diff --git a/docs/csharp/language-reference/builtin-types/record.md b/docs/csharp/language-reference/builtin-types/record.md index 894a006592465..3190b90a4fc91 100644 --- a/docs/csharp/language-reference/builtin-types/record.md +++ b/docs/csharp/language-reference/builtin-types/record.md @@ -235,7 +235,6 @@ For more information about these features, see the following feature proposal no ## See also -- [C# reference](../index.md) - [Design guidelines - Choosing between class and struct](../../../standard/design-guidelines/choosing-between-class-and-struct.md) - [Design guidelines - Struct design](../../../standard/design-guidelines/struct.md) - [The C# type system](../../fundamentals/types/index.md) diff --git a/docs/csharp/language-reference/builtin-types/ref-struct.md b/docs/csharp/language-reference/builtin-types/ref-struct.md index 1d12cdce91148..2787a306bd62b 100644 --- a/docs/csharp/language-reference/builtin-types/ref-struct.md +++ b/docs/csharp/language-reference/builtin-types/ref-struct.md @@ -69,5 +69,4 @@ For more information about `ref` fields, see the [Low-level struct improvements] ## See also -- [C# reference](../index.md) - [The C# type system](../../fundamentals/types/index.md) diff --git a/docs/csharp/language-reference/builtin-types/reference-types.md b/docs/csharp/language-reference/builtin-types/reference-types.md index e5af9c86b21d6..a4c9274df943f 100644 --- a/docs/csharp/language-reference/builtin-types/reference-types.md +++ b/docs/csharp/language-reference/builtin-types/reference-types.md @@ -284,7 +284,6 @@ For more information, see the following sections of the [C# language specificati ### See also -- [C# Reference](../index.md) - [C# Keywords](../keywords/index.md) - [Events](../../programming-guide/events/index.md) - [Using Type dynamic](../../advanced-topics/interop/using-type-dynamic.md) diff --git a/docs/csharp/language-reference/builtin-types/struct.md b/docs/csharp/language-reference/builtin-types/struct.md index 10b8dad48971b..29fc7c455ba96 100644 --- a/docs/csharp/language-reference/builtin-types/struct.md +++ b/docs/csharp/language-reference/builtin-types/struct.md @@ -173,7 +173,6 @@ For more information about `struct` features, see the following feature proposal ## See also -- [C# reference](../index.md) - [The C# type system](../../fundamentals/types/index.md) - [Design guidelines - Choosing between class and struct](../../../standard/design-guidelines/choosing-between-class-and-struct.md) - [Design guidelines - Struct design](../../../standard/design-guidelines/struct.md) diff --git a/docs/csharp/language-reference/builtin-types/unmanaged-types.md b/docs/csharp/language-reference/builtin-types/unmanaged-types.md index f167aef55f907..2b9994f7e730b 100644 --- a/docs/csharp/language-reference/builtin-types/unmanaged-types.md +++ b/docs/csharp/language-reference/builtin-types/unmanaged-types.md @@ -30,7 +30,6 @@ For more information, see the [Pointer types](~/_csharpstandard/standard/unsafe- ## See also -- [C# reference](../index.md) - [Pointer types](../unsafe-code.md#pointer-types) - [Memory and span-related types](../../../standard/memory-and-spans/index.md) - [sizeof operator](../operators/sizeof.md) diff --git a/docs/csharp/language-reference/builtin-types/value-tuples.md b/docs/csharp/language-reference/builtin-types/value-tuples.md index a5342246cb211..0643bccee392e 100644 --- a/docs/csharp/language-reference/builtin-types/value-tuples.md +++ b/docs/csharp/language-reference/builtin-types/value-tuples.md @@ -164,7 +164,6 @@ For more information, see: ## See also -- [C# reference](../index.md) - [Value types](value-types.md) - [Choosing between anonymous and tuple types](../../../standard/base-types/choosing-between-anonymous-and-tuple.md) - diff --git a/docs/csharp/language-reference/builtin-types/value-types.md b/docs/csharp/language-reference/builtin-types/value-types.md index 4d1f1298c7cc1..5b6f3baefd6e8 100644 --- a/docs/csharp/language-reference/builtin-types/value-types.md +++ b/docs/csharp/language-reference/builtin-types/value-types.md @@ -65,6 +65,5 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - - [Reference types](../keywords/reference-types.md) diff --git a/docs/csharp/language-reference/builtin-types/void.md b/docs/csharp/language-reference/builtin-types/void.md index d51cf65f0b6c8..c7d6e7fbed463 100644 --- a/docs/csharp/language-reference/builtin-types/void.md +++ b/docs/csharp/language-reference/builtin-types/void.md @@ -22,5 +22,4 @@ You cannot use `void` as the type of a variable. ## See also -- [C# reference](../index.md) - diff --git a/docs/csharp/language-reference/compiler-messages/toc.yml b/docs/csharp/language-reference/compiler-messages/toc.yml deleted file mode 100644 index 1f2c4285a8193..0000000000000 --- a/docs/csharp/language-reference/compiler-messages/toc.yml +++ /dev/null @@ -1,1916 +0,0 @@ -items: -- name: C# compiler messages - href: index.md -- name: Feature or version missing - href: feature-version-errors.md - displayName: > - CS0171, CS0188, CS0843, CS8904, CS1738, CS8022, CS8023, CS8024, CS8025, CS8026, CS8058, CS8059, CS8107, CS8192, CS8302, - CS8303, CS8304, CS8305, CS8306, CS8314, CS8320, CS8370, CS8371, CS8400, CS8401, CS8511, CS8627, CS8630, CS8652, CS8703, - CS8704, CS8706, CS8773, CS8912, CS8919, CS8929, CS8936, CS8957, CS8967, CS9014, CS9015, CS9016, CS9017, CS9058, CS9064, - CS9103, CS9171, CS9194, CS9202, CS9204 -- name: Assembly references - href: assembly-references.md - displayName: > - CS0012, CS0234, CS0246, CS0400, CS1068, CS1069, CS1070, CS1704, CS1683, CS1714, CS1760, CS7008, CS7068, CS7069, - CS7071, CS7079, CS8090, CS8203 -- name: Constructor declarations - href: constructor-errors.md - displayName: > - Primary constructors, - CS0514, CS0515, CS0516, CS0517, CS0522, CS0526, CS0568, CS0710, CS0768, CS0824, CS8054, CS8091, CS8358, CS8862, CS8867, - CS8868, CS8878, CS8910, CS8958, CS8982, CS8983, CS9105, CS9106, CS9107, CS9108, CS9109, CS9110, CS9111, CS9112, CS9113, - CS9114, CS9115, CS9116, CS9117, CS9118, CS9119, CS9120, CS9121, CS9122, CS9124, CS9136, CS9179 -- name: Parameter / argument mismatch - href: parameter-argument-mismatch.md - displayName: > - CS0182, CS0591, CS0599, CS0617, CS0633, CS0643, CS0655, CS0839, CS1016, CS1739, CS1740, CS1742, CS1744, CS1746, CS7036, - CS7067, CS8196, CS8324, CS8861, CS8905, CS8943, CS8944, CS8945, CS8948, CS8949, CS8950, CS8951, CS8964, CS8965, CS8966 -- name: Reference parameters - href: ref-modifiers-errors.md - displayName: > - ref safety, - CS0192, CS0199, CS0206, CS0631, CS0767, CS1510, CS1605, CS1623, CS1649, CS1651, CS1655, CS1657, CS1741, CS1939, CS1988, - CS7084, CS8166, CS8167, CS8168, CS8169. CS8325, CS8326, CS8327, CS8329, CS8330, CS8331, CS8332, CS8337, CS8338, CS8345, - CS8351, CS8373, CS8374, CS8388, CS8977, CS9072, CS9077, CS9078, CS9079, CS9085, CS9086, CS9087, CS9089, CS9091, CS9092, - CS9093, CS9094, CS9095, CS9096, CS9097, CS9101, CS9102, CS9104, CS9190, CS9191, CS9192, CS9193, CS9195, CS9196, CS9197, - CS9198, CS9199, CS9200, CS9201 -- name: Nullable warnings - href: nullable-warnings.md - displayName: > - CS8597, CS8600, CS8601, CS8602, CS8604, CS8605, CS8607, CS8608, CS8609, CS8610, CS8611, CS8612, CS8613, CS8614, CS8615, - CS8616, CS8617, CS8618, CS8619, CS8620, CS8621, CS8622, CS8624, CS8625, CS8629, CS8631, CS8634, CS8655, CS8633, CS8643, - CS8644, CS8645, CS8762, CS8763, CS8764, CS8765, CS8766, CS8667, CS8768, CS8670, CS8714, CS8767, CS8769, CS8770, CS8774, - CS8776, CS8775, CS8777, CS8819, CS8824, CS8825, CS8847 -- name: Pattern matching warnings - href: pattern-matching-warnings.md - displayName: CS8509, CS9134, CS9135 -- name: Array declarations - href: array-declaration-errors.md - displayName: > - CS0022, CS0178, CS0248, CS0251, CS0270, CS0611, CS0623, CS0650, CS0719, CS0747, CS0820, CS0826, CS0846, CS1552, CS1586, - CS1920, CS1921, CS1925, CS1954, CS3007, CS3016, CS9174, CS9176, CS9185, CS9186, CS9187, CS9188, CS9203, CS9208, CS9209, - CS9210 -- name: Inline arrays - href: inline-array-errors.md - displayName: CS9164, CS9165, CS9166, CS9167, CS9168, CS9169, CS9172, CS9173, CS9180, CS9181, CS9182, CS9183, CS9184 -- name: Lambda expressions - href: lambda-expression-errors.md - displayName: > - CS0748, CS1621, CS1628, CS1632, CS1673, CS1686, CS1706, CS1989, CS8030, CS8175, CS8916, CS8971, CS8972, CS8975, CS9098, - CS9099, CS9100 -- name: Restrictions on expression trees - href: expression-tree-restrictions.md - displayName: > - CS0765, CS0831, CS0832, CS0834, CS0835, CS0838, CS0845, CS0853, CS0854, CS0855, CS1944, CS1945, CS1946, CS1951, CS1952, - CS1963, CS2037, CS7053, CS8072, CS8074, CS8075, CS8110, CS8122, CS8143, CS8144, CS8153, CS8155, CS8198, CS8207, CS8382, - CS8514, CS8640, CS8642, CS8790, CS8791, CS8792, CS8810, CS8849, CS8927, CS8952, CS9170, CS9175 -- name: Using directive and aliases - href: using-directive-errors.md - displayName: > - CS0105, CS0138, CS0431, CS0432, CS0440, CS0576, CS0687, CS1529, CS1537, CS7000, CS7007, CS8019, CS8083, CS8085, CS8914, - CS8915, CS8933, CS9055, CS9130, CS9131, CS9132, CS9133, CS9162, CS9163 -- name: Source generators - href: source-generator-errors.md - displayName: > - CS9137, CS9138, CS9139, CS9140, CS9141, CS9142, CS9143, CS9144, CS9145, CS9146, CS9147, CS9148, CS9149, CS9150, CS9151, - CS9152, CS9153, CS9154, CS9155, CS9156, CS9157, CS9158, CS9159, CS9160, CS9161, CS9177, CS9178, CS9206, CS9207 -- name: static abstract interface members - href: static-abstract-interfaces.md - displayName: CS8920, CS8921, CS8922, CS8923, CS8924, CS8925, CS8926, CS8928, CS8930, 8931, 8932 -- name: Warning waves - href: warning-waves.md - displayName: > - CS7023, CS8073, CS8848, CS8880, CS8881, CS8882, CS8883, CS8884, CS8885, CS8886, CS8887, CS8892, CS8897, CS8898, CS8826, - CS8981 -- name: Error messages - items: - - name: CS0001 - href: cs0001.md - - name: CS0003 - href: ../../misc/cs0003.md - - name: CS0004 - href: ../../misc/cs0004.md - - name: CS0005 - href: ../../misc/cs0005.md - - name: CS0006 - href: cs0006.md - - name: CS0007 - href: cs0007.md - - name: CS0008 - href: ../../misc/cs0008.md - - name: CS0009 - href: ../../misc/cs0009.md - - name: CS0010 - href: ../../misc/cs0010.md - - name: CS0011 - href: ../../misc/cs0011.md - - name: CS0013 - href: ../../misc/cs0013.md - - name: CS0014 - href: ../../misc/cs0014.md - - name: CS0015 - href: cs0015.md - - name: CS0016 - href: cs0016.md - - name: CS0017 - href: ../../misc/cs0017.md - - name: CS0019 - href: cs0019.md - - name: CS0020 - href: ../../misc/cs0020.md - - name: CS0021 - href: ../../misc/cs0021.md - - name: CS0023 - href: ../../misc/cs0023.md - - name: CS0025 - href: ../../misc/cs0025.md - - name: CS0026 - href: ../../misc/cs0026.md - - name: CS0027 - href: ../../misc/cs0027.md - - name: CS0029 - href: cs0029.md - - name: CS0030 - href: ../../misc/cs0030.md - - name: CS0031 - href: ../../misc/cs0031.md - - name: CS0034 - href: cs0034.md - - name: CS0035 - href: ../../misc/cs0035.md - - name: CS0036 - href: ../../misc/cs0036.md - - name: CS0037 - href: ../../misc/cs0037.md - - name: CS0038 - href: cs0038.md - - name: CS0039 - href: cs0039.md - - name: CS0040 - href: ../../misc/cs0040.md - - name: CS0041 - href: ../../misc/cs0041.md - - name: CS0042 - href: ../../misc/cs0042.md - - name: CS0043 - href: ../../misc/cs0043.md - - name: CS0050 - href: cs0050.md - - name: CS0051 - href: cs0051.md - - name: CS0052 - href: cs0052.md - - name: CS0053 - href: ../../misc/cs0053.md - - name: CS0054 - href: ../../misc/cs0054.md - - name: CS0055 - href: ../../misc/cs0055.md - - name: CS0056 - href: ../../misc/cs0056.md - - name: CS0057 - href: ../../misc/cs0057.md - - name: CS0058 - href: ../../misc/cs0058.md - - name: CS0059 - href: ../../misc/cs0059.md - - name: CS0060 - href: ../../misc/cs0060.md - - name: CS0061 - href: ../../misc/cs0061.md - - name: CS0065 - href: ../../misc/cs0065.md - - name: CS0066 - href: ../../misc/cs0066.md - - name: CS0068 - href: ../../misc/cs0068.md - - name: CS0069 - href: ../../misc/cs0069.md - - name: CS0070 - href: ../../misc/cs0070.md - - name: CS0071 - href: cs0071.md - - name: CS0072 - href: ../../misc/cs0072.md - - name: CS0073 - href: ../../misc/cs0073.md - - name: CS0074 - href: ../../misc/cs0074.md - - name: CS0075 - href: ../../misc/cs0075.md - - name: CS0076 - href: ../../misc/cs0076.md - - name: CS0077 - href: ../../misc/cs0077.md - - name: CS0079 - href: ../../misc/cs0079.md - - name: CS0080 - href: ../../misc/cs0080.md - - name: CS0081 - href: ../../misc/cs0081.md - - name: CS0082 - href: ../../misc/cs0082.md - - name: CS0100 - href: ../../misc/cs0100.md - - name: CS0101 - href: ../../misc/cs0101.md - - name: CS0102 - href: ../../misc/cs0102.md - - name: CS0103 - href: cs0103.md - - name: CS0104 - href: ../../misc/cs0104.md - - name: CS0106 - href: cs0106.md - - name: CS0107 - href: ../../misc/cs0107.md - - name: CS0110 - href: ../../misc/cs0110.md - - name: CS0111 - href: ../../misc/cs0111.md - - name: CS0112 - href: ../../misc/cs0112.md - - name: CS0113 - href: ../../misc/cs0113.md - - name: CS0115 - href: cs0115.md - - name: CS0116 - href: cs0116.md - - name: CS0117 - href: ../../misc/cs0117.md - - name: CS0118 - href: ../../misc/cs0118.md - - name: CS0119 - href: ../../misc/cs0119.md - - name: CS0120 - href: cs0120.md - - name: CS0121 - href: ../../misc/cs0121.md - - name: CS0122 - href: cs0122.md - - name: CS0123 - href: ../../misc/cs0123.md - - name: CS0126 - href: ../../misc/cs0126.md - - name: CS0127 - href: ../../misc/cs0127.md - - name: CS0128 - href: ../../misc/cs0128.md - - name: CS0131 - href: ../../misc/cs0131.md - - name: CS0132 - href: ../../misc/cs0132.md - - name: CS0133 - href: ../../misc/cs0133.md - - name: CS0134 - href: cs0134.md - - name: CS0135 - href: ../../misc/cs0135.md - - name: CS0136 - href: ../../misc/cs0136.md - - name: CS0139 - href: ../../misc/cs0139.md - - name: CS0140 - href: ../../misc/cs0140.md - - name: CS0143 - href: ../../misc/cs0143.md - - name: CS0144 - href: ../../misc/cs0144.md - - name: CS0145 - href: ../../misc/cs0145.md - - name: CS0146 - href: ../../misc/cs0146.md - - name: CS0148 - href: ../../misc/cs0148.md - - name: CS0149 - href: ../../misc/cs0149.md - - name: CS0150 - href: ../../misc/cs0150.md - - name: CS0151 - href: cs0151.md - - name: CS0152 - href: ../../misc/cs0152.md - - name: CS0153 - href: ../../misc/cs0153.md - - name: CS0154 - href: ../../misc/cs0154.md - - name: CS0155 - href: ../../misc/cs0155.md - - name: CS0156 - href: ../../misc/cs0156.md - - name: CS0157 - href: ../../misc/cs0157.md - - name: CS0158 - href: ../../misc/cs0158.md - - name: CS0159 - href: ../../misc/cs0159.md - - name: CS0160 - href: ../../misc/cs0160.md - - name: CS0161 - href: ../../misc/cs0161.md - - name: CS0163 - href: cs0163.md - - name: CS0165 - href: cs0165.md - - name: CS0167 - href: ../../misc/cs0167.md - - name: CS0170 - href: ../../misc/cs0170.md - - name: CS0172 - href: ../../misc/cs0172.md - - name: CS0173 - href: cs0173.md - - name: CS0174 - href: ../../misc/cs0174.md - - name: CS0175 - href: ../../misc/cs0175.md - - name: CS0176 - href: ../../misc/cs0176.md - - name: CS0177 - href: ../../misc/cs0177.md - - name: CS0179 - href: ../../misc/cs0179.md - - name: CS0180 - href: ../../misc/cs0180.md - - name: CS0181 - href: cs0181.md - - name: CS0185 - href: ../../misc/cs0185.md - - name: CS0186 - href: ../../misc/cs0186.md - - name: CS0191 - href: ../../misc/cs0191.md - - name: CS0193 - href: ../../misc/cs0193.md - - name: CS0196 - href: ../../misc/cs0196.md - - name: CS0198 - href: ../../misc/cs0198.md - - name: CS0200 - href: ../../misc/cs0200.md - - name: CS0201 - href: cs0201.md - - name: CS0202 - href: ../../misc/cs0202.md - - name: CS0204 - href: ../../misc/cs0204.md - - name: CS0205 - href: ../../misc/cs0205.md - - name: CS0208 - href: ../../misc/cs0208.md - - name: CS0209 - href: ../../misc/cs0209.md - - name: CS0210 - href: ../../misc/cs0210.md - - name: CS0211 - href: ../../misc/cs0211.md - - name: CS0212 - href: ../../misc/cs0212.md - - name: CS0213 - href: ../../misc/cs0213.md - - name: CS0214 - href: ../../misc/cs0214.md - - name: CS0215 - href: ../../misc/cs0215.md - - name: CS0216 - href: ../../misc/cs0216.md - - name: CS0217 - href: ../../misc/cs0217.md - - name: CS0218 - href: ../../misc/cs0218.md - - name: CS0220 - href: ../../misc/cs0220.md - - name: CS0221 - href: ../../misc/cs0221.md - - name: CS0225 - href: ../../misc/cs0225.md - - name: CS0226 - href: ../../misc/cs0226.md - - name: CS0227 - href: ../../misc/cs0227.md - - name: CS0228 - href: ../../misc/cs0228.md - - name: CS0229 - href: cs0229.md - - name: CS0230 - href: ../../misc/cs0230.md - - name: CS0231 - href: ../../misc/cs0231.md - - name: CS0233 - href: cs0233.md - - name: CS0236 - href: ../../misc/cs0236.md - - name: CS0238 - href: ../../misc/cs0238.md - - name: CS0239 - href: ../../misc/cs0239.md - - name: CS0241 - href: ../../misc/cs0241.md - - name: CS0242 - href: ../../misc/cs0242.md - - name: CS0243 - href: ../../misc/cs0243.md - - name: CS0244 - href: ../../misc/cs0244.md - - name: CS0245 - href: ../../misc/cs0245.md - - name: CS0247 - href: ../../misc/cs0247.md - - name: CS0249 - href: ../../misc/cs0249.md - - name: CS0250 - href: ../../misc/cs0250.md - - name: CS0254 - href: ../../misc/cs0254.md - - name: CS0255 - href: ../../misc/cs0255.md - - name: CS0260 - href: cs0260.md - - name: CS0261 - href: ../../misc/cs0261.md - - name: CS0262 - href: ../../misc/cs0262.md - - name: CS0263 - href: ../../misc/cs0263.md - - name: CS0264 - href: ../../misc/cs0264.md - - name: CS0265 - href: ../../misc/cs0265.md - - name: CS0266 - href: cs0266.md - - name: CS0267 - href: ../../misc/cs0267.md - - name: CS0268 - href: ../../misc/cs0268.md - - name: CS0269 - href: cs0269.md - - name: CS0271 - href: ../../misc/cs0271.md - - name: CS0272 - href: ../../misc/cs0272.md - - name: CS0273 - href: ../../misc/cs0273.md - - name: CS0274 - href: ../../misc/cs0274.md - - name: CS0275 - href: ../../misc/cs0275.md - - name: CS0276 - href: ../../misc/cs0276.md - - name: CS0277 - href: ../../misc/cs0277.md - - name: CS0281 - href: ../../misc/cs0281.md - - name: CS0283 - href: ../../misc/cs0283.md - - name: CS0304 - href: cs0304.md - - name: CS0305 - href: ../../misc/cs0305.md - - name: CS0306 - href: ../../misc/cs0306.md - - name: CS0307 - href: ../../misc/cs0307.md - - name: CS0308 - href: ../../misc/cs0308.md - - name: CS0310 - href: cs0310.md - - name: CS0311 - href: cs0311.md - - name: CS0312 - href: ../../misc/cs0312.md - - name: CS0313 - href: ../../misc/cs0313.md - - name: CS0314 - href: ../../misc/cs0314.md - - name: CS0315 - href: ../../misc/cs0315.md - - name: CS0316 - href: ../../misc/cs0316.md - - name: CS0401 - href: ../../misc/cs0401.md - - name: CS0403 - href: ../../misc/cs0403.md - - name: CS0404 - href: ../../misc/cs0404.md - - name: CS0405 - href: ../../misc/cs0405.md - - name: CS0406 - href: ../../misc/cs0406.md - - name: CS0407 - href: ../../misc/cs0407.md - - name: CS0409 - href: ../../misc/cs0409.md - - name: CS0410 - href: ../../misc/cs0410.md - - name: CS0411 - href: ../../misc/cs0411.md - - name: CS0412 - href: ../../misc/cs0412.md - - name: CS0413 - href: cs0413.md - - name: CS0415 - href: ../../misc/cs0415.md - - name: CS0416 - href: ../../misc/cs0416.md - - name: CS0417 - href: cs0417.md - - name: CS0418 - href: ../../misc/cs0418.md - - name: CS0423 - href: ../../misc/cs0423.md - - name: CS0424 - href: ../../misc/cs0424.md - - name: CS0425 - href: ../../misc/cs0425.md - - name: CS0426 - href: ../../misc/cs0426.md - - name: CS0428 - href: ../../misc/cs0428.md - - name: CS0430 - href: ../../misc/cs0430.md - - name: CS0433 - href: cs0433.md - - name: CS0434 - href: ../../misc/cs0434.md - - name: CS0438 - href: ../../misc/cs0438.md - - name: CS0439 - href: ../../misc/cs0439.md - - name: CS0441 - href: ../../misc/cs0441.md - - name: CS0442 - href: ../../misc/cs0442.md - - name: CS0443 - href: ../../misc/cs0443.md - - name: CS0445 - href: cs0445.md - - name: CS0446 - href: cs0446.md - - name: CS0447 - href: ../../misc/cs0447.md - - name: CS0448 - href: ../../misc/cs0448.md - - name: CS0449 - href: ../../misc/cs0449.md - - name: CS0450 - href: ../../misc/cs0450.md - - name: CS0451 - href: ../../misc/cs0451.md - - name: CS0452 - href: ../../misc/cs0452.md - - name: CS0453 - href: ../../misc/cs0453.md - - name: CS0454 - href: ../../misc/cs0454.md - - name: CS0455 - href: ../../misc/cs0455.md - - name: CS0456 - href: ../../misc/cs0456.md - - name: CS0457 - href: ../../misc/cs0457.md - - name: CS0459 - href: ../../misc/cs0459.md - - name: CS0460 - href: ../../misc/cs0460.md - - name: CS0462 - href: ../../misc/cs0462.md - - name: CS0463 - href: ../../misc/cs0463.md - - name: CS0466 - href: ../../misc/cs0466.md - - name: CS0468 - href: ../../misc/cs0468.md - - name: CS0470 - href: ../../misc/cs0470.md - - name: CS0471 - href: ../../misc/cs0471.md - - name: CS0473 - href: ../../misc/cs0473.md - - name: CS0500 - href: ../../misc/cs0500.md - - name: CS0501 - href: ../../misc/cs0501.md - - name: CS0502 - href: ../../misc/cs0502.md - - name: CS0503 - href: ../../misc/cs0503.md - - name: CS0504 - href: cs0504.md - - name: CS0505 - href: ../../misc/cs0505.md - - name: CS0506 - href: ../../misc/cs0506.md - - name: CS0507 - href: cs0507.md - - name: CS0508 - href: ../../misc/cs0508.md - - name: CS0509 - href: ../../misc/cs0509.md - - name: CS0513 - href: ../../misc/cs0513.md - - name: CS0518 - href: cs0518.md - - name: CS0520 - href: ../../misc/cs0520.md - - name: CS0523 - href: cs0523.md - - name: CS0524 - href: ../../misc/cs0524.md - - name: CS0525 - href: ../../misc/cs0525.md - - name: CS0527 - href: ../../misc/cs0527.md - - name: CS0528 - href: ../../misc/cs0528.md - - name: CS0529 - href: ../../misc/cs0529.md - - name: CS0531 - href: ../../misc/cs0531.md - - name: CS0533 - href: ../../misc/cs0533.md - - name: CS0534 - href: ../../misc/cs0534.md - - name: CS0535 - href: ../../misc/cs0535.md - - name: CS0537 - href: ../../misc/cs0537.md - - name: CS0538 - href: ../../misc/cs0538.md - - name: CS0539 - href: ../../misc/cs0539.md - - name: CS0540 - href: ../../misc/cs0540.md - - name: CS0541 - href: ../../misc/cs0541.md - - name: CS0542 - href: ../../misc/cs0542.md - - name: CS0543 - href: ../../misc/cs0543.md - - name: CS0544 - href: ../../misc/cs0544.md - - name: CS0545 - href: cs0545.md - - name: CS0546 - href: ../../misc/cs0546.md - - name: CS0547 - href: ../../misc/cs0547.md - - name: CS0548 - href: ../../misc/cs0548.md - - name: CS0549 - href: ../../misc/cs0549.md - - name: CS0550 - href: ../../misc/cs0550.md - - name: CS0551 - href: ../../misc/cs0551.md - - name: CS0552 - href: cs0552.md - - name: CS0553 - href: ../../misc/cs0553.md - - name: CS0554 - href: ../../misc/cs0554.md - - name: CS0555 - href: ../../misc/cs0555.md - - name: CS0556 - href: ../../misc/cs0556.md - - name: CS0557 - href: ../../misc/cs0557.md - - name: CS0558 - href: ../../misc/cs0558.md - - name: CS0559 - href: ../../misc/cs0559.md - - name: CS0562 - href: ../../misc/cs0562.md - - name: CS0563 - href: cs0563.md - - name: CS0564 - href: ../../misc/cs0564.md - - name: CS0567 - href: ../../misc/cs0567.md - - name: CS0569 - href: ../../misc/cs0569.md - - name: CS0570 - href: cs0570.md - - name: CS0571 - href: cs0571.md - - name: CS0572 - href: ../../misc/cs0572.md - - name: CS0573 - href: ../../misc/cs0573.md - - name: CS0574 - href: ../../misc/cs0574.md - - name: CS0575 - href: ../../misc/cs0575.md - - name: CS0577 - href: ../../misc/cs0577.md - - name: CS0578 - href: ../../misc/cs0578.md - - name: CS0579 - href: cs0579.md - - name: CS0582 - href: ../../misc/cs0582.md - - name: CS0583 - href: ../../misc/cs0583.md - - name: CS0584 - href: ../../misc/cs0584.md - - name: CS0585 - href: ../../misc/cs0585.md - - name: CS0586 - href: ../../misc/cs0586.md - - name: CS0587 - href: ../../misc/cs0587.md - - name: CS0588 - href: ../../misc/cs0588.md - - name: CS0589 - href: ../../misc/cs0589.md - - name: CS0590 - href: ../../misc/cs0590.md - - name: CS0592 - href: cs0592.md - - name: CS0594 - href: ../../misc/cs0594.md - - name: CS0596 - href: ../../misc/cs0596.md - - name: CS0601 - href: ../../misc/cs0601.md - - name: CS0609 - href: ../../misc/cs0609.md - - name: CS0610 - href: ../../misc/cs0610.md - - name: CS0616 - href: cs0616.md - - name: CS0619 - href: ../../misc/cs0619.md - - name: CS0620 - href: ../../misc/cs0620.md - - name: CS0621 - href: ../../misc/cs0621.md - - name: CS0622 - href: ../../misc/cs0622.md - - name: CS0625 - href: ../../misc/cs0625.md - - name: CS0629 - href: ../../misc/cs0629.md - - name: CS0635 - href: ../../misc/cs0635.md - - name: CS0636 - href: ../../misc/cs0636.md - - name: CS0637 - href: ../../misc/cs0637.md - - name: CS0641 - href: ../../misc/cs0641.md - - name: CS0644 - href: ../../misc/cs0644.md - - name: CS0645 - href: ../../misc/cs0645.md - - name: CS0646 - href: ../../misc/cs0646.md - - name: CS0647 - href: ../../misc/cs0647.md - - name: CS0648 - href: ../../misc/cs0648.md - - name: CS0653 - href: ../../misc/cs0653.md - - name: CS0656 - href: ../../misc/cs0656.md - - name: CS0662 - href: ../../misc/cs0662.md - - name: CS0663 - href: ../../misc/cs0663.md - - name: CS0664 - href: ../../misc/cs0664.md - - name: CS0666 - href: ../../misc/cs0666.md - - name: CS0667 - href: ../../misc/cs0667.md - - name: CS0668 - href: ../../misc/cs0668.md - - name: CS0669 - href: ../../misc/cs0669.md - - name: CS0670 - href: ../../misc/cs0670.md - - name: CS0673 - href: ../../misc/cs0673.md - - name: CS0674 - href: ../../misc/cs0674.md - - name: CS0677 - href: ../../misc/cs0677.md - - name: CS0678 - href: ../../misc/cs0678.md - - name: CS0681 - href: ../../misc/cs0681.md - - name: CS0682 - href: ../../misc/cs0682.md - - name: CS0683 - href: ../../misc/cs0683.md - - name: CS0685 - href: ../../misc/cs0685.md - - name: CS0686 - href: cs0686.md - - name: CS0689 - href: ../../misc/cs0689.md - - name: CS0690 - href: ../../misc/cs0690.md - - name: CS0692 - href: ../../misc/cs0692.md - - name: CS0694 - href: ../../misc/cs0694.md - - name: CS0695 - href: ../../misc/cs0695.md - - name: CS0698 - href: ../../misc/cs0698.md - - name: CS0699 - href: ../../misc/cs0699.md - - name: CS0701 - href: ../../misc/cs0701.md - - name: CS0702 - href: cs0702.md - - name: CS0703 - href: cs0703.md - - name: CS0704 - href: ../../misc/cs0704.md - - name: CS0706 - href: ../../misc/cs0706.md - - name: CS0708 - href: ../../misc/cs0708.md - - name: CS0709 - href: ../../misc/cs0709.md - - name: CS0711 - href: ../../misc/cs0711.md - - name: CS0712 - href: ../../misc/cs0712.md - - name: CS0713 - href: ../../misc/cs0713.md - - name: CS0714 - href: ../../misc/cs0714.md - - name: CS0715 - href: ../../misc/cs0715.md - - name: CS0716 - href: ../../misc/cs0716.md - - name: CS0717 - href: ../../misc/cs0717.md - - name: CS0718 - href: ../../misc/cs0718.md - - name: CS0720 - href: ../../misc/cs0720.md - - name: CS0721 - href: ../../misc/cs0721.md - - name: CS0722 - href: ../../misc/cs0722.md - - name: CS0723 - href: ../../misc/cs0723.md - - name: CS0724 - href: ../../misc/cs0724.md - - name: CS0726 - href: ../../misc/cs0726.md - - name: CS0727 - href: ../../misc/cs0727.md - - name: CS0729 - href: ../../misc/cs0729.md - - name: CS0730 - href: ../../misc/cs0730.md - - name: CS0731 - href: cs0731.md - - name: CS0733 - href: ../../misc/cs0733.md - - name: CS0734 - href: ../../misc/cs0734.md - - name: CS0735 - href: ../../misc/cs0735.md - - name: CS0736 - href: ../../misc/cs0736.md - - name: CS0737 - href: ../../misc/cs0737.md - - name: CS0738 - href: ../../misc/cs0738.md - - name: CS0739 - href: ../../misc/cs0739.md - - name: CS0742 - href: ../../misc/cs0742.md - - name: CS0743 - href: ../../misc/cs0743.md - - name: CS0744 - href: ../../misc/cs0744.md - - name: CS0745 - href: ../../misc/cs0745.md - - name: CS0746 - href: ../../misc/cs0746.md - - name: CS0750 - href: ../../misc/cs0750.md - - name: CS0751 - href: ../../misc/cs0751.md - - name: CS0752 - href: ../../misc/cs0752.md - - name: CS0753 - href: ../../misc/cs0753.md - - name: CS0754 - href: ../../misc/cs0754.md - - name: CS0755 - href: ../../misc/cs0755.md - - name: CS0756 - href: ../../misc/cs0756.md - - name: CS0757 - href: ../../misc/cs0757.md - - name: CS0758 - href: ../../misc/cs0758.md - - name: CS0759 - href: ../../misc/cs0759.md - - name: CS0761 - href: ../../misc/cs0761.md - - name: CS0762 - href: ../../misc/cs0762.md - - name: CS0763 - href: ../../misc/cs0763.md - - name: CS0764 - href: ../../misc/cs0764.md - - name: CS0766 - href: ../../misc/cs0766.md - - name: CS0811 - href: ../../misc/cs0811.md - - name: CS0815 - href: ../../misc/cs0815.md - - name: CS0818 - href: ../../misc/cs0818.md - - name: CS0819 - href: ../../misc/cs0819.md - - name: CS0821 - href: ../../misc/cs0821.md - - name: CS0822 - href: ../../misc/cs0822.md - - name: CS0825 - href: ../../misc/cs0825.md - - name: CS0828 - href: ../../misc/cs0828.md - - name: CS0833 - href: ../../misc/cs0833.md - - name: CS0836 - href: ../../misc/cs0836.md - - name: CS0837 - href: ../../misc/cs0837.md - - name: CS0840 - href: cs0840.md - - name: CS0841 - href: ../../misc/cs0841.md - - name: CS0842 - href: ../../misc/cs0842.md - - name: CS0844 - href: ../../misc/cs0844.md - - name: CS1001 - href: cs1001.md - - name: CS1002 - href: ../../misc/cs1002.md - - name: CS1003 - href: ../../misc/cs1003.md - - name: CS1004 - href: ../../misc/cs1004.md - - name: CS1007 - href: ../../misc/cs1007.md - - name: CS1008 - href: ../../misc/cs1008.md - - name: CS1009 - href: cs1009.md - - name: CS1010 - href: ../../misc/cs1010.md - - name: CS1011 - href: ../../misc/cs1011.md - - name: CS1012 - href: ../../misc/cs1012.md - - name: CS1013 - href: ../../misc/cs1013.md - - name: CS1014 - href: ../../misc/cs1014.md - - name: CS1015 - href: ../../misc/cs1015.md - - name: CS1017 - href: ../../misc/cs1017.md - - name: CS1018 - href: cs1018.md - - name: CS1019 - href: cs1019.md - - name: CS1020 - href: ../../misc/cs1020.md - - name: CS1021 - href: ../../misc/cs1021.md - - name: CS1022 - href: ../../misc/cs1022.md - - name: CS1023 - href: ../../misc/cs1023.md - - name: CS1024 - href: ../../misc/cs1024.md - - name: CS1025 - href: ../../misc/cs1025.md - - name: CS1026 - href: cs1026.md - - name: CS1027 - href: ../../misc/cs1027.md - - name: CS1028 - href: ../../misc/cs1028.md - - name: CS1029 - href: cs1029.md - - name: CS1031 - href: ../../misc/cs1031.md - - name: CS1032 - href: ../../misc/cs1032.md - - name: CS1033 - href: ../../misc/cs1033.md - - name: CS1034 - href: ../../misc/cs1034.md - - name: CS1035 - href: ../../misc/cs1035.md - - name: CS1036 - href: ../../misc/cs1036.md - - name: CS1037 - href: ../../misc/cs1037.md - - name: CS1038 - href: ../../misc/cs1038.md - - name: CS1039 - href: ../../misc/cs1039.md - - name: CS1040 - href: ../../misc/cs1040.md - - name: CS1041 - href: ../../misc/cs1041.md - - name: CS1043 - href: ../../misc/cs1043.md - - name: CS1044 - href: ../../misc/cs1044.md - - name: CS1055 - href: ../../misc/cs1055.md - - name: CS1056 - href: ../../misc/cs1056.md - - name: CS1057 - href: ../../misc/cs1057.md - - name: CS1059 - href: ../../misc/cs1059.md - - name: CS1061 - href: cs1061.md - - name: CS1063 - href: cs1063.md - - name: CS1065 - href: cs1065.md - - name: CS1067 - href: cs1067.md - - name: CS1100 - href: ../../misc/cs1100.md - - name: CS1101 - href: ../../misc/cs1101.md - - name: CS1102 - href: ../../misc/cs1102.md - - name: CS1103 - href: ../../misc/cs1103.md - - name: CS1104 - href: ../../misc/cs1104.md - - name: CS1105 - href: ../../misc/cs1105.md - - name: CS1106 - href: ../../misc/cs1106.md - - name: CS1107 - href: ../../misc/cs1107.md - - name: CS1108 - href: ../../misc/cs1108.md - - name: CS1109 - href: ../../misc/cs1109.md - - name: CS1110 - href: ../../misc/cs1110.md - - name: CS1112 - href: cs1112.md - - name: CS1113 - href: ../../misc/cs1113.md - - name: CS1501 - href: cs1501.md - - name: CS1502 - href: cs1502.md - - name: CS1503 - href: ../../misc/cs1503.md - - name: CS1504 - href: ../../misc/cs1504.md - - name: CS1507 - href: ../../misc/cs1507.md - - name: CS1508 - href: ../../misc/cs1508.md - - name: CS1509 - href: ../../misc/cs1509.md - - name: CS1511 - href: ../../misc/cs1511.md - - name: CS1512 - href: ../../misc/cs1512.md - - name: CS1513 - href: ../../misc/cs1513.md - - name: CS1514 - href: ../../misc/cs1514.md - - name: CS1515 - href: ../../misc/cs1515.md - - name: CS1517 - href: ../../misc/cs1517.md - - name: CS1518 - href: ../../misc/cs1518.md - - name: CS1519 - href: cs1519.md - - name: CS1520 - href: ../../misc/cs1520.md - - name: CS1521 - href: ../../misc/cs1521.md - - name: CS1524 - href: ../../misc/cs1524.md - - name: CS1525 - href: ../../misc/cs1525.md - - name: CS1526 - href: ../../misc/cs1526.md - - name: CS1527 - href: ../../misc/cs1527.md - - name: CS1528 - href: ../../misc/cs1528.md - - name: CS1530 - href: ../../misc/cs1530.md - - name: CS1534 - href: ../../misc/cs1534.md - - name: CS1535 - href: ../../misc/cs1535.md - - name: CS1536 - href: ../../misc/cs1536.md - - name: CS1540 - href: cs1540.md - - name: CS1541 - href: ../../misc/cs1541.md - - name: CS1542 - href: ../../misc/cs1542.md - - name: CS1545 - href: ../../misc/cs1545.md - - name: CS1546 - href: cs1546.md - - name: CS1547 - href: ../../misc/cs1547.md - - name: CS1548 - href: cs1548.md - - name: CS1551 - href: ../../misc/cs1551.md - - name: CS1553 - href: ../../misc/cs1553.md - - name: CS1554 - href: ../../misc/cs1554.md - - name: CS1555 - href: ../../misc/cs1555.md - - name: CS1556 - href: ../../misc/cs1556.md - - name: CS1557 - href: ../../misc/cs1557.md - - name: CS1558 - href: ../../misc/cs1558.md - - name: CS1559 - href: ../../misc/cs1559.md - - name: CS1560 - href: ../../misc/cs1560.md - - name: CS1561 - href: ../../misc/cs1561.md - - name: CS1562 - href: ../../misc/cs1562.md - - name: CS1563 - href: ../../misc/cs1563.md - - name: CS1564 - href: cs1564.md - - name: CS1565 - href: ../../misc/cs1565.md - - name: CS1566 - href: ../../misc/cs1566.md - - name: CS1567 - href: cs1567.md - - name: CS1569 - href: ../../misc/cs1569.md - - name: CS1575 - href: ../../misc/cs1575.md - - name: CS1576 - href: ../../misc/cs1576.md - - name: CS1577 - href: ../../misc/cs1577.md - - name: CS1578 - href: ../../misc/cs1578.md - - name: CS1579 - href: cs1579.md - - name: CS1583 - href: ../../misc/cs1583.md - - name: CS1585 - href: ../../misc/cs1585.md - - name: CS1588 - href: ../../misc/cs1588.md - - name: CS1593 - href: ../../misc/cs1593.md - - name: CS1594 - href: ../../misc/cs1594.md - - name: CS1597 - href: ../../misc/cs1597.md - - name: CS1599 - href: ../../misc/cs1599.md - - name: CS1600 - href: ../../misc/cs1600.md - - name: CS1601 - href: ../../misc/cs1601.md - - name: CS1604 - href: ../../misc/cs1604.md - - name: CS1606 - href: ../../misc/cs1606.md - - name: CS1608 - href: ../../misc/cs1608.md - - name: CS1609 - href: ../../misc/cs1609.md - - name: CS1611 - href: ../../misc/cs1611.md - - name: CS1612 - href: cs1612.md - - name: CS1613 - href: ../../misc/cs1613.md - - name: CS1614 - href: cs1614.md - - name: CS1615 - href: ../../misc/cs1615.md - - name: CS1617 - href: ../../misc/cs1617.md - - name: CS1618 - href: ../../misc/cs1618.md - - name: CS1619 - href: ../../misc/cs1619.md - - name: CS1620 - href: ../../misc/cs1620.md - - name: CS1622 - href: ../../misc/cs1622.md - - name: CS1624 - href: ../../misc/cs1624.md - - name: CS1625 - href: ../../misc/cs1625.md - - name: CS1626 - href: ../../misc/cs1626.md - - name: CS1627 - href: ../../misc/cs1627.md - - name: CS1629 - href: ../../misc/cs1629.md - - name: CS1630 - href: ../../misc/cs1630.md - - name: CS1631 - href: ../../misc/cs1631.md - - name: CS1637 - href: ../../misc/cs1637.md - - name: CS1638 - href: ../../misc/cs1638.md - - name: CS1639 - href: ../../misc/cs1639.md - - name: CS1640 - href: cs1640.md - - name: CS1641 - href: ../../misc/cs1641.md - - name: CS1642 - href: ../../misc/cs1642.md - - name: CS1643 - href: ../../misc/cs1643.md - - name: CS1644 - href: cs1644.md - - name: CS1646 - href: ../../misc/cs1646.md - - name: CS1647 - href: ../../misc/cs1647.md - - name: CS1648 - href: ../../misc/cs1648.md - - name: CS1650 - href: ../../misc/cs1650.md - - name: CS1654 - href: ../../misc/cs1654.md - - name: CS1656 - href: cs1656.md - - name: CS1660 - href: ../../misc/cs1660.md - - name: CS1661 - href: ../../misc/cs1661.md - - name: CS1662 - href: ../../misc/cs1662.md - - name: CS1663 - href: ../../misc/cs1663.md - - name: CS1664 - href: ../../misc/cs1664.md - - name: CS1665 - href: ../../misc/cs1665.md - - name: CS1666 - href: ../../misc/cs1666.md - - name: CS1667 - href: ../../misc/cs1667.md - - name: CS1670 - href: ../../misc/cs1670.md - - name: CS1671 - href: ../../misc/cs1671.md - - name: CS1672 - href: ../../misc/cs1672.md - - name: CS1674 - href: cs1674.md - - name: CS1675 - href: ../../misc/cs1675.md - - name: CS1676 - href: ../../misc/cs1676.md - - name: CS1677 - href: ../../misc/cs1677.md - - name: CS1678 - href: ../../misc/cs1678.md - - name: CS1679 - href: ../../misc/cs1679.md - - name: CS1680 - href: ../../misc/cs1680.md - - name: CS1681 - href: ../../misc/cs1681.md - - name: CS1688 - href: ../../misc/cs1688.md - - name: CS1689 - href: ../../misc/cs1689.md - - name: CS1703 - href: cs1703.md - - name: CS1705 - href: cs1705.md - - name: CS1708 - href: cs1708.md - - name: CS1713 - href: ../../misc/cs1713.md - - name: CS1715 - href: ../../misc/cs1715.md - - name: CS1716 - href: cs1716.md - - name: CS1719 - href: ../../misc/cs1719.md - - name: CS1721 - href: cs1721.md - - name: CS1722 - href: ../../misc/cs1722.md - - name: CS1724 - href: ../../misc/cs1724.md - - name: CS1725 - href: ../../misc/cs1725.md - - name: CS1726 - href: cs1726.md - - name: CS1727 - href: ../../misc/cs1727.md - - name: CS1728 - href: ../../misc/cs1728.md - - name: CS1729 - href: cs1729.md - - name: CS1730 - href: ../../misc/cs1730.md - - name: CS1731 - href: ../../misc/cs1731.md - - name: CS1732 - href: ../../misc/cs1732.md - - name: CS1733 - href: ../../misc/cs1733.md - - name: CS1736 - href: cs1736.md - - name: CS1737 - href: cs1737.md - - name: CS1750 - href: cs1750.md - - name: CS1751 - href: cs1751.md - - name: CS1763 - href: cs1763.md - - name: CS1900 - href: ../../misc/cs1900.md - - name: CS1902 - href: ../../misc/cs1902.md - - name: CS1906 - href: ../../misc/cs1906.md - - name: CS1908 - href: ../../misc/cs1908.md - - name: CS1909 - href: ../../misc/cs1909.md - - name: CS1910 - href: ../../misc/cs1910.md - - name: CS1912 - href: ../../misc/cs1912.md - - name: CS1913 - href: ../../misc/cs1913.md - - name: CS1914 - href: ../../misc/cs1914.md - - name: CS1917 - href: ../../misc/cs1917.md - - name: CS1918 - href: ../../misc/cs1918.md - - name: CS1919 - href: cs1919.md - - name: CS1922 - href: ../../misc/cs1922.md - - name: CS1926 - href: cs1926.md - - name: CS1928 - href: ../../misc/cs1928.md - - name: CS1929 - href: ../../misc/cs1929.md - - name: CS1930 - href: ../../misc/cs1930.md - - name: CS1931 - href: ../../misc/cs1931.md - - name: CS1932 - href: ../../misc/cs1932.md - - name: CS1933 - href: cs1933.md - - name: CS1934 - href: ../../misc/cs1934.md - - name: CS1935 - href: ../../misc/cs1935.md - - name: CS1936 - href: cs1936.md - - name: CS1937 - href: ../../misc/cs1937.md - - name: CS1938 - href: ../../misc/cs1938.md - - name: CS1940 - href: ../../misc/cs1940.md - - name: CS1941 - href: cs1941.md - - name: CS1942 - href: cs1942.md - - name: CS1943 - href: cs1943.md - - name: CS1947 - href: ../../misc/cs1947.md - - name: CS1948 - href: ../../misc/cs1948.md - - name: CS1949 - href: ../../misc/cs1949.md - - name: CS1950 - href: ../../misc/cs1950.md - - name: CS1955 - href: ../../misc/cs1955.md - - name: CS1958 - href: ../../misc/cs1958.md - - name: CS1959 - href: ../../misc/cs1959.md - - name: CS1983 - href: cs1983.md - - name: CS1986 - href: cs1986.md - - name: CS1994 - href: cs1994.md - - name: CS1996 - href: cs1996.md - - name: CS1997 - href: cs1997.md - - name: CS2001 - href: ../../misc/cs2001.md - - name: CS2003 - href: ../../misc/cs2003.md - - name: CS2005 - href: ../../misc/cs2005.md - - name: CS2006 - href: ../../misc/cs2006.md - - name: CS2007 - href: ../../misc/cs2007.md - - name: CS2008 - href: ../../misc/cs2008.md - - name: CS2011 - href: ../../misc/cs2011.md - - name: CS2012 - href: ../../misc/cs2012.md - - name: CS2013 - href: ../../misc/cs2013.md - - name: CS2015 - href: ../../misc/cs2015.md - - name: CS2016 - href: ../../misc/cs2016.md - - name: CS2017 - href: ../../misc/cs2017.md - - name: CS2018 - href: ../../misc/cs2018.md - - name: CS2019 - href: ../../misc/cs2019.md - - name: CS2020 - href: ../../misc/cs2020.md - - name: CS2021 - href: ../../misc/cs2021.md - - name: CS2022 - href: ../../misc/cs2022.md - - name: CS2024 - href: ../../misc/cs2024.md - - name: CS2032 - href: cs2032.md - - name: CS2033 - href: ../../misc/cs2033.md - - name: CS2034 - href: ../../misc/cs2034.md - - name: CS2035 - href: ../../misc/cs2035.md - - name: CS2036 - href: ../../misc/cs2036.md - - name: CS4004 - href: cs4004.md - - name: CS4008 - href: cs4008.md - - name: CS4009 - href: ../../misc/CS4009.md - - name: CS4013 - href: cs4013.md - - name: CS4032 - href: cs4032.md - - name: CS4033 - href: cs4033.md - - name: CS5001 - href: ../../misc/cs5001.md - - name: CS7003 - href: cs7003.md - - name: CS8124 - href: cs8124.md - - name: CS8125 - href: cs8125.md - - name: CS8127 - href: cs8127.md - - name: CS8129 - href: cs8129.md - - name: CS8130 - href: cs8130.md - - name: CS8131 - href: cs8131.md - - name: CS8132 - href: cs8132.md - - name: CS8139 - href: cs8139.md - - name: CS8140 - href: cs8140.md - - name: CS8141 - href: cs8141.md - - name: CS8145 - href: cs8145.md - - name: CS8146 - href: cs8146.md - - name: CS8147 - href: cs8147.md - - name: CS8148 - href: cs8148.md - - name: CS8149 - href: cs8149.md - - name: CS8150 - href: cs8150.md - - name: CS8151 - href: cs8151.md - - name: CS8152 - href: cs8152.md - - name: CS8154 - href: cs8154.md - - name: CS8156 - href: cs8156.md - - name: CS8157 - href: cs8157.md - - name: CS8158 - href: cs8158.md - - name: CS8159 - href: cs8159.md - - name: CS8160 - href: cs8160.md - - name: CS8161 - href: cs8161.md - - name: CS8162 - href: cs8162.md - - name: CS8163 - href: cs8163.md - - name: CS8170 - href: cs8170.md - - name: CS8171 - href: cs8171.md - - name: CS8172 - href: cs8172.md - - name: CS8173 - href: cs8173.md - - name: CS8174 - href: cs8174.md - - name: CS8176 - href: cs8176.md - - name: CS8177 - href: cs8177.md - - name: CS8178 - href: cs8178.md - - name: CS8210 - href: cs8210.md - - name: CS8333 - href: cs8333.md - - name: CS8334 - href: cs8334.md - - name: CS8354 - href: cs8354.md - - name: CS8355 - href: cs8355.md - - name: CS8403 - href: cs8403.md - - name: CS8410 - href: cs8410.md - - name: CS8411 - href: cs8411.md - - name: CS8422 - href: cs8422.md - - name: CS8515 - href: cs8515.md - - name: CS8795 - href: CS8795.md - - name: CS8803 - href: cs8803.md - - name: CS8812 - href: cs8812.md - - name: CS8515 - href: cs8515.md - - name: CS8817 - href: CS8817.md - - name: CS9043 - href: cs9043.md - - name: CS9050 - href: cs9050.md -- name: Level 1 warning messages - items: - - name: CS0183 - href: ../../misc/cs0183.md - - name: CS0184 - href: ../../misc/cs0184.md - - name: CS0197 - href: ../../misc/cs0197.md - - name: CS0420 - href: cs0420.md - - name: CS0465 - href: cs0465.md - - name: CS0602 - href: ../../misc/cs0602.md - - name: CS0612 - href: ../../misc/cs0612.md - - name: CS0626 - href: ../../misc/cs0626.md - - name: CS0657 - href: ../../misc/cs0657.md - - name: CS0658 - href: ../../misc/cs0658.md - - name: CS0672 - href: ../../misc/cs0672.md - - name: CS0684 - href: ../../misc/cs0684.md - - name: CS0688 - href: ../../misc/cs0688.md - - name: CS0809 - href: ../../misc/cs0809.md - - name: CS1030 - href: ../../misc/cs1030.md - - name: CS1058 - href: cs1058.md - - name: CS1060 - href: cs1060.md - - name: CS1200 - href: ../../misc/cs1200.md - - name: CS1201 - href: ../../misc/cs1201.md - - name: CS1202 - href: ../../misc/cs1202.md - - name: CS1203 - href: ../../misc/cs1203.md - - name: CS1522 - href: ../../misc/cs1522.md - - name: CS1570 - href: ../../misc/cs1570.md - - name: CS1574 - href: ../../misc/cs1574.md - - name: CS1580 - href: ../../misc/cs1580.md - - name: CS1581 - href: ../../misc/cs1581.md - - name: CS1584 - href: ../../misc/cs1584.md - - name: CS1589 - href: ../../misc/cs1589.md - - name: CS1590 - href: ../../misc/cs1590.md - - name: CS1592 - href: ../../misc/cs1592.md - - name: CS1598 - href: cs1598.md - - name: CS1607 - href: cs1607.md - - name: CS1616 - href: cs1616.md - - name: CS1633 - href: ../../misc/cs1633.md - - name: CS1634 - href: ../../misc/cs1634.md - - name: CS1635 - href: ../../misc/cs1635.md - - name: CS1645 - href: ../../misc/cs1645.md - - name: CS1658 - href: cs1658.md - - name: CS1682 - href: ../../misc/cs1682.md - - name: CS1684 - href: ../../misc/cs1684.md - - name: CS1685 - href: cs1685.md - - name: CS1687 - href: ../../misc/cs1687.md - - name: CS1690 - href: cs1690.md - - name: CS1691 - href: cs1691.md - - name: CS1692 - href: ../../misc/cs1692.md - - name: CS1694 - href: ../../misc/cs1694.md - - name: CS1695 - href: ../../misc/cs1695.md - - name: CS1696 - href: ../../misc/cs1696.md - - name: CS1697 - href: ../../misc/cs1697.md - - name: CS1699 - href: cs1699.md - - name: CS1707 - href: ../../misc/cs1707.md - - name: CS1709 - href: ../../misc/cs1709.md - - name: CS1720 - href: ../../misc/cs1720.md - - name: CS1723 - href: ../../misc/cs1723.md - - name: CS1762 - href: cs1762.md - - name: CS1911 - href: ../../misc/cs1911.md - - name: CS1956 - href: cs1956.md - - name: CS1957 - href: ../../misc/cs1957.md - - name: CS2002 - href: ../../misc/cs2002.md - - name: CS2014 - href: ../../misc/cs2014.md - - name: CS2023 - href: ../../misc/cs2023.md - - name: CS2029 - href: ../../misc/cs2029.md - - name: CS3000 - href: ../../misc/cs3000.md - - name: CS3001 - href: ../../misc/cs3001.md - - name: CS3002 - href: ../../misc/cs3002.md - - name: CS3003 - href: cs3003.md - - name: CS3004 - href: ../../misc/cs3004.md - - name: CS3005 - href: ../../misc/cs3005.md - - name: CS3006 - href: ../../misc/cs3006.md - - name: CS3008 - href: ../../misc/cs3008.md - - name: CS3009 - href: cs3009.md - - name: CS3010 - href: ../../misc/cs3010.md - - name: CS3011 - href: ../../misc/cs3011.md - - name: CS3012 - href: ../../misc/cs3012.md - - name: CS3013 - href: ../../misc/cs3013.md - - name: CS3014 - href: ../../misc/cs3014.md - - name: CS3015 - href: ../../misc/cs3015.md - - name: CS3017 - href: ../../misc/cs3017.md - - name: CS3018 - href: ../../misc/cs3018.md - - name: CS3022 - href: ../../misc/cs3022.md - - name: CS3023 - href: ../../misc/cs3023.md - - name: CS3024 - href: ../../misc/cs3024.md - - name: CS3026 - href: ../../misc/cs3026.md - - name: CS3027 - href: ../../misc/cs3027.md - - name: CS4014 - href: cs4014.md - - name: CS5000 - href: ../../misc/cs5000.md -- name: Level 2 warning messages - items: - - name: CS0108 - href: cs0108.md - - name: CS0114 - href: ../../misc/cs0114.md - - name: CS0162 - href: ../../misc/cs0162.md - - name: CS0164 - href: ../../misc/cs0164.md - - name: CS0252 - href: ../../misc/cs0252.md - - name: CS0253 - href: ../../misc/cs0253.md - - name: CS0278 - href: ../../misc/cs0278.md - - name: CS0279 - href: ../../misc/cs0279.md - - name: CS0280 - href: ../../misc/cs0280.md - - name: CS0435 - href: ../../misc/cs0435.md - - name: CS0436 - href: ../../misc/cs0436.md - - name: CS0437 - href: ../../misc/cs0437.md - - name: CS0444 - href: ../../misc/cs0444.md - - name: CS0458 - href: ../../misc/cs0458.md - - name: CS0464 - href: ../../misc/cs0464.md - - name: CS0467 - href: cs0467.md - - name: CS0469 - href: ../../misc/cs0469.md - - name: CS0472 - href: ../../misc/cs0472.md - - name: CS0618 - href: cs0618.md - - name: CS0652 - href: ../../misc/cs0652.md - - name: CS0728 - href: ../../misc/cs0728.md - - name: CS1571 - href: ../../misc/cs1571.md - - name: CS1572 - href: ../../misc/cs1572.md - - name: CS1587 - href: ../../misc/cs1587.md - - name: CS1668 - href: ../../misc/cs1668.md - - name: CS1698 - href: ../../misc/cs1698.md - - name: CS1701 - href: cs1701.md - - name: CS1710 - href: ../../misc/cs1710.md - - name: CS1711 - href: ../../misc/cs1711.md - - name: CS1927 - href: ../../misc/cs1927.md - - name: CS3019 - href: ../../misc/cs3019.md - - name: CS3021 - href: ../../misc/cs3021.md -- name: Level 3 warning messages - items: - - name: CS0067 - href: ../../misc/cs0067.md - - name: CS0168 - href: ../../misc/cs0168.md - - name: CS0169 - href: ../../misc/cs0169.md - - name: CS0219 - href: ../../misc/cs0219.md - - name: CS0282 - href: ../../misc/cs0282.md - - name: CS0414 - href: ../../misc/cs0414.md - - name: CS0419 - href: ../../misc/cs0419.md - - name: CS0642 - href: ../../misc/cs0642.md - - name: CS0659 - href: ../../misc/cs0659.md - - name: CS0660 - href: ../../misc/cs0660.md - - name: CS0661 - href: ../../misc/cs0661.md - - name: CS0665 - href: ../../misc/cs0665.md - - name: CS0675 - href: cs0675.md - - name: CS0693 - href: ../../misc/cs0693.md - - name: CS1700 - href: cs1700.md - - name: CS1702 - href: ../../misc/cs1702.md - - name: CS1717 - href: ../../misc/cs1717.md - - name: CS1718 - href: ../../misc/cs1718.md -- name: Level 4 warning messages - items: - - name: CS0028 - href: ../../misc/cs0028.md - - name: CS0078 - href: ../../misc/cs0078.md - - name: CS0109 - href: ../../misc/cs0109.md - - name: CS0402 - href: ../../misc/cs0402.md - - name: CS0422 - href: ../../misc/cs0422.md - - name: CS0429 - href: cs0429.md - - name: CS0628 - href: ../../misc/cs0628.md - - name: CS0649 - href: ../../misc/cs0649.md - - name: CS1573 - href: ../../misc/cs1573.md - - name: CS1591 - href: cs1591.md - - name: CS1610 - href: cs1610.md - - name: CS1712 - href: ../../misc/cs1712.md diff --git a/docs/csharp/language-reference/compiler-options/advanced.md b/docs/csharp/language-reference/compiler-options/advanced.md index 40195ed903b7d..34b8f613e170b 100644 --- a/docs/csharp/language-reference/compiler-options/advanced.md +++ b/docs/csharp/language-reference/compiler-options/advanced.md @@ -85,6 +85,9 @@ When you specify [**DebugType**](code-generation.md#debugtype), the compiler cre ## PathMap +> [!NOTE] +Specifying **PathMap** will prevent breakpoints from working in local debug builds. Only set **PathMap** for production or [continuous integration builds](https://learn.microsoft.com/dotnet/core/project-sdk/msbuild-props#continuousintegrationbuild). + The **PathMap** compiler option specifies how to map physical paths to source path names output by the compiler. This option maps each physical path on the machine where the compiler runs to a corresponding path that should be written in the output files. In the following example, `path1` is the full path to the source files in the current environment, and `sourcePath1` is the source path substituted for `path1` in any output files. To specify multiple mapped source paths, separate each with a comma. ```xml diff --git a/docs/csharp/language-reference/index.md b/docs/csharp/language-reference/index.md deleted file mode 100644 index 96a6b75ebb060..0000000000000 --- a/docs/csharp/language-reference/index.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -description: "C# reference" -title: "C# reference" -ms.date: 06/19/2023 -ms.custom: "updateeachrelease" -f1_keywords: - - _CSharpKeyword -helpviewer_keywords: - - "Visual C#, language reference" - - "language reference [C#]" - - "Programmer's Reference for C#" - - "C# language, reference" - - "reference, C# language" -ms.assetid: 06de3167-c16c-4e1a-b3c5-c27841d4569a ---- -# C# reference - -This section provides reference material about C# keywords, operators, special characters, preprocessor directives, compiler options, and compiler errors and warnings. - -## In this section - -[C# types](builtin-types/value-types.md) - -[C# keywords](./keywords/index.md) -Provides links to information about C# keywords and syntax. - -[C# operators](./operators/index.md) -Provides links to information about C# operators and syntax. - -[C# statements](statements/declarations.md) - -[C# special characters](./tokens/index.md) -Provides links to information about special contextual characters in C# and their usage. - -[C# attributes](attributes/global.md) - -[C# preprocessor directives](preprocessor-directives.md) -Provides links to information about compiler commands for embedding in C# source code. - -[C# compiler options](./compiler-options/index.md) -Includes information about compiler options and how to use them. - -[XML documentation comments](xmldoc/index.md) - -[C# compiler errors](./compiler-messages/index.md) -Includes code snippets that demonstrate the cause and correction of C# compiler errors and warnings. - -[C# standard specification](specifications.md) -The latest C# standard draft, as created by the ECMA committee. The feature specifications for those features implemented in newer language versions. - -## Related sections - - [Using the Visual Studio development environment for C#](/visualstudio/get-started/csharp) - Provides links to conceptual and task topics that describe the IDE and editor. - - Includes information about how to use the C# programming language. diff --git a/docs/csharp/language-reference/index.yml b/docs/csharp/language-reference/index.yml new file mode 100644 index 0000000000000..4170029aec68b --- /dev/null +++ b/docs/csharp/language-reference/index.yml @@ -0,0 +1,57 @@ +### YamlMime:Landing + +title: "C# language reference" +summary: "The language reference provides an informal reference to C# syntax and idioms for beginners and experienced C# and .NET developers." + +metadata: + title: "C# language reference." + description: "Read C# reference material - The language reference provides an informal reference to C# syntax and idioms for beginners and experienced C# / .NET developers." + ms.topic: landing-page # Required + ms.date: 04/05/2023 + +landingContent: + - title: "C# language reference" + linkLists: + - linkListType: overview + links: + - text: C# language strategy + url: ../tour-of-csharp/strategy.md + - linkListType: reference + links: + - text: "C# keywords" + url: ../language-reference/keywords/index.md + - text: "C# operators and expressions" + url: ../language-reference/operators/index.md + - text: Configure language version + url: ../language-reference/configure-language-version.md + - text: "C# language specification - C# 8 draft in progress" + url: ../specification/index.yml + + - title: "What's new" + linkLists: + - linkListType: whats-new + links: + - text: "What's new in C# 12" + url: ../whats-new/csharp-12.md + - text: "What's new in C# 11" + url: ../whats-new/csharp-11.md + - text: "What's new in C# 10" + url: ../whats-new/csharp-10.md + - linkListType: reference + links: + - text: Breaking changes in the C# compiler + url: ../whats-new/breaking-changes.md + - text: Version compatibility + url: ../whats-new/version-update-considerations.md + + + - title: "Stay in touch" + linkLists: + - linkListType: reference + links: + - text: ".NET developer community" + url: https://dotnet.microsoft.com/platform/community + - text: "YouTube" + url: https://www.youtube.com/dotnet + - text: "Twitter" + url: https://twitter.com/DotNet diff --git a/docs/csharp/language-reference/keywords/abstract.md b/docs/csharp/language-reference/keywords/abstract.md index 3b4f8b0a20c30..7893e420f6e03 100644 --- a/docs/csharp/language-reference/keywords/abstract.md +++ b/docs/csharp/language-reference/keywords/abstract.md @@ -81,7 +81,6 @@ You will get an error saying that the compiler cannot create an instance of the ## See also -- [C# Reference](../index.md) - [Modifiers](index.md) - [virtual](./virtual.md) - [override](./override.md) diff --git a/docs/csharp/language-reference/keywords/access-modifiers.md b/docs/csharp/language-reference/keywords/access-modifiers.md index b00d4239b9731..dc92fed286c2b 100644 --- a/docs/csharp/language-reference/keywords/access-modifiers.md +++ b/docs/csharp/language-reference/keywords/access-modifiers.md @@ -34,7 +34,6 @@ Access modifiers are keywords used to specify the declared accessibility of a me ## See also - [Add accessibility modifiers (style rule IDE0040)](../../../fundamentals/code-analysis/style-rules/ide0040.md) -- [C# Reference](../index.md) - [C# Keywords](./index.md) - [Access Modifiers](../../programming-guide/classes-and-structs/access-modifiers.md) - [Access Keywords](base.md) diff --git a/docs/csharp/language-reference/keywords/accessibility-domain.md b/docs/csharp/language-reference/keywords/accessibility-domain.md index d91b4ca566c9c..d6657c3936120 100644 --- a/docs/csharp/language-reference/keywords/accessibility-domain.md +++ b/docs/csharp/language-reference/keywords/accessibility-domain.md @@ -24,7 +24,6 @@ The accessibility domain of a member specifies in which program sections a membe ## See also -- [C# Reference](../index.md) - [C# Keywords](./index.md) - [Access Modifiers](./access-modifiers.md) - [Accessibility Levels](./accessibility-levels.md) diff --git a/docs/csharp/language-reference/keywords/accessibility-levels.md b/docs/csharp/language-reference/keywords/accessibility-levels.md index 7a713ec5a32cf..bb02b12f2ecb4 100644 --- a/docs/csharp/language-reference/keywords/accessibility-levels.md +++ b/docs/csharp/language-reference/keywords/accessibility-levels.md @@ -51,7 +51,6 @@ The accessibility of a nested type depends on its [accessibility domain](./acces ## See also -- [C# Reference](../index.md) - [C# Keywords](./index.md) - [Access Modifiers](./access-modifiers.md) - [Accessibility Domain](./accessibility-domain.md) diff --git a/docs/csharp/language-reference/keywords/ascending.md b/docs/csharp/language-reference/keywords/ascending.md index 5c7e1decffd05..dd679bf9d5bf1 100644 --- a/docs/csharp/language-reference/keywords/ascending.md +++ b/docs/csharp/language-reference/keywords/ascending.md @@ -21,6 +21,5 @@ The `ascending` contextual keyword is used in the [orderby clause](./orderby-cla ## See also -- [C# Reference](../index.md) - [LINQ in C#](../../linq/index.md) - [descending](./descending.md) diff --git a/docs/csharp/language-reference/keywords/base.md b/docs/csharp/language-reference/keywords/base.md index 4fb5dd0ae6d08..d9d3724de6dfe 100644 --- a/docs/csharp/language-reference/keywords/base.md +++ b/docs/csharp/language-reference/keywords/base.md @@ -44,6 +44,5 @@ This example shows how to specify the base-class constructor called when creatin ## See also -- [C# Reference](../index.md) - [C# Keywords](./index.md) - [this](./this.md) diff --git a/docs/csharp/language-reference/keywords/class.md b/docs/csharp/language-reference/keywords/class.md index d2691f8e7e06b..f6c9c42c18bd6 100644 --- a/docs/csharp/language-reference/keywords/class.md +++ b/docs/csharp/language-reference/keywords/class.md @@ -96,6 +96,5 @@ Finally, notice that for the object created using the parameterless constructor ## See also -- [C# Reference](../index.md) - [C# Keywords](./index.md) - [Reference Types](./reference-types.md) diff --git a/docs/csharp/language-reference/keywords/const.md b/docs/csharp/language-reference/keywords/const.md index 8c2b806d9b61f..f63ab251e807c 100644 --- a/docs/csharp/language-reference/keywords/const.md +++ b/docs/csharp/language-reference/keywords/const.md @@ -69,6 +69,5 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [C# keywords](index.md) - [readonly](readonly.md) diff --git a/docs/csharp/language-reference/keywords/default.md b/docs/csharp/language-reference/keywords/default.md index 95b0b7bc6cc0b..fc98fd4561a44 100644 --- a/docs/csharp/language-reference/keywords/default.md +++ b/docs/csharp/language-reference/keywords/default.md @@ -19,5 +19,4 @@ You can use the `default` keyword in the following contexts: ## See also -- [C# reference](../index.md) - [C# keywords](index.md) diff --git a/docs/csharp/language-reference/keywords/descending.md b/docs/csharp/language-reference/keywords/descending.md index 377bf07a0c3c6..41a00e64d5d69 100644 --- a/docs/csharp/language-reference/keywords/descending.md +++ b/docs/csharp/language-reference/keywords/descending.md @@ -21,6 +21,5 @@ The following example shows the use of `descending` in an [orderby clause](./ord ## See also -- [C# Reference](../index.md) - [LINQ in C#](../../linq/index.md) - [ascending](./ascending.md) diff --git a/docs/csharp/language-reference/keywords/event.md b/docs/csharp/language-reference/keywords/event.md index b429582a77063..622de80d09694 100644 --- a/docs/csharp/language-reference/keywords/event.md +++ b/docs/csharp/language-reference/keywords/event.md @@ -46,7 +46,6 @@ An event can be marked as a virtual event by using the [virtual](./virtual.md) k ## See also -- [C# Reference](../index.md) - [C# Keywords](./index.md) - [add](./add.md) - [remove](./remove.md) diff --git a/docs/csharp/language-reference/keywords/extern-alias.md b/docs/csharp/language-reference/keywords/extern-alias.md index 7167cffc5775d..724a1788b8824 100644 --- a/docs/csharp/language-reference/keywords/extern-alias.md +++ b/docs/csharp/language-reference/keywords/extern-alias.md @@ -61,7 +61,6 @@ using Class1V2 = GridV2::Namespace.Class1; ## See also -- [C# Reference](../index.md) - [C# Keywords](./index.md) - [:: Operator](../operators/namespace-alias-qualifier.md) - [**References** (C# Compiler Options)](../compiler-options/inputs.md#references) diff --git a/docs/csharp/language-reference/keywords/extern.md b/docs/csharp/language-reference/keywords/extern.md index 843bd65918051..2868420ca957a 100644 --- a/docs/csharp/language-reference/keywords/extern.md +++ b/docs/csharp/language-reference/keywords/extern.md @@ -87,6 +87,5 @@ This example illustrates a C# program that calls into a C library (a native DLL) ## See also - -- [C# Reference](../index.md) - [C# Keywords](index.md) - [Modifiers](index.md) diff --git a/docs/csharp/language-reference/keywords/file.md b/docs/csharp/language-reference/keywords/file.md index ce2d15da8bf5e..5bd85c2887e26 100644 --- a/docs/csharp/language-reference/keywords/file.md +++ b/docs/csharp/language-reference/keywords/file.md @@ -40,7 +40,6 @@ For more information, see [Declared accessibility](~/_csharpstandard/standard/ba ## See also -- [C# Reference](../index.md) - [C# Keywords](index.md) - [Access Modifiers](access-modifiers.md) - [Accessibility Levels](accessibility-levels.md) diff --git a/docs/csharp/language-reference/keywords/get.md b/docs/csharp/language-reference/keywords/get.md index d593cbad9d26a..bd9a3627a8086 100644 --- a/docs/csharp/language-reference/keywords/get.md +++ b/docs/csharp/language-reference/keywords/get.md @@ -31,6 +31,5 @@ For simple cases in which a property's `get` and `set` accessors perform no othe ## See also -- [C# Reference](../index.md) - [C# Keywords](./index.md) - [Properties](../../programming-guide/classes-and-structs/properties.md) diff --git a/docs/csharp/language-reference/keywords/in.md b/docs/csharp/language-reference/keywords/in.md index 374f136d057f5..8c46b6514b1f2 100644 --- a/docs/csharp/language-reference/keywords/in.md +++ b/docs/csharp/language-reference/keywords/in.md @@ -22,4 +22,3 @@ The `in` keyword is used in the following contexts: ## See also - [C# Keywords](index.md) -- [C# Reference](../index.md) diff --git a/docs/csharp/language-reference/keywords/index.md b/docs/csharp/language-reference/keywords/index.md index 45a23414ea0ff..e3bb3eea71592 100644 --- a/docs/csharp/language-reference/keywords/index.md +++ b/docs/csharp/language-reference/keywords/index.md @@ -165,7 +165,3 @@ A contextual keyword is used to provide a specific meaning in the code, but it i [`yield`](../statements/yield.md) :::column-end::: :::row-end::: - -## See also - -- [C# reference](../index.md) diff --git a/docs/csharp/language-reference/keywords/init.md b/docs/csharp/language-reference/keywords/init.md index 1eeab43f180ae..aeb3bb38ab27f 100644 --- a/docs/csharp/language-reference/keywords/init.md +++ b/docs/csharp/language-reference/keywords/init.md @@ -56,6 +56,5 @@ The following example shows the distinction between a `private set`, read only, ## See also -- [C# Reference](../index.md) - [C# Keywords](index.md) - [Properties](../../programming-guide/classes-and-structs/properties.md) diff --git a/docs/csharp/language-reference/keywords/interface.md b/docs/csharp/language-reference/keywords/interface.md index 90473e4b83fb6..e49103d35e058 100644 --- a/docs/csharp/language-reference/keywords/interface.md +++ b/docs/csharp/language-reference/keywords/interface.md @@ -78,7 +78,6 @@ For more information, see the [Interfaces](~/_csharpstandard/standard/interfaces ## See also -- [C# Reference](../index.md) - [C# Keywords](index.md) - [Reference Types](reference-types.md) - [Interfaces](../../fundamentals/types/interfaces.md) diff --git a/docs/csharp/language-reference/keywords/internal.md b/docs/csharp/language-reference/keywords/internal.md index f124bad062824..127fcab4fc301 100644 --- a/docs/csharp/language-reference/keywords/internal.md +++ b/docs/csharp/language-reference/keywords/internal.md @@ -15,7 +15,7 @@ The `internal` keyword is an [access modifier](./access-modifiers.md) for types > This page covers `internal` access. The `internal` keyword is also part of the [`protected internal`](./protected-internal.md) access modifier. -Internal types or members are accessible only within files in the same assembly, as in this example: +Internal types or members are accessible only within files in the same [assembly](../../../standard/assembly/index.md), as in this example: ```csharp public class BaseClass @@ -25,17 +25,19 @@ public class BaseClass } ``` - For a comparison of `internal` with the other access modifiers, see [Accessibility Levels](./accessibility-levels.md) and [Access Modifiers](../../programming-guide/classes-and-structs/access-modifiers.md). - - For more information about assemblies, see [Assemblies in .NET](../../../standard/assembly/index.md). - - A common use of internal access is in component-based development because it enables a group of components to cooperate in a private manner without being exposed to the rest of the application code. For example, a framework for building graphical user interfaces could provide `Control` and `Form` classes that cooperate by using members with internal access. Since these members are internal, they are not exposed to code that is using the framework. - - It is an error to reference a type or a member with internal access outside the assembly within which it was defined. - +For a comparison of `internal` with the other access modifiers, see [Accessibility Levels](./accessibility-levels.md) and [Access Modifiers](../../programming-guide/classes-and-structs/access-modifiers.md). + +An `assembly` is an executable or dynamic link library (DLL) produced from compiling one or more source files. + +For more information about assemblies, see [Assemblies in .NET](../../../standard/assembly/index.md). + +A common use of internal access is in component-based development because it enables a group of components to cooperate in a private manner without being exposed to the rest of the application code. For example, a framework for building graphical user interfaces could provide `Control` and `Form` classes that cooperate by using members with internal access. Since these members are internal, they are not exposed to code that is using the framework. + +It is an error to reference a type or a member with internal access outside the assembly within which it was defined. + ## Example 1 - This example contains two files, `Assembly1.cs` and `Assembly1_a.cs`. The first file contains an internal base class, `BaseClass`. In the second file, an attempt to instantiate `BaseClass` will produce an error. + This example contains two files, `Assembly1.cs` and `Assembly1_a.cs`. The first file contains an internal base class, `BaseClass`. In the second file, an attempt to instantiate `BaseClass` will produce an error. ```csharp // Assembly1.cs @@ -90,7 +92,6 @@ For more information, see [Declared accessibility](~/_csharpstandard/standard/ba ## See also -- [C# Reference](../index.md) - [C# Keywords](./index.md) - [Access Modifiers](./access-modifiers.md) - [Accessibility Levels](./accessibility-levels.md) diff --git a/docs/csharp/language-reference/keywords/let-clause.md b/docs/csharp/language-reference/keywords/let-clause.md index caf2fa04e03a3..a123fb8f3d0e5 100644 --- a/docs/csharp/language-reference/keywords/let-clause.md +++ b/docs/csharp/language-reference/keywords/let-clause.md @@ -26,7 +26,6 @@ In the following example `let` is used in two ways: ## See also -- [C# Reference](../index.md) - [Query Keywords (LINQ)](query-keywords.md) - [LINQ in C#](../../linq/index.md) - [Language Integrated Query (LINQ)](/dotnet/csharp/linq/) diff --git a/docs/csharp/language-reference/keywords/namespace.md b/docs/csharp/language-reference/keywords/namespace.md index b08737ecec89d..7a60c0de6cb35 100644 --- a/docs/csharp/language-reference/keywords/namespace.md +++ b/docs/csharp/language-reference/keywords/namespace.md @@ -71,7 +71,6 @@ For more information on file scoped namespace declarations, see the [feature spe ## See also - [Namespace declaration preferences (IDE0160 and IDE0161)](../../../fundamentals/code-analysis/style-rules/ide0160-ide0161.md) -- [C# reference](../index.md) - [C# keywords](index.md) - [using](using-directive.md) - [using static](using-directive.md) diff --git a/docs/csharp/language-reference/keywords/new-constraint.md b/docs/csharp/language-reference/keywords/new-constraint.md index e5e9b43745a07..c8c60672a8599 100644 --- a/docs/csharp/language-reference/keywords/new-constraint.md +++ b/docs/csharp/language-reference/keywords/new-constraint.md @@ -28,6 +28,5 @@ For more information, see the [Type parameter constraints](~/_csharpstandard/sta ## See also -- [C# Reference](../index.md) - [C# Keywords](index.md) - [Generics](../../fundamentals/types/generics.md) diff --git a/docs/csharp/language-reference/keywords/new-modifier.md b/docs/csharp/language-reference/keywords/new-modifier.md index 87a071d97d1d9..99de07c666ac6 100644 --- a/docs/csharp/language-reference/keywords/new-modifier.md +++ b/docs/csharp/language-reference/keywords/new-modifier.md @@ -52,7 +52,6 @@ For more information, see [The new modifier](~/_csharpstandard/standard/classes. ## See also -- [C# Reference](../index.md) - [C# Keywords](index.md) - [Modifiers](index.md) - [Versioning with the Override and New Keywords](../../programming-guide/classes-and-structs/versioning-with-the-override-and-new-keywords.md) diff --git a/docs/csharp/language-reference/keywords/new.md b/docs/csharp/language-reference/keywords/new.md index 39c760394536d..6af21101eb42e 100644 --- a/docs/csharp/language-reference/keywords/new.md +++ b/docs/csharp/language-reference/keywords/new.md @@ -20,4 +20,3 @@ The `new` keyword is used as: ## See also - [C# Keywords](index.md) -- [C# Reference](../index.md) diff --git a/docs/csharp/language-reference/keywords/null.md b/docs/csharp/language-reference/keywords/null.md index 808a06f3af478..884002f209f19 100644 --- a/docs/csharp/language-reference/keywords/null.md +++ b/docs/csharp/language-reference/keywords/null.md @@ -23,7 +23,6 @@ The following example demonstrates some behaviors of the `null` keyword: ## See also -- [C# reference](../index.md) - [C# keywords](index.md) - [Default values of C# types](../builtin-types/default-values.md) - [Nothing (Visual Basic)](../../../visual-basic/language-reference/nothing.md) diff --git a/docs/csharp/language-reference/keywords/on.md b/docs/csharp/language-reference/keywords/on.md index a3c39b5095bff..93d8956fc5aea 100644 --- a/docs/csharp/language-reference/keywords/on.md +++ b/docs/csharp/language-reference/keywords/on.md @@ -21,5 +21,4 @@ The following example shows the use of `on` in a `join` clause. ## See also -- [C# Reference](../index.md) - [Language Integrated Query (LINQ)](../../linq/index.md) diff --git a/docs/csharp/language-reference/keywords/orderby-clause.md b/docs/csharp/language-reference/keywords/orderby-clause.md index 32514fe565481..c23d89b62cad8 100644 --- a/docs/csharp/language-reference/keywords/orderby-clause.md +++ b/docs/csharp/language-reference/keywords/orderby-clause.md @@ -32,7 +32,6 @@ At compile time, the `orderby` clause is translated to a call to the - diff --git a/docs/csharp/language-reference/operators/assignment-operator.md b/docs/csharp/language-reference/operators/assignment-operator.md index 242067a53bc3e..564148d351003 100644 --- a/docs/csharp/language-reference/operators/assignment-operator.md +++ b/docs/csharp/language-reference/operators/assignment-operator.md @@ -76,7 +76,6 @@ For more information, see the [Assignment operators](~/_csharpstandard/standard/ ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [ref keyword](../keywords/ref.md) - [Use compound assignment (style rules IDE0054 and IDE0074)](../../../fundamentals/code-analysis/style-rules/ide0054-ide0074.md) diff --git a/docs/csharp/language-reference/operators/await.md b/docs/csharp/language-reference/operators/await.md index 5ccf3a3c707be..853d7fd9cd695 100644 --- a/docs/csharp/language-reference/operators/await.md +++ b/docs/csharp/language-reference/operators/await.md @@ -45,7 +45,6 @@ For more information, see the [Await expressions](~/_csharpstandard/standard/exp ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [async](../keywords/async.md) - [Task asynchronous programming model](../../asynchronous-programming/task-asynchronous-programming-model.md) diff --git a/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md b/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md index ad3d22c99e5da..881f54aa0f7c4 100644 --- a/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md +++ b/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md @@ -206,6 +206,5 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Boolean logical operators](boolean-logical-operators.md) diff --git a/docs/csharp/language-reference/operators/boolean-logical-operators.md b/docs/csharp/language-reference/operators/boolean-logical-operators.md index 8116c32c2d8f0..3c4a0031a18d6 100644 --- a/docs/csharp/language-reference/operators/boolean-logical-operators.md +++ b/docs/csharp/language-reference/operators/boolean-logical-operators.md @@ -197,6 +197,5 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Bitwise and shift operators](bitwise-and-shift-operators.md) diff --git a/docs/csharp/language-reference/operators/comparison-operators.md b/docs/csharp/language-reference/operators/comparison-operators.md index 0c18a701f3441..386e0737a1835 100644 --- a/docs/csharp/language-reference/operators/comparison-operators.md +++ b/docs/csharp/language-reference/operators/comparison-operators.md @@ -69,7 +69,6 @@ For more information, see the [Relational and type-testing operators](~/_csharps ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - - [Equality operators](equality-operators.md) diff --git a/docs/csharp/language-reference/operators/conditional-operator.md b/docs/csharp/language-reference/operators/conditional-operator.md index da3846b9e75dc..3b7a1c0d25596 100644 --- a/docs/csharp/language-reference/operators/conditional-operator.md +++ b/docs/csharp/language-reference/operators/conditional-operator.md @@ -88,7 +88,6 @@ Specifications for newer features are: ## See also - [Simplify conditional expression (style rule IDE0075)](../../../fundamentals/code-analysis/style-rules/ide0075.md) -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [if statement](../statements/selection-statements.md#the-if-statement) - [?. and ?[] operators](member-access-operators.md#null-conditional-operators--and-) diff --git a/docs/csharp/language-reference/operators/default.md b/docs/csharp/language-reference/operators/default.md index ac8ea296a9685..a1d5bcc4283e7 100644 --- a/docs/csharp/language-reference/operators/default.md +++ b/docs/csharp/language-reference/operators/default.md @@ -41,7 +41,6 @@ For more information, see the [Default value expressions](~/_csharpstandard/stan ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Default values of C# types](../builtin-types/default-values.md) - [Generics in .NET](../../../standard/generics/index.md) diff --git a/docs/csharp/language-reference/operators/delegate-operator.md b/docs/csharp/language-reference/operators/delegate-operator.md index 631cd69013593..577908cb15bfc 100644 --- a/docs/csharp/language-reference/operators/delegate-operator.md +++ b/docs/csharp/language-reference/operators/delegate-operator.md @@ -61,6 +61,5 @@ For more information, see the [Anonymous function expressions](~/_csharpstandard ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [=> operator](lambda-operator.md) diff --git a/docs/csharp/language-reference/operators/equality-operators.md b/docs/csharp/language-reference/operators/equality-operators.md index 3cbbc23747337..c9e00b64c6d3b 100644 --- a/docs/csharp/language-reference/operators/equality-operators.md +++ b/docs/csharp/language-reference/operators/equality-operators.md @@ -101,7 +101,6 @@ For more information about equality of record types, see the [Equality members]( ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - - diff --git a/docs/csharp/language-reference/operators/index.md b/docs/csharp/language-reference/operators/index.md index fc8e7758b376f..dfa87bee28902 100644 --- a/docs/csharp/language-reference/operators/index.md +++ b/docs/csharp/language-reference/operators/index.md @@ -130,6 +130,5 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [Operator overloading](operator-overloading.md) - [Expression trees](../../advanced-topics/expression-trees/index.md) diff --git a/docs/csharp/language-reference/operators/is.md b/docs/csharp/language-reference/operators/is.md index 6457d49e6a996..95203660c6f3d 100644 --- a/docs/csharp/language-reference/operators/is.md +++ b/docs/csharp/language-reference/operators/is.md @@ -47,7 +47,6 @@ For more information, see [The is operator](~/_csharpstandard/standard/expressio ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Patterns](patterns.md) - [Tutorial: Use pattern matching to build type-driven and data-driven algorithms](../../fundamentals/tutorials/pattern-matching.md) diff --git a/docs/csharp/language-reference/operators/lambda-expressions.md b/docs/csharp/language-reference/operators/lambda-expressions.md index fb1dfeee821a7..dde9b5c6c81c3 100644 --- a/docs/csharp/language-reference/operators/lambda-expressions.md +++ b/docs/csharp/language-reference/operators/lambda-expressions.md @@ -334,7 +334,6 @@ For more information about these features, see the following feature proposal no ## See also - [Use local function instead of lambda (style rule IDE0039)](../../../fundamentals/code-analysis/style-rules/ide0039.md) -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [LINQ (Language-Integrated Query)](/dotnet/csharp/linq/) - [Expression trees](../../advanced-topics/expression-trees/index.md) diff --git a/docs/csharp/language-reference/operators/lambda-operator.md b/docs/csharp/language-reference/operators/lambda-operator.md index 294c15e2a8e02..78ce35eb7bcd2 100644 --- a/docs/csharp/language-reference/operators/lambda-operator.md +++ b/docs/csharp/language-reference/operators/lambda-operator.md @@ -76,5 +76,4 @@ For more information about the lambda operator, see the [Anonymous function expr ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) diff --git a/docs/csharp/language-reference/operators/member-access-operators.md b/docs/csharp/language-reference/operators/member-access-operators.md index c8a3038981246..b669e9a5452ac 100644 --- a/docs/csharp/language-reference/operators/member-access-operators.md +++ b/docs/csharp/language-reference/operators/member-access-operators.md @@ -254,7 +254,6 @@ For more information about indices and ranges, see the [feature proposal note](~ - [Use index operator (style rule IDE0056)](../../../fundamentals/code-analysis/style-rules/ide0056.md) - [Use range operator (style rule IDE0057)](../../../fundamentals/code-analysis/style-rules/ide0057.md) - [Use conditional delegate call (style rule IDE1005)](../../../fundamentals/code-analysis/style-rules/ide1005.md) -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [?? (null-coalescing operator)](null-coalescing-operator.md) - [:: operator](namespace-alias-qualifier.md) diff --git a/docs/csharp/language-reference/operators/nameof.md b/docs/csharp/language-reference/operators/nameof.md index 0ef9eddb77a4c..a3ad6b09acd43 100644 --- a/docs/csharp/language-reference/operators/nameof.md +++ b/docs/csharp/language-reference/operators/nameof.md @@ -36,6 +36,5 @@ For more information, see the [Nameof expressions](~/_csharpstandard/standard/ex ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Convert `typeof` to `nameof` (style rule IDE0082)](../../../fundamentals/code-analysis/style-rules/ide0082.md) diff --git a/docs/csharp/language-reference/operators/namespace-alias-qualifier.md b/docs/csharp/language-reference/operators/namespace-alias-qualifier.md index 7b037d98beb0a..2939902467032 100644 --- a/docs/csharp/language-reference/operators/namespace-alias-qualifier.md +++ b/docs/csharp/language-reference/operators/namespace-alias-qualifier.md @@ -59,5 +59,4 @@ For more information, see the [Namespace alias qualifiers](~/_csharpstandard/sta ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) diff --git a/docs/csharp/language-reference/operators/new-operator.md b/docs/csharp/language-reference/operators/new-operator.md index c66daed6ab411..39e57bbc209b8 100644 --- a/docs/csharp/language-reference/operators/new-operator.md +++ b/docs/csharp/language-reference/operators/new-operator.md @@ -68,6 +68,5 @@ For more information about a target-typed `new` expression, see the [feature pro ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Object and collection initializers](../../programming-guide/classes-and-structs/object-and-collection-initializers.md) diff --git a/docs/csharp/language-reference/operators/null-coalescing-operator.md b/docs/csharp/language-reference/operators/null-coalescing-operator.md index 75f6fdec533c9..bb2fdf70db930 100644 --- a/docs/csharp/language-reference/operators/null-coalescing-operator.md +++ b/docs/csharp/language-reference/operators/null-coalescing-operator.md @@ -90,7 +90,6 @@ For more information about the `??=` operator, see the [feature proposal note](~ ## See also - [Null check can be simplified (IDE0029, IDE0030, and IDE0270)](../../../fundamentals/code-analysis/style-rules/ide0029-ide0030-ide0270.md) -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [?. and ?[] operators](member-access-operators.md#null-conditional-operators--and-) - [?: operator](conditional-operator.md) diff --git a/docs/csharp/language-reference/operators/null-forgiving.md b/docs/csharp/language-reference/operators/null-forgiving.md index 2fded9152ec97..4861fb309efea 100644 --- a/docs/csharp/language-reference/operators/null-forgiving.md +++ b/docs/csharp/language-reference/operators/null-forgiving.md @@ -45,6 +45,5 @@ For more information, see [The null-forgiving operator](~/_csharplang/proposals/ ## See also - [Remove unnecessary suppression operator (style rule IDE0080)](../../../fundamentals/code-analysis/style-rules/ide0080.md) -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Tutorial: Design with nullable reference types](../../tutorials/nullable-reference-types.md) diff --git a/docs/csharp/language-reference/operators/operator-overloading.md b/docs/csharp/language-reference/operators/operator-overloading.md index 1373fd9e023a2..c61d47e5f4a02 100644 --- a/docs/csharp/language-reference/operators/operator-overloading.md +++ b/docs/csharp/language-reference/operators/operator-overloading.md @@ -57,7 +57,6 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [User-defined conversion operators](user-defined-conversion-operators.md) - [Design guidelines - Operator overloads](../../../standard/design-guidelines/operator-overloads.md) diff --git a/docs/csharp/language-reference/operators/patterns.md b/docs/csharp/language-reference/operators/patterns.md index 22431fe2e6346..a4579eddab2f7 100644 --- a/docs/csharp/language-reference/operators/patterns.md +++ b/docs/csharp/language-reference/operators/patterns.md @@ -295,7 +295,6 @@ For information about features added in C# 8 and later, see the following featur ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Pattern matching overview](../../fundamentals/functional/pattern-matching.md) - [Tutorial: Use pattern matching to build type-driven and data-driven algorithms](../../fundamentals/tutorials/pattern-matching.md) diff --git a/docs/csharp/language-reference/operators/pointer-related-operators.md b/docs/csharp/language-reference/operators/pointer-related-operators.md index 99b22050a5006..8d41a0c5543a0 100644 --- a/docs/csharp/language-reference/operators/pointer-related-operators.md +++ b/docs/csharp/language-reference/operators/pointer-related-operators.md @@ -183,7 +183,6 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Unsafe code, pointer types, and function pointers](../unsafe-code.md) - [unsafe keyword](../keywords/unsafe.md) diff --git a/docs/csharp/language-reference/operators/sizeof.md b/docs/csharp/language-reference/operators/sizeof.md index 19f867786d3a1..0513d391dd672 100644 --- a/docs/csharp/language-reference/operators/sizeof.md +++ b/docs/csharp/language-reference/operators/sizeof.md @@ -44,7 +44,6 @@ For more information, see [The sizeof operator](~/_csharpstandard/standard/unsaf ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Pointer related operators](pointer-related-operators.md) - [Pointer types](../unsafe-code.md#pointer-types) diff --git a/docs/csharp/language-reference/operators/snippets/shared/TypeTestingAndConversionOperators.cs b/docs/csharp/language-reference/operators/snippets/shared/TypeTestingAndConversionOperators.cs index 104fc8a557447..7b13c221f86a6 100644 --- a/docs/csharp/language-reference/operators/snippets/shared/TypeTestingAndConversionOperators.cs +++ b/docs/csharp/language-reference/operators/snippets/shared/TypeTestingAndConversionOperators.cs @@ -77,7 +77,7 @@ private static void IsOperatorDeclarationPattern() private static void AsOperator() { // - IEnumerable numbers = [10, 20, 30]; + IEnumerable numbers = new List(){10, 20, 30}; IList indexable = numbers as IList; if (indexable != null) { diff --git a/docs/csharp/language-reference/operators/stackalloc.md b/docs/csharp/language-reference/operators/stackalloc.md index a5a1ecacb78ba..a1439c242370b 100644 --- a/docs/csharp/language-reference/operators/stackalloc.md +++ b/docs/csharp/language-reference/operators/stackalloc.md @@ -67,7 +67,6 @@ For more information, see the [Stack allocation](~/_csharpstandard/standard/unsa ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Pointer related operators](pointer-related-operators.md) - [Pointer types](../unsafe-code.md#pointer-types) diff --git a/docs/csharp/language-reference/operators/subtraction-operator.md b/docs/csharp/language-reference/operators/subtraction-operator.md index e21c1855b471d..305e9357d1f9c 100644 --- a/docs/csharp/language-reference/operators/subtraction-operator.md +++ b/docs/csharp/language-reference/operators/subtraction-operator.md @@ -73,7 +73,6 @@ For more information, see the [Unary minus operator](~/_csharpstandard/standard/ ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Events](../../programming-guide/events/index.md) - [Arithmetic operators](arithmetic-operators.md) diff --git a/docs/csharp/language-reference/operators/switch-expression.md b/docs/csharp/language-reference/operators/switch-expression.md index 6cd6a2a607ed3..d445f5709187b 100644 --- a/docs/csharp/language-reference/operators/switch-expression.md +++ b/docs/csharp/language-reference/operators/switch-expression.md @@ -56,7 +56,6 @@ For more information, see the [`switch` expression](~/_csharplang/proposals/csha - [Use switch expression (style rule IDE0066)](../../../fundamentals/code-analysis/style-rules/ide0066.md) - [Add missing cases to switch expression (style rule IDE0072)](../../../fundamentals/code-analysis/style-rules/ide0072.md) -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Patterns](patterns.md) - [Tutorial: Use pattern matching to build type-driven and data-driven algorithms](../../fundamentals/tutorials/pattern-matching.md) diff --git a/docs/csharp/language-reference/operators/true-false-operators.md b/docs/csharp/language-reference/operators/true-false-operators.md index 26dfd0f00bbac..1fdfa4669a124 100644 --- a/docs/csharp/language-reference/operators/true-false-operators.md +++ b/docs/csharp/language-reference/operators/true-false-operators.md @@ -42,5 +42,4 @@ Wait! ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) diff --git a/docs/csharp/language-reference/operators/type-testing-and-cast.md b/docs/csharp/language-reference/operators/type-testing-and-cast.md index d3b0dbdb36150..435352367e278 100644 --- a/docs/csharp/language-reference/operators/type-testing-and-cast.md +++ b/docs/csharp/language-reference/operators/type-testing-and-cast.md @@ -152,7 +152,6 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [How to safely cast by using pattern matching and the is and as operators](../../fundamentals/tutorials/safely-cast-using-pattern-matching-is-and-as-operators.md) - [Generics in .NET](../../../standard/generics/index.md) diff --git a/docs/csharp/language-reference/operators/user-defined-conversion-operators.md b/docs/csharp/language-reference/operators/user-defined-conversion-operators.md index 4cf0fbafdeaa3..e5b5ef50b641d 100644 --- a/docs/csharp/language-reference/operators/user-defined-conversion-operators.md +++ b/docs/csharp/language-reference/operators/user-defined-conversion-operators.md @@ -40,7 +40,6 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Operator overloading](operator-overloading.md) - [Type-testing and cast operators](type-testing-and-cast.md) diff --git a/docs/csharp/language-reference/operators/with-expression.md b/docs/csharp/language-reference/operators/with-expression.md index 787880b1e03b9..a1c05b6ccbb11 100644 --- a/docs/csharp/language-reference/operators/with-expression.md +++ b/docs/csharp/language-reference/operators/with-expression.md @@ -41,7 +41,6 @@ For more information, see the following sections of the [records feature proposa ## See also -- [C# reference](../index.md) - [C# operators and expressions](index.md) - [Records](../builtin-types/record.md) - [Structure types](../builtin-types/struct.md) diff --git a/docs/csharp/language-reference/statements/checked-and-unchecked.md b/docs/csharp/language-reference/statements/checked-and-unchecked.md index e81c9e12f7aa8..846b42e2f3d64 100644 --- a/docs/csharp/language-reference/statements/checked-and-unchecked.md +++ b/docs/csharp/language-reference/statements/checked-and-unchecked.md @@ -60,5 +60,4 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [**CheckForOverflowUnderflow** compiler option](../compiler-options/language.md#checkforoverflowunderflow) diff --git a/docs/csharp/language-reference/statements/declarations.md b/docs/csharp/language-reference/statements/declarations.md index 0341215c74837..953821b2df101 100644 --- a/docs/csharp/language-reference/statements/declarations.md +++ b/docs/csharp/language-reference/statements/declarations.md @@ -117,7 +117,6 @@ For more information about the `scoped` modifier, see the [Low-level struct impr ## See also -- [C# reference](../index.md) - [Object and collection initializers](../../programming-guide/classes-and-structs/object-and-collection-initializers.md) - [ref keyword](../keywords/ref.md) - [Reduce memory allocations using new C# features](../../advanced-topics/performance/index.md) diff --git a/docs/csharp/language-reference/statements/exception-handling-statements.md b/docs/csharp/language-reference/statements/exception-handling-statements.md index 1e5f86d2ba5bf..8f964cf600603 100644 --- a/docs/csharp/language-reference/statements/exception-handling-statements.md +++ b/docs/csharp/language-reference/statements/exception-handling-statements.md @@ -140,7 +140,6 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [Exceptions and exception handling](../../fundamentals/exceptions/index.md) - [Handling and throwing exceptions in .NET](../../../standard/exceptions/index.md) - [throw preferences (style rule IDE0016)](../../../fundamentals/code-analysis/style-rules/ide0016.md) diff --git a/docs/csharp/language-reference/statements/fixed.md b/docs/csharp/language-reference/statements/fixed.md index 6340e0c4aaccc..153c82bb11f55 100644 --- a/docs/csharp/language-reference/statements/fixed.md +++ b/docs/csharp/language-reference/statements/fixed.md @@ -54,7 +54,6 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [Unsafe code, pointer types, and function pointers](../unsafe-code.md) - [Pointer-related operators](../operators/pointer-related-operators.md) - [unsafe](../keywords/unsafe.md) diff --git a/docs/csharp/language-reference/statements/iteration-statements.md b/docs/csharp/language-reference/statements/iteration-statements.md index 3e7719b80ab24..bb4f2f4dce8ad 100644 --- a/docs/csharp/language-reference/statements/iteration-statements.md +++ b/docs/csharp/language-reference/statements/iteration-statements.md @@ -162,6 +162,5 @@ For more information about these features, see the following feature proposal no ## See also -- [C# reference](../index.md) - [Declarations](./declarations.md) - [Iterators](../../iterators.md) diff --git a/docs/csharp/language-reference/statements/jump-statements.md b/docs/csharp/language-reference/statements/jump-statements.md index abdada9f2fe75..80f10a2add459 100644 --- a/docs/csharp/language-reference/statements/jump-statements.md +++ b/docs/csharp/language-reference/statements/jump-statements.md @@ -146,5 +146,4 @@ For more information, see the following sections of the [C# language specificati ## See also -- [C# reference](../index.md) - [`yield` statement](yield.md) diff --git a/docs/csharp/language-reference/statements/lock.md b/docs/csharp/language-reference/statements/lock.md index 1edccb91f2cd2..f78bf72ae714e 100644 --- a/docs/csharp/language-reference/statements/lock.md +++ b/docs/csharp/language-reference/statements/lock.md @@ -63,7 +63,6 @@ For more information, see [The lock statement](~/_csharpstandard/standard/statem ## See also -- [C# reference](../index.md) - - - diff --git a/docs/csharp/language-reference/statements/selection-statements.md b/docs/csharp/language-reference/statements/selection-statements.md index a9d3a93cb7022..c5d0bad51f614 100644 --- a/docs/csharp/language-reference/statements/selection-statements.md +++ b/docs/csharp/language-reference/statements/selection-statements.md @@ -87,7 +87,6 @@ For more information about patterns, see the [Patterns and pattern matching](~/_ ## See also -- [C# reference](../index.md) - [Conditional operator `?:`](../operators/conditional-operator.md) - [Logical operators](../operators/boolean-logical-operators.md) - [Patterns](../operators/patterns.md) diff --git a/docs/csharp/language-reference/statements/using.md b/docs/csharp/language-reference/statements/using.md index 1e33746f274c7..07cc52e4735a6 100644 --- a/docs/csharp/language-reference/statements/using.md +++ b/docs/csharp/language-reference/statements/using.md @@ -59,7 +59,6 @@ For more information, see [The using statement](~/_csharpstandard/standard/state ## See also -- [C# reference](../index.md) - - - [Using objects that implement IDisposable](../../../standard/garbage-collection/using-objects.md) diff --git a/docs/csharp/language-reference/statements/yield.md b/docs/csharp/language-reference/statements/yield.md index c2021fdf165e8..27be16f3c34b1 100644 --- a/docs/csharp/language-reference/statements/yield.md +++ b/docs/csharp/language-reference/statements/yield.md @@ -53,7 +53,6 @@ For more information, see [The yield statement](~/_csharpstandard/standard/state ## See also -- [C# reference](../index.md) - [Iterators](../../iterators.md) - [Iterate through collections in C#](../../programming-guide/concepts/iterators.md) - [foreach](iteration-statements.md#the-foreach-statement) diff --git a/docs/csharp/language-reference/toc.yml b/docs/csharp/language-reference/toc.yml new file mode 100644 index 0000000000000..2718f5bb1b842 --- /dev/null +++ b/docs/csharp/language-reference/toc.yml @@ -0,0 +1,2344 @@ +items: +- name: C# language reference + items: + - name: Overview + displayName: language reference + href: ./index.yml + - name: Configure language version + href: ./configure-language-version.md + - name: Types + items: + - name: Value types + items: + - name: Overview + href: ./builtin-types/value-types.md + displayName: "value types, simple types" + - name: Integral numeric types + href: ./builtin-types/integral-numeric-types.md + displayName: sbyte, byte, short, ushort, int, uint, nint, nuint, long, ulong, integer, literal + - name: Floating-point numeric types + href: ./builtin-types/floating-point-numeric-types.md + displayName: float, decimal, double, rational, real, literal + - name: Built-in numeric conversions + href: ./builtin-types/numeric-conversions.md + - name: bool + href: ./builtin-types/bool.md + displayName: "Boolean, true, false" + - name: char + href: ./builtin-types/char.md + displayName: "Unicode, character, UTF-16" + - name: Enumeration types + href: ./builtin-types/enum.md + displayName: "enum, bit flags, bit field" + - name: Struct types + href: ./builtin-types/struct.md + displayName: "struct type, readonly struct, ref struct, readonly ref struct" + - name: Ref struct types + href: ./builtin-types/ref-struct.md + displayName: "ref struct, readonly ref struct" + - name: Tuple types + href: ./builtin-types/value-tuples.md + displayName: "value tuples, ValueTuple" + - name: Nullable value types + href: ./builtin-types/nullable-value-types.md + displayName: "? token, ? symbol" + - name: Reference types + items: + - name: Features of reference types + href: ./keywords/reference-types.md + - name: Built-in reference types + displayName: object, delegate, dynamic, string + href: ./builtin-types/reference-types.md + - name: record + href: ./builtin-types/record.md + - name: class + href: ./keywords/class.md + - name: interface + href: ./keywords/interface.md + - name: Nullable reference types + href: ./builtin-types/nullable-reference-types.md + displayName: "? token, ? symbol" + - name: Collections and arrays + items: + - name: Collections + href: ./builtin-types/collections.md + - name: Arrays + href: ./builtin-types/arrays.md + - name: void + href: ./builtin-types/void.md + - name: Built-in types + href: ./builtin-types/built-in-types.md + - name: Unmanaged types + href: ./builtin-types/unmanaged-types.md + - name: Default values + href: ./builtin-types/default-values.md + - name: Keywords + items: + - name: Overview + displayName: keywords, contextual keywords + href: ./keywords/index.md + - name: Modifiers + items: + - name: Access modifiers + items: + - name: Quick reference + href: ./keywords/access-modifiers.md + - name: Accessibility levels + href: ./keywords/accessibility-levels.md + - name: Accessibility domain + href: ./keywords/accessibility-domain.md + - name: Restrictions on using accessibility levels + href: ./keywords/restrictions-on-using-accessibility-levels.md + - name: internal + href: ./keywords/internal.md + - name: private + href: ./keywords/private.md + - name: protected + href: ./keywords/protected.md + - name: public + href: ./keywords/public.md + - name: protected internal + href: ./keywords/protected-internal.md + - name: private protected + href: ./keywords/private-protected.md + - name: file + href: ./keywords/file.md + - name: abstract + href: ./keywords/abstract.md + - name: async + href: ./keywords/async.md + displayName: await + - name: const + href: ./keywords/const.md + - name: event + href: ./keywords/event.md + - name: extern + href: ./keywords/extern.md + - name: in (generic modifier) + href: ./keywords/in-generic-modifier.md + - name: new (member modifier) + href: ./keywords/new-modifier.md + - name: out (generic modifier) + href: ./keywords/out-generic-modifier.md + - name: override + href: ./keywords/override.md + - name: readonly + href: ./keywords/readonly.md + - name: sealed + href: ./keywords/sealed.md + - name: static + href: ./keywords/static.md + - name: unsafe + href: ./keywords/unsafe.md + - name: virtual + href: ./keywords/virtual.md + - name: volatile + href: ./keywords/volatile.md + - name: Statement Keywords + href: ./keywords/statement-keywords.md + - name: Method Parameters + displayName: ref, in, out, params, reference parameter, value parameter, ref readonly + href: ./keywords/method-parameters.md + - name: Namespace Keywords + items: + - name: namespace + href: ./keywords/namespace.md + - name: using directive + href: ./keywords/using-directive.md + - name: extern alias + href: ./keywords/extern-alias.md + - name: Generic Type Constraint Keywords + items: + - name: new constraint + href: ./keywords/new-constraint.md + - name: where + href: ./keywords/where-generic-type-constraint.md + - name: Access Keywords + items: + - name: base + href: ./keywords/base.md + - name: this + href: ./keywords/this.md + - name: Literal Keywords + items: + - name: "null" + href: ./keywords/null.md + - name: "true and false" + href: ./builtin-types/bool.md + - name: default + href: ./keywords/default.md + - name: Contextual Keywords + items: + - name: add + href: ./keywords/add.md + - name: get + href: ./keywords/get.md + - name: init + href: ./keywords/init.md + - name: partial (type) + href: ./keywords/partial-type.md + - name: partial (method) + href: ./keywords/partial-method.md + - name: remove + href: ./keywords/remove.md + - name: required + href: ./keywords/required.md + - name: set + href: ./keywords/set.md + - name: when (filter condition) + href: ./keywords/when.md + - name: value + href: ./keywords/value.md + - name: Query Keywords + items: + - name: Quick reference + displayName: query keywords + href: ./keywords/query-keywords.md + - name: from clause + href: ./keywords/from-clause.md + - name: where clause + href: ./keywords/where-clause.md + - name: select clause + href: ./keywords/select-clause.md + - name: group clause + href: ./keywords/group-clause.md + - name: into + href: ./keywords/into.md + - name: orderby clause + href: ./keywords/orderby-clause.md + - name: join clause + href: ./keywords/join-clause.md + - name: let clause + href: ./keywords/let-clause.md + - name: ascending + href: ./keywords/ascending.md + - name: descending + href: ./keywords/descending.md + - name: "on" + href: ./keywords/on.md + - name: equals + href: ./keywords/equals.md + - name: by + href: ./keywords/by.md + - name: in + href: ./keywords/in.md + - name: Operators and expressions + items: + - name: Overview + href: ./operators/index.md + displayName: operator precedence, operator associativity, expressions + - name: Arithmetic operators + href: ./operators/arithmetic-operators.md + displayName: ++, --, +, -, *, /, %, +=, -=, *=, /=, %=, checked, unchecked + - name: Boolean logical operators + href: ./operators/boolean-logical-operators.md + displayName: "!, &&, ||, &, |, ^, &=, |=, ^=, AND, XOR, OR" + - name: Bitwise and shift operators + href: ./operators/bitwise-and-shift-operators.md + displayName: "~, &, |, ^, <<, >>, &=, |=, ^=, <<=, >>=, AND, XOR, OR" + - name: Collection expressions + displayName: Collection literal, ".. token", ".. symbol", "[] token", "[] symbol" + href: ./operators/collection-expressions.md + - name: Equality operators + href: ./operators/equality-operators.md + displayName: ==, != + - name: Comparison operators + href: ./operators/comparison-operators.md + displayName: ">, <, >=, <=, greater, less" + - name: Member access and null-conditional operators and expressions + href: ./operators/member-access-operators.md + displayName: "., [], ?., ?[], (), indexer, null-conditional, Elvis, invocation, ^, index from end, hat, .., range" + - name: Type-testing operators and cast expression + href: ./operators/type-testing-and-cast.md + displayName: "is operator, is keyword, as operator, as keyword, typeof, (), explicit, conversion" + - name: User-defined conversion operators + href: ./operators/user-defined-conversion-operators.md + displayName: implicit, explicit + - name: Pointer-related operators + href: ./operators/pointer-related-operators.md + displayName: "&, *, ->, [], +, -, ++, --, ==, !=, <, >, <=, >=, dereference, address-of, indirection" + - name: Assignment operators + href: ./operators/assignment-operator.md + displayName: "=, ref, compound" + - name: Lambda expressions + href: ./operators/lambda-expressions.md + displayName: anonymous functions + - name: Patterns + href: ./operators/patterns.md + displayName: pattern matching, and keyword, or keyword, not keyword, pattern reference + - name: + and += operators + href: ./operators/addition-operator.md + displayName: string concatenation, delegate combination, event subscription + - name: "- and -= operators" + href: ./operators/subtraction-operator.md + displayName: delegate removal, event unsubscription + - name: "?: operator" + href: ./operators/conditional-operator.md + displayName: conditional, ternary, ref + - name: "! (null-forgiving) operator" + href: ./operators/null-forgiving.md + displayName: nullable reference, null-forgiveness, null suppression + - name: "?? and ??= operators" + href: ./operators/null-coalescing-operator.md + displayName: null-coalescing, assignment + - name: => operator + href: ./operators/lambda-operator.md + displayName: lambda, expression body definition + - name: ":: operator" + href: ./operators/namespace-alias-qualifier.md + displayName: "namespace alias qualifier, global namespace" + - name: await operator + href: ./operators/await.md + displayName: async + - name: default value expressions + href: ./operators/default.md + displayName: default value, default operator, default literal, type default + - name: delegate operator + href: ./operators/delegate-operator.md + displayName: anonymous + - name: is operator + href: ./operators/is.md + displayName: pattern matching + - name: nameof expression + href: ./operators/nameof.md + displayName: nameof operator + - name: new operator + href: ./operators/new-operator.md + displayName: constructor + - name: sizeof operator + href: ./operators/sizeof.md + - name: stackalloc expression + href: ./operators/stackalloc.md + displayName: stack allocation, span, stackalloc operator + - name: switch expression + href: ./operators/switch-expression.md + displayName: pattern matching, patterns, when + - name: true and false operators + href: ./operators/true-false-operators.md + - name: with expression + href: ./operators/with-expression.md + displayName: "records, copy" + - name: Operator overloading + href: ./operators/operator-overloading.md + - name: Statements + items: + - name: Declaration statements + displayName: var, ref, const, local, by-reference + href: ./statements/declarations.md + - name: Exception-handling statements + displayName: throw, try, catch, finally, when, error, fault + href: ./statements/exception-handling-statements.md + - name: Iteration statements + displayName: for, foreach, do, while, loop + href: ./statements/iteration-statements.md + - name: Selection statements + displayName: if, else, switch, case, when + href: ./statements/selection-statements.md + - name: Jump statements + displayName: break, continue, goto, return + href: ./statements/jump-statements.md + - name: checked and unchecked statements + displayName: overflow checking + href: ./statements/checked-and-unchecked.md + - name: fixed statement + displayName: pin, pinned + href: ./statements/fixed.md + - name: lock statement + displayName: thread synchronization, monitor + href: ./statements/lock.md + - name: using statement + displayName: dispose, disposable, await using, using declaration + href: ./statements/using.md + - name: yield statement + displayName: iterator, yield break, yield return + href: ./statements/yield.md + - name: Special characters + items: + - name: Overview + displayName: special characters + href: ./tokens/index.md + - name: Comments + displayName: /* */, // + href: ./tokens/comments.md + - name: $ -- string interpolation + href: ./tokens/interpolated.md + - name: "@ -- verbatim identifier" + href: ./tokens/verbatim.md + - name: "\"\"\" -- raw string literal" + href: ./tokens/raw-string.md + - name: Attributes read by the compiler + items: + - name: Global attributes + displayName: AssemblyName, AssemblyVersion, AssemblyCulture, AssemblyFlags, AssemblyProduct, AssemblyTrademark, AssemblyInformationalVersion, AssemblyCompany, AssemblyCopyright, AssemblyFileVersion, CLSCompliant, AssemblyTitle, AssemblyDescription, AssemblyConfiguration, AssemblyDefaultAlias + href: ./attributes/global.md + - name: Caller information + displayName: CallerFilePath, CallerLineNumber, CallerMemberName + href: ./attributes/caller-information.md + - name: Nullable static analysis + displayName: AllowNull, DisallowNull, MaybeNull, NotNull, MaybeNullWhen, NotNullWhen, NotNullIfNotNull, DoesNotReturn, DoesNotReturnIf + href: ./attributes/nullable-analysis.md + - name: Miscellaneous + displayName: Conditional, Obsolete, Experimental, SetsRequiredMembers, AttributeUsage, ModuleInitializer, SkipLocalsInit, module initializer + href: ./attributes/general.md + - name: Unsafe code and pointers + displayName: unsafe code, pointers, fixed size buffer, function pointer + href: ./unsafe-code.md + - name: Preprocessor directives + href: ./preprocessor-directives.md + displayName: \#if, \#else, \#elif, \#endif, \#define, \#undef, \#warning, \#error, \#line, \#nullable, \#region, \#endregion, \#pragma, warning, checksum + - name: Compiler options + items: + - name: Overview + href: ./compiler-options/index.md + - name: Language options + displayName: CheckForOverflowUnderflow, checked, AllowUnsafeBlocks, unsafe, DefineConstants, define, LangVersion, langversion, Nullable, nullable + href: ./compiler-options/language.md + - name: Output options + displayName: DocumentationFile, doc, OutputAssembly, out, PlatformTarget, platform, ProduceReferenceAssembly, refout, TargetType, target, + href: ./compiler-options/output.md + - name: Input options + displayName: References, reference, references, AddModules, addmodule, EmbedInteropTypes, link + href: ./compiler-options/inputs.md + - name: Error and warning options + displayName: WarningLevel, warn, TreatWarningsAsErrors, warnaserror, WarningsAsErrors, WarningsNotAsErrors, DisabledWarnings, nowarn, CodeAnalysisRuleSet, ruleset, ErrorLog, errorlog, ReportAnalyzer, reportanalyzer + href: ./compiler-options/errors-warnings.md + - name: Code generation options + displayName: DebugType, debug, Optimize, optimize, Deterministic, deterministic, ProduceOnlyReferenceAssembly, refonly + href: ./compiler-options/code-generation.md + - name: Security options + displayName: DelaySign, delaysign, KeyFile, keyfile, KeyContainer, keycontainer, PublicSign, publicsign, highentropyva, HighEntropyVA + href: ./compiler-options/security.md + - name: Resources options + displayName: Win32Resource, win32res, Win32Icon, win32icon, Win32Manifest, win32manifest, NoWin32Manifest, nowin32manifest, Resources, resource, LinkResources + href: ./compiler-options/resources.md + - name: Miscellaneous options + displayName: ResponseFiles, @, NoLogo, nologo, NoConfig, noconfig + href: ./compiler-options/miscellaneous.md + - name: Advanced options + displayName: MainEntryPoint, StartupObject, main, PdbFile, pdb, PathMap, pathmap, ApplicationConfiguration, appconfig, AdditionalLibPaths, lib, GenerateFullPaths, fullpath, PreferredUILang, preferreduilang, BaseAddress, baseaddress, ChecksumAlgorithm, checksumalgorithm, CodePage, codepage, Utf8Output, utf8output, FileAlignment, filealign, ErrorEndLocation, errorendlocation, NoStandardLib, nostdlib, SubsystemVersion, subsystemversion, ModuleAssemblyName, moduleassemblyname + href: ./compiler-options/advanced.md + - name: XML documentation comments + items: + - name: Generate API documentation + href: ./xmldoc/index.md + displayName: xml documentation comments + - name: Recommended tags + href: ./xmldoc/recommended-tags.md + - name: Examples + href: ./xmldoc/examples.md +- name: C# compiler messages + href: ./compiler-messages/index.md + items: + - name: Feature or version missing + href: ./compiler-messages/feature-version-errors.md + displayName: > + CS0171, CS0188, CS0843, CS8904, CS1738, CS8022, CS8023, CS8024, CS8025, CS8026, CS8058, CS8059, CS8107, CS8192, CS8302, + CS8303, CS8304, CS8305, CS8306, CS8314, CS8320, CS8370, CS8371, CS8400, CS8401, CS8511, CS8627, CS8630, CS8652, CS8703, + CS8704, CS8706, CS8773, CS8912, CS8919, CS8929, CS8936, CS8957, CS8967, CS9014, CS9015, CS9016, CS9017, CS9058, CS9064, + CS9103, CS9171, CS9194, CS9202, CS9204 + - name: Assembly references + href: ./compiler-messages/assembly-references.md + displayName: > + CS0012, CS0234, CS0246, CS0400, CS1068, CS1069, CS1070, CS1704, CS1683, CS1714, CS1760, CS7008, CS7068, CS7069, + CS7071, CS7079, CS8090, CS8203 + - name: Constructor declarations + href: ./compiler-messages/constructor-errors.md + displayName: > + Primary constructors, + CS0514, CS0515, CS0516, CS0517, CS0522, CS0526, CS0568, CS0710, CS0768, CS0824, CS8054, CS8091, CS8358, CS8862, CS8867, + CS8868, CS8878, CS8910, CS8958, CS8982, CS8983, CS9105, CS9106, CS9107, CS9108, CS9109, CS9110, CS9111, CS9112, CS9113, + CS9114, CS9115, CS9116, CS9117, CS9118, CS9119, CS9120, CS9121, CS9122, CS9124, CS9136, CS9179 + - name: Parameter / argument mismatch + href: ./compiler-messages/parameter-argument-mismatch.md + displayName: > + CS0182, CS0591, CS0599, CS0617, CS0633, CS0643, CS0655, CS0839, CS1016, CS1739, CS1740, CS1742, CS1744, CS1746, CS7036, + CS7067, CS8196, CS8324, CS8861, CS8905, CS8943, CS8944, CS8945, CS8948, CS8949, CS8950, CS8951, CS8964, CS8965, CS8966 + - name: Reference parameters + href: ./compiler-messages/ref-modifiers-errors.md + displayName: > + ref safety, + CS0192, CS0199, CS0206, CS0631, CS0767, CS1510, CS1605, CS1623, CS1649, CS1651, CS1655, CS1657, CS1741, CS1939, CS1988, + CS7084, CS8166, CS8167, CS8168, CS8169. CS8325, CS8326, CS8327, CS8329, CS8330, CS8331, CS8332, CS8337, CS8338, CS8345, + CS8351, CS8373, CS8374, CS8388, CS8977, CS9072, CS9077, CS9078, CS9079, CS9085, CS9086, CS9087, CS9089, CS9091, CS9092, + CS9093, CS9094, CS9095, CS9096, CS9097, CS9101, CS9102, CS9104, CS9190, CS9191, CS9192, CS9193, CS9195, CS9196, CS9197, + CS9198, CS9199, CS9200, CS9201 + - name: Nullable warnings + href: ./compiler-messages/nullable-warnings.md + displayName: > + CS8597, CS8600, CS8601, CS8602, CS8604, CS8605, CS8607, CS8608, CS8609, CS8610, CS8611, CS8612, CS8613, CS8614, CS8615, + CS8616, CS8617, CS8618, CS8619, CS8620, CS8621, CS8622, CS8624, CS8625, CS8629, CS8631, CS8634, CS8655, CS8633, CS8643, + CS8644, CS8645, CS8762, CS8763, CS8764, CS8765, CS8766, CS8667, CS8768, CS8670, CS8714, CS8767, CS8769, CS8770, CS8774, + CS8776, CS8775, CS8777, CS8819, CS8824, CS8825, CS8847 + - name: Pattern matching warnings + href: ./compiler-messages/pattern-matching-warnings.md + displayName: CS8509, CS9134, CS9135 + - name: Array declarations + href: ./compiler-messages/array-declaration-errors.md + displayName: > + CS0022, CS0178, CS0248, CS0251, CS0270, CS0611, CS0623, CS0650, CS0719, CS0747, CS0820, CS0826, CS0846, CS1552, CS1586, + CS1920, CS1921, CS1925, CS1954, CS3007, CS3016, CS9174, CS9176, CS9185, CS9186, CS9187, CS9188, CS9203, CS9208, CS9209, + CS9210 + - name: Inline arrays + href: ./compiler-messages/inline-array-errors.md + displayName: CS9164, CS9165, CS9166, CS9167, CS9168, CS9169, CS9172, CS9173, CS9180, CS9181, CS9182, CS9183, CS9184 + - name: Lambda expressions + href: ./compiler-messages/lambda-expression-errors.md + displayName: > + CS0748, CS1621, CS1628, CS1632, CS1673, CS1686, CS1706, CS1989, CS8030, CS8175, CS8916, CS8971, CS8972, CS8975, CS9098, + CS9099, CS9100 + - name: Restrictions on expression trees + href: ./compiler-messages/expression-tree-restrictions.md + displayName: > + CS0765, CS0831, CS0832, CS0834, CS0835, CS0838, CS0845, CS0853, CS0854, CS0855, CS1944, CS1945, CS1946, CS1951, CS1952, + CS1963, CS2037, CS7053, CS8072, CS8074, CS8075, CS8110, CS8122, CS8143, CS8144, CS8153, CS8155, CS8198, CS8207, CS8382, + CS8514, CS8640, CS8642, CS8790, CS8791, CS8792, CS8810, CS8849, CS8927, CS8952, CS9170, CS9175 + - name: Using directive and aliases + href: ./compiler-messages/using-directive-errors.md + displayName: > + CS0105, CS0138, CS0431, CS0432, CS0440, CS0576, CS0687, CS1529, CS1537, CS7000, CS7007, CS8019, CS8083, CS8085, CS8914, + CS8915, CS8933, CS9055, CS9130, CS9131, CS9132, CS9133, CS9162, CS9163 + - name: Source generators + href: ./compiler-messages/source-generator-errors.md + displayName: > + CS9137, CS9138, CS9139, CS9140, CS9141, CS9142, CS9143, CS9144, CS9145, CS9146, CS9147, CS9148, CS9149, CS9150, CS9151, + CS9152, CS9153, CS9154, CS9155, CS9156, CS9157, CS9158, CS9159, CS9160, CS9161, CS9177, CS9178, CS9206, CS9207 + - name: static abstract interface members + href: ./compiler-messages/static-abstract-interfaces.md + displayName: CS8920, CS8921, CS8922, CS8923, CS8924, CS8925, CS8926, CS8928, CS8930, 8931, 8932 + - name: Warning waves + href: ./compiler-messages/warning-waves.md + displayName: > + CS7023, CS8073, CS8848, CS8880, CS8881, CS8882, CS8883, CS8884, CS8885, CS8886, CS8887, CS8892, CS8897, CS8898, CS8826, + CS8981 + - name: Error messages + items: + - name: CS0001 + href: ./compiler-messages/cs0001.md + - name: CS0003 + href: ../misc/cs0003.md + - name: CS0004 + href: ../misc/cs0004.md + - name: CS0005 + href: ../misc/cs0005.md + - name: CS0006 + href: ./compiler-messages/cs0006.md + - name: CS0007 + href: ./compiler-messages/cs0007.md + - name: CS0008 + href: ../misc/cs0008.md + - name: CS0009 + href: ../misc/cs0009.md + - name: CS0010 + href: ../misc/cs0010.md + - name: CS0011 + href: ../misc/cs0011.md + - name: CS0013 + href: ../misc/cs0013.md + - name: CS0014 + href: ../misc/cs0014.md + - name: CS0015 + href: ./compiler-messages/cs0015.md + - name: CS0016 + href: ./compiler-messages/cs0016.md + - name: CS0017 + href: ../misc/cs0017.md + - name: CS0019 + href: ./compiler-messages/cs0019.md + - name: CS0020 + href: ../misc/cs0020.md + - name: CS0021 + href: ../misc/cs0021.md + - name: CS0023 + href: ../misc/cs0023.md + - name: CS0025 + href: ../misc/cs0025.md + - name: CS0026 + href: ../misc/cs0026.md + - name: CS0027 + href: ../misc/cs0027.md + - name: CS0029 + href: ./compiler-messages/cs0029.md + - name: CS0030 + href: ../misc/cs0030.md + - name: CS0031 + href: ../misc/cs0031.md + - name: CS0034 + href: ./compiler-messages/cs0034.md + - name: CS0035 + href: ../misc/cs0035.md + - name: CS0036 + href: ../misc/cs0036.md + - name: CS0037 + href: ../misc/cs0037.md + - name: CS0038 + href: ./compiler-messages/cs0038.md + - name: CS0039 + href: ./compiler-messages/cs0039.md + - name: CS0040 + href: ../misc/cs0040.md + - name: CS0041 + href: ../misc/cs0041.md + - name: CS0042 + href: ../misc/cs0042.md + - name: CS0043 + href: ../misc/cs0043.md + - name: CS0050 + href: ./compiler-messages/cs0050.md + - name: CS0051 + href: ./compiler-messages/cs0051.md + - name: CS0052 + href: ./compiler-messages/cs0052.md + - name: CS0053 + href: ../misc/cs0053.md + - name: CS0054 + href: ../misc/cs0054.md + - name: CS0055 + href: ../misc/cs0055.md + - name: CS0056 + href: ../misc/cs0056.md + - name: CS0057 + href: ../misc/cs0057.md + - name: CS0058 + href: ../misc/cs0058.md + - name: CS0059 + href: ../misc/cs0059.md + - name: CS0060 + href: ../misc/cs0060.md + - name: CS0061 + href: ../misc/cs0061.md + - name: CS0065 + href: ../misc/cs0065.md + - name: CS0066 + href: ../misc/cs0066.md + - name: CS0068 + href: ../misc/cs0068.md + - name: CS0069 + href: ../misc/cs0069.md + - name: CS0070 + href: ../misc/cs0070.md + - name: CS0071 + href: ./compiler-messages/cs0071.md + - name: CS0072 + href: ../misc/cs0072.md + - name: CS0073 + href: ../misc/cs0073.md + - name: CS0074 + href: ../misc/cs0074.md + - name: CS0075 + href: ../misc/cs0075.md + - name: CS0076 + href: ../misc/cs0076.md + - name: CS0077 + href: ../misc/cs0077.md + - name: CS0079 + href: ../misc/cs0079.md + - name: CS0080 + href: ../misc/cs0080.md + - name: CS0081 + href: ../misc/cs0081.md + - name: CS0082 + href: ../misc/cs0082.md + - name: CS0100 + href: ../misc/cs0100.md + - name: CS0101 + href: ../misc/cs0101.md + - name: CS0102 + href: ../misc/cs0102.md + - name: CS0103 + href: ./compiler-messages/cs0103.md + - name: CS0104 + href: ../misc/cs0104.md + - name: CS0106 + href: ./compiler-messages/cs0106.md + - name: CS0107 + href: ../misc/cs0107.md + - name: CS0110 + href: ../misc/cs0110.md + - name: CS0111 + href: ../misc/cs0111.md + - name: CS0112 + href: ../misc/cs0112.md + - name: CS0113 + href: ../misc/cs0113.md + - name: CS0115 + href: ./compiler-messages/cs0115.md + - name: CS0116 + href: ./compiler-messages/cs0116.md + - name: CS0117 + href: ../misc/cs0117.md + - name: CS0118 + href: ../misc/cs0118.md + - name: CS0119 + href: ../misc/cs0119.md + - name: CS0120 + href: ./compiler-messages/cs0120.md + - name: CS0121 + href: ../misc/cs0121.md + - name: CS0122 + href: ./compiler-messages/cs0122.md + - name: CS0123 + href: ../misc/cs0123.md + - name: CS0126 + href: ../misc/cs0126.md + - name: CS0127 + href: ../misc/cs0127.md + - name: CS0128 + href: ../misc/cs0128.md + - name: CS0131 + href: ../misc/cs0131.md + - name: CS0132 + href: ../misc/cs0132.md + - name: CS0133 + href: ../misc/cs0133.md + - name: CS0134 + href: ./compiler-messages/cs0134.md + - name: CS0135 + href: ../misc/cs0135.md + - name: CS0136 + href: ../misc/cs0136.md + - name: CS0139 + href: ../misc/cs0139.md + - name: CS0140 + href: ../misc/cs0140.md + - name: CS0143 + href: ../misc/cs0143.md + - name: CS0144 + href: ../misc/cs0144.md + - name: CS0145 + href: ../misc/cs0145.md + - name: CS0146 + href: ../misc/cs0146.md + - name: CS0148 + href: ../misc/cs0148.md + - name: CS0149 + href: ../misc/cs0149.md + - name: CS0150 + href: ../misc/cs0150.md + - name: CS0151 + href: ./compiler-messages/cs0151.md + - name: CS0152 + href: ../misc/cs0152.md + - name: CS0153 + href: ../misc/cs0153.md + - name: CS0154 + href: ../misc/cs0154.md + - name: CS0155 + href: ../misc/cs0155.md + - name: CS0156 + href: ../misc/cs0156.md + - name: CS0157 + href: ../misc/cs0157.md + - name: CS0158 + href: ../misc/cs0158.md + - name: CS0159 + href: ../misc/cs0159.md + - name: CS0160 + href: ../misc/cs0160.md + - name: CS0161 + href: ../misc/cs0161.md + - name: CS0163 + href: ./compiler-messages/cs0163.md + - name: CS0165 + href: ./compiler-messages/cs0165.md + - name: CS0167 + href: ../misc/cs0167.md + - name: CS0170 + href: ../misc/cs0170.md + - name: CS0172 + href: ../misc/cs0172.md + - name: CS0173 + href: ./compiler-messages/cs0173.md + - name: CS0174 + href: ../misc/cs0174.md + - name: CS0175 + href: ../misc/cs0175.md + - name: CS0176 + href: ../misc/cs0176.md + - name: CS0177 + href: ../misc/cs0177.md + - name: CS0179 + href: ../misc/cs0179.md + - name: CS0180 + href: ../misc/cs0180.md + - name: CS0181 + href: ./compiler-messages/cs0181.md + - name: CS0185 + href: ../misc/cs0185.md + - name: CS0186 + href: ../misc/cs0186.md + - name: CS0191 + href: ../misc/cs0191.md + - name: CS0193 + href: ../misc/cs0193.md + - name: CS0196 + href: ../misc/cs0196.md + - name: CS0198 + href: ../misc/cs0198.md + - name: CS0200 + href: ../misc/cs0200.md + - name: CS0201 + href: ./compiler-messages/cs0201.md + - name: CS0202 + href: ../misc/cs0202.md + - name: CS0204 + href: ../misc/cs0204.md + - name: CS0205 + href: ../misc/cs0205.md + - name: CS0208 + href: ../misc/cs0208.md + - name: CS0209 + href: ../misc/cs0209.md + - name: CS0210 + href: ../misc/cs0210.md + - name: CS0211 + href: ../misc/cs0211.md + - name: CS0212 + href: ../misc/cs0212.md + - name: CS0213 + href: ../misc/cs0213.md + - name: CS0214 + href: ../misc/cs0214.md + - name: CS0215 + href: ../misc/cs0215.md + - name: CS0216 + href: ../misc/cs0216.md + - name: CS0217 + href: ../misc/cs0217.md + - name: CS0218 + href: ../misc/cs0218.md + - name: CS0220 + href: ../misc/cs0220.md + - name: CS0221 + href: ../misc/cs0221.md + - name: CS0225 + href: ../misc/cs0225.md + - name: CS0226 + href: ../misc/cs0226.md + - name: CS0227 + href: ../misc/cs0227.md + - name: CS0228 + href: ../misc/cs0228.md + - name: CS0229 + href: ./compiler-messages/cs0229.md + - name: CS0230 + href: ../misc/cs0230.md + - name: CS0231 + href: ../misc/cs0231.md + - name: CS0233 + href: ./compiler-messages/cs0233.md + - name: CS0236 + href: ../misc/cs0236.md + - name: CS0238 + href: ../misc/cs0238.md + - name: CS0239 + href: ../misc/cs0239.md + - name: CS0241 + href: ../misc/cs0241.md + - name: CS0242 + href: ../misc/cs0242.md + - name: CS0243 + href: ../misc/cs0243.md + - name: CS0244 + href: ../misc/cs0244.md + - name: CS0245 + href: ../misc/cs0245.md + - name: CS0247 + href: ../misc/cs0247.md + - name: CS0249 + href: ../misc/cs0249.md + - name: CS0250 + href: ../misc/cs0250.md + - name: CS0254 + href: ../misc/cs0254.md + - name: CS0255 + href: ../misc/cs0255.md + - name: CS0260 + href: ./compiler-messages/cs0260.md + - name: CS0261 + href: ../misc/cs0261.md + - name: CS0262 + href: ../misc/cs0262.md + - name: CS0263 + href: ../misc/cs0263.md + - name: CS0264 + href: ../misc/cs0264.md + - name: CS0265 + href: ../misc/cs0265.md + - name: CS0266 + href: ./compiler-messages/cs0266.md + - name: CS0267 + href: ../misc/cs0267.md + - name: CS0268 + href: ../misc/cs0268.md + - name: CS0269 + href: ./compiler-messages/cs0269.md + - name: CS0271 + href: ../misc/cs0271.md + - name: CS0272 + href: ../misc/cs0272.md + - name: CS0273 + href: ../misc/cs0273.md + - name: CS0274 + href: ../misc/cs0274.md + - name: CS0275 + href: ../misc/cs0275.md + - name: CS0276 + href: ../misc/cs0276.md + - name: CS0277 + href: ../misc/cs0277.md + - name: CS0281 + href: ../misc/cs0281.md + - name: CS0283 + href: ../misc/cs0283.md + - name: CS0304 + href: ./compiler-messages/cs0304.md + - name: CS0305 + href: ../misc/cs0305.md + - name: CS0306 + href: ../misc/cs0306.md + - name: CS0307 + href: ../misc/cs0307.md + - name: CS0308 + href: ../misc/cs0308.md + - name: CS0310 + href: ./compiler-messages/cs0310.md + - name: CS0311 + href: ./compiler-messages/cs0311.md + - name: CS0312 + href: ../misc/cs0312.md + - name: CS0313 + href: ../misc/cs0313.md + - name: CS0314 + href: ../misc/cs0314.md + - name: CS0315 + href: ../misc/cs0315.md + - name: CS0316 + href: ../misc/cs0316.md + - name: CS0401 + href: ../misc/cs0401.md + - name: CS0403 + href: ../misc/cs0403.md + - name: CS0404 + href: ../misc/cs0404.md + - name: CS0405 + href: ../misc/cs0405.md + - name: CS0406 + href: ../misc/cs0406.md + - name: CS0407 + href: ../misc/cs0407.md + - name: CS0409 + href: ../misc/cs0409.md + - name: CS0410 + href: ../misc/cs0410.md + - name: CS0411 + href: ../misc/cs0411.md + - name: CS0412 + href: ../misc/cs0412.md + - name: CS0413 + href: ./compiler-messages/cs0413.md + - name: CS0415 + href: ../misc/cs0415.md + - name: CS0416 + href: ../misc/cs0416.md + - name: CS0417 + href: ./compiler-messages/cs0417.md + - name: CS0418 + href: ../misc/cs0418.md + - name: CS0423 + href: ../misc/cs0423.md + - name: CS0424 + href: ../misc/cs0424.md + - name: CS0425 + href: ../misc/cs0425.md + - name: CS0426 + href: ../misc/cs0426.md + - name: CS0428 + href: ../misc/cs0428.md + - name: CS0430 + href: ../misc/cs0430.md + - name: CS0433 + href: ./compiler-messages/cs0433.md + - name: CS0434 + href: ../misc/cs0434.md + - name: CS0438 + href: ../misc/cs0438.md + - name: CS0439 + href: ../misc/cs0439.md + - name: CS0441 + href: ../misc/cs0441.md + - name: CS0442 + href: ../misc/cs0442.md + - name: CS0443 + href: ../misc/cs0443.md + - name: CS0445 + href: ./compiler-messages/cs0445.md + - name: CS0446 + href: ./compiler-messages/cs0446.md + - name: CS0447 + href: ../misc/cs0447.md + - name: CS0448 + href: ../misc/cs0448.md + - name: CS0449 + href: ../misc/cs0449.md + - name: CS0450 + href: ../misc/cs0450.md + - name: CS0451 + href: ../misc/cs0451.md + - name: CS0452 + href: ../misc/cs0452.md + - name: CS0453 + href: ../misc/cs0453.md + - name: CS0454 + href: ../misc/cs0454.md + - name: CS0455 + href: ../misc/cs0455.md + - name: CS0456 + href: ../misc/cs0456.md + - name: CS0457 + href: ../misc/cs0457.md + - name: CS0459 + href: ../misc/cs0459.md + - name: CS0460 + href: ../misc/cs0460.md + - name: CS0462 + href: ../misc/cs0462.md + - name: CS0463 + href: ../misc/cs0463.md + - name: CS0466 + href: ../misc/cs0466.md + - name: CS0468 + href: ../misc/cs0468.md + - name: CS0470 + href: ../misc/cs0470.md + - name: CS0471 + href: ../misc/cs0471.md + - name: CS0473 + href: ../misc/cs0473.md + - name: CS0500 + href: ../misc/cs0500.md + - name: CS0501 + href: ../misc/cs0501.md + - name: CS0502 + href: ../misc/cs0502.md + - name: CS0503 + href: ../misc/cs0503.md + - name: CS0504 + href: ./compiler-messages/cs0504.md + - name: CS0505 + href: ../misc/cs0505.md + - name: CS0506 + href: ../misc/cs0506.md + - name: CS0507 + href: ./compiler-messages/cs0507.md + - name: CS0508 + href: ../misc/cs0508.md + - name: CS0509 + href: ../misc/cs0509.md + - name: CS0513 + href: ../misc/cs0513.md + - name: CS0518 + href: ./compiler-messages/cs0518.md + - name: CS0520 + href: ../misc/cs0520.md + - name: CS0523 + href: ./compiler-messages/cs0523.md + - name: CS0524 + href: ../misc/cs0524.md + - name: CS0525 + href: ../misc/cs0525.md + - name: CS0527 + href: ../misc/cs0527.md + - name: CS0528 + href: ../misc/cs0528.md + - name: CS0529 + href: ../misc/cs0529.md + - name: CS0531 + href: ../misc/cs0531.md + - name: CS0533 + href: ../misc/cs0533.md + - name: CS0534 + href: ../misc/cs0534.md + - name: CS0535 + href: ../misc/cs0535.md + - name: CS0537 + href: ../misc/cs0537.md + - name: CS0538 + href: ../misc/cs0538.md + - name: CS0539 + href: ../misc/cs0539.md + - name: CS0540 + href: ../misc/cs0540.md + - name: CS0541 + href: ../misc/cs0541.md + - name: CS0542 + href: ../misc/cs0542.md + - name: CS0543 + href: ../misc/cs0543.md + - name: CS0544 + href: ../misc/cs0544.md + - name: CS0545 + href: ./compiler-messages/cs0545.md + - name: CS0546 + href: ../misc/cs0546.md + - name: CS0547 + href: ../misc/cs0547.md + - name: CS0548 + href: ../misc/cs0548.md + - name: CS0549 + href: ../misc/cs0549.md + - name: CS0550 + href: ../misc/cs0550.md + - name: CS0551 + href: ../misc/cs0551.md + - name: CS0552 + href: ./compiler-messages/cs0552.md + - name: CS0553 + href: ../misc/cs0553.md + - name: CS0554 + href: ../misc/cs0554.md + - name: CS0555 + href: ../misc/cs0555.md + - name: CS0556 + href: ../misc/cs0556.md + - name: CS0557 + href: ../misc/cs0557.md + - name: CS0558 + href: ../misc/cs0558.md + - name: CS0559 + href: ../misc/cs0559.md + - name: CS0562 + href: ../misc/cs0562.md + - name: CS0563 + href: ./compiler-messages/cs0563.md + - name: CS0564 + href: ../misc/cs0564.md + - name: CS0567 + href: ../misc/cs0567.md + - name: CS0569 + href: ../misc/cs0569.md + - name: CS0570 + href: ./compiler-messages/cs0570.md + - name: CS0571 + href: ./compiler-messages/cs0571.md + - name: CS0572 + href: ../misc/cs0572.md + - name: CS0573 + href: ../misc/cs0573.md + - name: CS0574 + href: ../misc/cs0574.md + - name: CS0575 + href: ../misc/cs0575.md + - name: CS0577 + href: ../misc/cs0577.md + - name: CS0578 + href: ../misc/cs0578.md + - name: CS0579 + href: ./compiler-messages/cs0579.md + - name: CS0582 + href: ../misc/cs0582.md + - name: CS0583 + href: ../misc/cs0583.md + - name: CS0584 + href: ../misc/cs0584.md + - name: CS0585 + href: ../misc/cs0585.md + - name: CS0586 + href: ../misc/cs0586.md + - name: CS0587 + href: ../misc/cs0587.md + - name: CS0588 + href: ../misc/cs0588.md + - name: CS0589 + href: ../misc/cs0589.md + - name: CS0590 + href: ../misc/cs0590.md + - name: CS0592 + href: ./compiler-messages/cs0592.md + - name: CS0594 + href: ../misc/cs0594.md + - name: CS0596 + href: ../misc/cs0596.md + - name: CS0601 + href: ../misc/cs0601.md + - name: CS0609 + href: ../misc/cs0609.md + - name: CS0610 + href: ../misc/cs0610.md + - name: CS0616 + href: ./compiler-messages/cs0616.md + - name: CS0619 + href: ../misc/cs0619.md + - name: CS0620 + href: ../misc/cs0620.md + - name: CS0621 + href: ../misc/cs0621.md + - name: CS0622 + href: ../misc/cs0622.md + - name: CS0625 + href: ../misc/cs0625.md + - name: CS0629 + href: ../misc/cs0629.md + - name: CS0635 + href: ../misc/cs0635.md + - name: CS0636 + href: ../misc/cs0636.md + - name: CS0637 + href: ../misc/cs0637.md + - name: CS0641 + href: ../misc/cs0641.md + - name: CS0644 + href: ../misc/cs0644.md + - name: CS0645 + href: ../misc/cs0645.md + - name: CS0646 + href: ../misc/cs0646.md + - name: CS0647 + href: ../misc/cs0647.md + - name: CS0648 + href: ../misc/cs0648.md + - name: CS0653 + href: ../misc/cs0653.md + - name: CS0656 + href: ../misc/cs0656.md + - name: CS0662 + href: ../misc/cs0662.md + - name: CS0663 + href: ../misc/cs0663.md + - name: CS0664 + href: ../misc/cs0664.md + - name: CS0666 + href: ../misc/cs0666.md + - name: CS0667 + href: ../misc/cs0667.md + - name: CS0668 + href: ../misc/cs0668.md + - name: CS0669 + href: ../misc/cs0669.md + - name: CS0670 + href: ../misc/cs0670.md + - name: CS0673 + href: ../misc/cs0673.md + - name: CS0674 + href: ../misc/cs0674.md + - name: CS0677 + href: ../misc/cs0677.md + - name: CS0678 + href: ../misc/cs0678.md + - name: CS0681 + href: ../misc/cs0681.md + - name: CS0682 + href: ../misc/cs0682.md + - name: CS0683 + href: ../misc/cs0683.md + - name: CS0685 + href: ../misc/cs0685.md + - name: CS0686 + href: ./compiler-messages/cs0686.md + - name: CS0689 + href: ../misc/cs0689.md + - name: CS0690 + href: ../misc/cs0690.md + - name: CS0692 + href: ../misc/cs0692.md + - name: CS0694 + href: ../misc/cs0694.md + - name: CS0695 + href: ../misc/cs0695.md + - name: CS0698 + href: ../misc/cs0698.md + - name: CS0699 + href: ../misc/cs0699.md + - name: CS0701 + href: ../misc/cs0701.md + - name: CS0702 + href: ./compiler-messages/cs0702.md + - name: CS0703 + href: ./compiler-messages/cs0703.md + - name: CS0704 + href: ../misc/cs0704.md + - name: CS0706 + href: ../misc/cs0706.md + - name: CS0708 + href: ../misc/cs0708.md + - name: CS0709 + href: ../misc/cs0709.md + - name: CS0711 + href: ../misc/cs0711.md + - name: CS0712 + href: ../misc/cs0712.md + - name: CS0713 + href: ../misc/cs0713.md + - name: CS0714 + href: ../misc/cs0714.md + - name: CS0715 + href: ../misc/cs0715.md + - name: CS0716 + href: ../misc/cs0716.md + - name: CS0717 + href: ../misc/cs0717.md + - name: CS0718 + href: ../misc/cs0718.md + - name: CS0720 + href: ../misc/cs0720.md + - name: CS0721 + href: ../misc/cs0721.md + - name: CS0722 + href: ../misc/cs0722.md + - name: CS0723 + href: ../misc/cs0723.md + - name: CS0724 + href: ../misc/cs0724.md + - name: CS0726 + href: ../misc/cs0726.md + - name: CS0727 + href: ../misc/cs0727.md + - name: CS0729 + href: ../misc/cs0729.md + - name: CS0730 + href: ../misc/cs0730.md + - name: CS0731 + href: ./compiler-messages/cs0731.md + - name: CS0733 + href: ../misc/cs0733.md + - name: CS0734 + href: ../misc/cs0734.md + - name: CS0735 + href: ../misc/cs0735.md + - name: CS0736 + href: ../misc/cs0736.md + - name: CS0737 + href: ../misc/cs0737.md + - name: CS0738 + href: ../misc/cs0738.md + - name: CS0739 + href: ../misc/cs0739.md + - name: CS0742 + href: ../misc/cs0742.md + - name: CS0743 + href: ../misc/cs0743.md + - name: CS0744 + href: ../misc/cs0744.md + - name: CS0745 + href: ../misc/cs0745.md + - name: CS0746 + href: ../misc/cs0746.md + - name: CS0750 + href: ../misc/cs0750.md + - name: CS0751 + href: ../misc/cs0751.md + - name: CS0752 + href: ../misc/cs0752.md + - name: CS0753 + href: ../misc/cs0753.md + - name: CS0754 + href: ../misc/cs0754.md + - name: CS0755 + href: ../misc/cs0755.md + - name: CS0756 + href: ../misc/cs0756.md + - name: CS0757 + href: ../misc/cs0757.md + - name: CS0758 + href: ../misc/cs0758.md + - name: CS0759 + href: ../misc/cs0759.md + - name: CS0761 + href: ../misc/cs0761.md + - name: CS0762 + href: ../misc/cs0762.md + - name: CS0763 + href: ../misc/cs0763.md + - name: CS0764 + href: ../misc/cs0764.md + - name: CS0766 + href: ../misc/cs0766.md + - name: CS0811 + href: ../misc/cs0811.md + - name: CS0815 + href: ../misc/cs0815.md + - name: CS0818 + href: ../misc/cs0818.md + - name: CS0819 + href: ../misc/cs0819.md + - name: CS0821 + href: ../misc/cs0821.md + - name: CS0822 + href: ../misc/cs0822.md + - name: CS0825 + href: ../misc/cs0825.md + - name: CS0828 + href: ../misc/cs0828.md + - name: CS0833 + href: ../misc/cs0833.md + - name: CS0836 + href: ../misc/cs0836.md + - name: CS0837 + href: ../misc/cs0837.md + - name: CS0840 + href: ./compiler-messages/cs0840.md + - name: CS0841 + href: ../misc/cs0841.md + - name: CS0842 + href: ../misc/cs0842.md + - name: CS0844 + href: ../misc/cs0844.md + - name: CS1001 + href: ./compiler-messages/cs1001.md + - name: CS1002 + href: ../misc/cs1002.md + - name: CS1003 + href: ../misc/cs1003.md + - name: CS1004 + href: ../misc/cs1004.md + - name: CS1007 + href: ../misc/cs1007.md + - name: CS1008 + href: ../misc/cs1008.md + - name: CS1009 + href: ./compiler-messages/cs1009.md + - name: CS1010 + href: ../misc/cs1010.md + - name: CS1011 + href: ../misc/cs1011.md + - name: CS1012 + href: ../misc/cs1012.md + - name: CS1013 + href: ../misc/cs1013.md + - name: CS1014 + href: ../misc/cs1014.md + - name: CS1015 + href: ../misc/cs1015.md + - name: CS1017 + href: ../misc/cs1017.md + - name: CS1018 + href: ./compiler-messages/cs1018.md + - name: CS1019 + href: ./compiler-messages/cs1019.md + - name: CS1020 + href: ../misc/cs1020.md + - name: CS1021 + href: ../misc/cs1021.md + - name: CS1022 + href: ../misc/cs1022.md + - name: CS1023 + href: ../misc/cs1023.md + - name: CS1024 + href: ../misc/cs1024.md + - name: CS1025 + href: ../misc/cs1025.md + - name: CS1026 + href: ./compiler-messages/cs1026.md + - name: CS1027 + href: ../misc/cs1027.md + - name: CS1028 + href: ../misc/cs1028.md + - name: CS1029 + href: ./compiler-messages/cs1029.md + - name: CS1031 + href: ../misc/cs1031.md + - name: CS1032 + href: ../misc/cs1032.md + - name: CS1033 + href: ../misc/cs1033.md + - name: CS1034 + href: ../misc/cs1034.md + - name: CS1035 + href: ../misc/cs1035.md + - name: CS1036 + href: ../misc/cs1036.md + - name: CS1037 + href: ../misc/cs1037.md + - name: CS1038 + href: ../misc/cs1038.md + - name: CS1039 + href: ../misc/cs1039.md + - name: CS1040 + href: ../misc/cs1040.md + - name: CS1041 + href: ../misc/cs1041.md + - name: CS1043 + href: ../misc/cs1043.md + - name: CS1044 + href: ../misc/cs1044.md + - name: CS1055 + href: ../misc/cs1055.md + - name: CS1056 + href: ../misc/cs1056.md + - name: CS1057 + href: ../misc/cs1057.md + - name: CS1059 + href: ../misc/cs1059.md + - name: CS1061 + href: ./compiler-messages/cs1061.md + - name: CS1063 + href: ./compiler-messages/cs1063.md + - name: CS1065 + href: ./compiler-messages/cs1065.md + - name: CS1067 + href: ./compiler-messages/cs1067.md + - name: CS1100 + href: ../misc/cs1100.md + - name: CS1101 + href: ../misc/cs1101.md + - name: CS1102 + href: ../misc/cs1102.md + - name: CS1103 + href: ../misc/cs1103.md + - name: CS1104 + href: ../misc/cs1104.md + - name: CS1105 + href: ../misc/cs1105.md + - name: CS1106 + href: ../misc/cs1106.md + - name: CS1107 + href: ../misc/cs1107.md + - name: CS1108 + href: ../misc/cs1108.md + - name: CS1109 + href: ../misc/cs1109.md + - name: CS1110 + href: ../misc/cs1110.md + - name: CS1112 + href: ./compiler-messages/cs1112.md + - name: CS1113 + href: ../misc/cs1113.md + - name: CS1501 + href: ./compiler-messages/cs1501.md + - name: CS1502 + href: ./compiler-messages/cs1502.md + - name: CS1503 + href: ../misc/cs1503.md + - name: CS1504 + href: ../misc/cs1504.md + - name: CS1507 + href: ../misc/cs1507.md + - name: CS1508 + href: ../misc/cs1508.md + - name: CS1509 + href: ../misc/cs1509.md + - name: CS1511 + href: ../misc/cs1511.md + - name: CS1512 + href: ../misc/cs1512.md + - name: CS1513 + href: ../misc/cs1513.md + - name: CS1514 + href: ../misc/cs1514.md + - name: CS1515 + href: ../misc/cs1515.md + - name: CS1517 + href: ../misc/cs1517.md + - name: CS1518 + href: ../misc/cs1518.md + - name: CS1519 + href: ./compiler-messages/cs1519.md + - name: CS1520 + href: ../misc/cs1520.md + - name: CS1521 + href: ../misc/cs1521.md + - name: CS1524 + href: ../misc/cs1524.md + - name: CS1525 + href: ../misc/cs1525.md + - name: CS1526 + href: ../misc/cs1526.md + - name: CS1527 + href: ../misc/cs1527.md + - name: CS1528 + href: ../misc/cs1528.md + - name: CS1530 + href: ../misc/cs1530.md + - name: CS1534 + href: ../misc/cs1534.md + - name: CS1535 + href: ../misc/cs1535.md + - name: CS1536 + href: ../misc/cs1536.md + - name: CS1540 + href: ./compiler-messages/cs1540.md + - name: CS1541 + href: ../misc/cs1541.md + - name: CS1542 + href: ../misc/cs1542.md + - name: CS1545 + href: ../misc/cs1545.md + - name: CS1546 + href: ./compiler-messages/cs1546.md + - name: CS1547 + href: ../misc/cs1547.md + - name: CS1548 + href: ./compiler-messages/cs1548.md + - name: CS1551 + href: ../misc/cs1551.md + - name: CS1553 + href: ../misc/cs1553.md + - name: CS1554 + href: ../misc/cs1554.md + - name: CS1555 + href: ../misc/cs1555.md + - name: CS1556 + href: ../misc/cs1556.md + - name: CS1557 + href: ../misc/cs1557.md + - name: CS1558 + href: ../misc/cs1558.md + - name: CS1559 + href: ../misc/cs1559.md + - name: CS1560 + href: ../misc/cs1560.md + - name: CS1561 + href: ../misc/cs1561.md + - name: CS1562 + href: ../misc/cs1562.md + - name: CS1563 + href: ../misc/cs1563.md + - name: CS1564 + href: ./compiler-messages/cs1564.md + - name: CS1565 + href: ../misc/cs1565.md + - name: CS1566 + href: ../misc/cs1566.md + - name: CS1567 + href: ./compiler-messages/cs1567.md + - name: CS1569 + href: ../misc/cs1569.md + - name: CS1575 + href: ../misc/cs1575.md + - name: CS1576 + href: ../misc/cs1576.md + - name: CS1577 + href: ../misc/cs1577.md + - name: CS1578 + href: ../misc/cs1578.md + - name: CS1579 + href: ./compiler-messages/cs1579.md + - name: CS1583 + href: ../misc/cs1583.md + - name: CS1585 + href: ../misc/cs1585.md + - name: CS1588 + href: ../misc/cs1588.md + - name: CS1593 + href: ../misc/cs1593.md + - name: CS1594 + href: ../misc/cs1594.md + - name: CS1597 + href: ../misc/cs1597.md + - name: CS1599 + href: ../misc/cs1599.md + - name: CS1600 + href: ../misc/cs1600.md + - name: CS1601 + href: ../misc/cs1601.md + - name: CS1604 + href: ../misc/cs1604.md + - name: CS1606 + href: ../misc/cs1606.md + - name: CS1608 + href: ../misc/cs1608.md + - name: CS1609 + href: ../misc/cs1609.md + - name: CS1611 + href: ../misc/cs1611.md + - name: CS1612 + href: ./compiler-messages/cs1612.md + - name: CS1613 + href: ../misc/cs1613.md + - name: CS1614 + href: ./compiler-messages/cs1614.md + - name: CS1615 + href: ../misc/cs1615.md + - name: CS1617 + href: ../misc/cs1617.md + - name: CS1618 + href: ../misc/cs1618.md + - name: CS1619 + href: ../misc/cs1619.md + - name: CS1620 + href: ../misc/cs1620.md + - name: CS1622 + href: ../misc/cs1622.md + - name: CS1624 + href: ../misc/cs1624.md + - name: CS1625 + href: ../misc/cs1625.md + - name: CS1626 + href: ../misc/cs1626.md + - name: CS1627 + href: ../misc/cs1627.md + - name: CS1629 + href: ../misc/cs1629.md + - name: CS1630 + href: ../misc/cs1630.md + - name: CS1631 + href: ../misc/cs1631.md + - name: CS1637 + href: ../misc/cs1637.md + - name: CS1638 + href: ../misc/cs1638.md + - name: CS1639 + href: ../misc/cs1639.md + - name: CS1640 + href: ./compiler-messages/cs1640.md + - name: CS1641 + href: ../misc/cs1641.md + - name: CS1642 + href: ../misc/cs1642.md + - name: CS1643 + href: ../misc/cs1643.md + - name: CS1644 + href: ./compiler-messages/cs1644.md + - name: CS1646 + href: ../misc/cs1646.md + - name: CS1647 + href: ../misc/cs1647.md + - name: CS1648 + href: ../misc/cs1648.md + - name: CS1650 + href: ../misc/cs1650.md + - name: CS1654 + href: ../misc/cs1654.md + - name: CS1656 + href: ./compiler-messages/cs1656.md + - name: CS1660 + href: ../misc/cs1660.md + - name: CS1661 + href: ../misc/cs1661.md + - name: CS1662 + href: ../misc/cs1662.md + - name: CS1663 + href: ../misc/cs1663.md + - name: CS1664 + href: ../misc/cs1664.md + - name: CS1665 + href: ../misc/cs1665.md + - name: CS1666 + href: ../misc/cs1666.md + - name: CS1667 + href: ../misc/cs1667.md + - name: CS1670 + href: ../misc/cs1670.md + - name: CS1671 + href: ../misc/cs1671.md + - name: CS1672 + href: ../misc/cs1672.md + - name: CS1674 + href: ./compiler-messages/cs1674.md + - name: CS1675 + href: ../misc/cs1675.md + - name: CS1676 + href: ../misc/cs1676.md + - name: CS1677 + href: ../misc/cs1677.md + - name: CS1678 + href: ../misc/cs1678.md + - name: CS1679 + href: ../misc/cs1679.md + - name: CS1680 + href: ../misc/cs1680.md + - name: CS1681 + href: ../misc/cs1681.md + - name: CS1688 + href: ../misc/cs1688.md + - name: CS1689 + href: ../misc/cs1689.md + - name: CS1703 + href: ./compiler-messages/cs1703.md + - name: CS1705 + href: ./compiler-messages/cs1705.md + - name: CS1708 + href: ./compiler-messages/cs1708.md + - name: CS1713 + href: ../misc/cs1713.md + - name: CS1715 + href: ../misc/cs1715.md + - name: CS1716 + href: ./compiler-messages/cs1716.md + - name: CS1719 + href: ../misc/cs1719.md + - name: CS1721 + href: ./compiler-messages/cs1721.md + - name: CS1722 + href: ../misc/cs1722.md + - name: CS1724 + href: ../misc/cs1724.md + - name: CS1725 + href: ../misc/cs1725.md + - name: CS1726 + href: ./compiler-messages/cs1726.md + - name: CS1727 + href: ../misc/cs1727.md + - name: CS1728 + href: ../misc/cs1728.md + - name: CS1729 + href: ./compiler-messages/cs1729.md + - name: CS1730 + href: ../misc/cs1730.md + - name: CS1731 + href: ../misc/cs1731.md + - name: CS1732 + href: ../misc/cs1732.md + - name: CS1733 + href: ../misc/cs1733.md + - name: CS1736 + href: ./compiler-messages/cs1736.md + - name: CS1737 + href: ./compiler-messages/cs1737.md + - name: CS1750 + href: ./compiler-messages/cs1750.md + - name: CS1751 + href: ./compiler-messages/cs1751.md + - name: CS1763 + href: ./compiler-messages/cs1763.md + - name: CS1900 + href: ../misc/cs1900.md + - name: CS1902 + href: ../misc/cs1902.md + - name: CS1906 + href: ../misc/cs1906.md + - name: CS1908 + href: ../misc/cs1908.md + - name: CS1909 + href: ../misc/cs1909.md + - name: CS1910 + href: ../misc/cs1910.md + - name: CS1912 + href: ../misc/cs1912.md + - name: CS1913 + href: ../misc/cs1913.md + - name: CS1914 + href: ../misc/cs1914.md + - name: CS1917 + href: ../misc/cs1917.md + - name: CS1918 + href: ../misc/cs1918.md + - name: CS1919 + href: ./compiler-messages/cs1919.md + - name: CS1922 + href: ../misc/cs1922.md + - name: CS1926 + href: ./compiler-messages/cs1926.md + - name: CS1928 + href: ../misc/cs1928.md + - name: CS1929 + href: ../misc/cs1929.md + - name: CS1930 + href: ../misc/cs1930.md + - name: CS1931 + href: ../misc/cs1931.md + - name: CS1932 + href: ../misc/cs1932.md + - name: CS1933 + href: ./compiler-messages/cs1933.md + - name: CS1934 + href: ../misc/cs1934.md + - name: CS1935 + href: ../misc/cs1935.md + - name: CS1936 + href: ./compiler-messages/cs1936.md + - name: CS1937 + href: ../misc/cs1937.md + - name: CS1938 + href: ../misc/cs1938.md + - name: CS1940 + href: ../misc/cs1940.md + - name: CS1941 + href: ./compiler-messages/cs1941.md + - name: CS1942 + href: ./compiler-messages/cs1942.md + - name: CS1943 + href: ./compiler-messages/cs1943.md + - name: CS1947 + href: ../misc/cs1947.md + - name: CS1948 + href: ../misc/cs1948.md + - name: CS1949 + href: ../misc/cs1949.md + - name: CS1950 + href: ../misc/cs1950.md + - name: CS1955 + href: ../misc/cs1955.md + - name: CS1958 + href: ../misc/cs1958.md + - name: CS1959 + href: ../misc/cs1959.md + - name: CS1983 + href: ./compiler-messages/cs1983.md + - name: CS1986 + href: ./compiler-messages/cs1986.md + - name: CS1994 + href: ./compiler-messages/cs1994.md + - name: CS1996 + href: ./compiler-messages/cs1996.md + - name: CS1997 + href: ./compiler-messages/cs1997.md + - name: CS2001 + href: ../misc/cs2001.md + - name: CS2003 + href: ../misc/cs2003.md + - name: CS2005 + href: ../misc/cs2005.md + - name: CS2006 + href: ../misc/cs2006.md + - name: CS2007 + href: ../misc/cs2007.md + - name: CS2008 + href: ../misc/cs2008.md + - name: CS2011 + href: ../misc/cs2011.md + - name: CS2012 + href: ../misc/cs2012.md + - name: CS2013 + href: ../misc/cs2013.md + - name: CS2015 + href: ../misc/cs2015.md + - name: CS2016 + href: ../misc/cs2016.md + - name: CS2017 + href: ../misc/cs2017.md + - name: CS2018 + href: ../misc/cs2018.md + - name: CS2019 + href: ../misc/cs2019.md + - name: CS2020 + href: ../misc/cs2020.md + - name: CS2021 + href: ../misc/cs2021.md + - name: CS2022 + href: ../misc/cs2022.md + - name: CS2024 + href: ../misc/cs2024.md + - name: CS2032 + href: ./compiler-messages/cs2032.md + - name: CS2033 + href: ../misc/cs2033.md + - name: CS2034 + href: ../misc/cs2034.md + - name: CS2035 + href: ../misc/cs2035.md + - name: CS2036 + href: ../misc/cs2036.md + - name: CS4004 + href: ./compiler-messages/cs4004.md + - name: CS4008 + href: ./compiler-messages/cs4008.md + - name: CS4009 + href: ../misc/CS4009.md + - name: CS4013 + href: ./compiler-messages/cs4013.md + - name: CS4032 + href: ./compiler-messages/cs4032.md + - name: CS4033 + href: ./compiler-messages/cs4033.md + - name: CS5001 + href: ../misc/cs5001.md + - name: CS7003 + href: ./compiler-messages/cs7003.md + - name: CS8124 + href: ./compiler-messages/cs8124.md + - name: CS8125 + href: ./compiler-messages/cs8125.md + - name: CS8127 + href: ./compiler-messages/cs8127.md + - name: CS8129 + href: ./compiler-messages/cs8129.md + - name: CS8130 + href: ./compiler-messages/cs8130.md + - name: CS8131 + href: ./compiler-messages/cs8131.md + - name: CS8132 + href: ./compiler-messages/cs8132.md + - name: CS8139 + href: ./compiler-messages/cs8139.md + - name: CS8140 + href: ./compiler-messages/cs8140.md + - name: CS8141 + href: ./compiler-messages/cs8141.md + - name: CS8145 + href: ./compiler-messages/cs8145.md + - name: CS8146 + href: ./compiler-messages/cs8146.md + - name: CS8147 + href: ./compiler-messages/cs8147.md + - name: CS8148 + href: ./compiler-messages/cs8148.md + - name: CS8149 + href: ./compiler-messages/cs8149.md + - name: CS8150 + href: ./compiler-messages/cs8150.md + - name: CS8151 + href: ./compiler-messages/cs8151.md + - name: CS8152 + href: ./compiler-messages/cs8152.md + - name: CS8154 + href: ./compiler-messages/cs8154.md + - name: CS8156 + href: ./compiler-messages/cs8156.md + - name: CS8157 + href: ./compiler-messages/cs8157.md + - name: CS8158 + href: ./compiler-messages/cs8158.md + - name: CS8159 + href: ./compiler-messages/cs8159.md + - name: CS8160 + href: ./compiler-messages/cs8160.md + - name: CS8161 + href: ./compiler-messages/cs8161.md + - name: CS8162 + href: ./compiler-messages/cs8162.md + - name: CS8163 + href: ./compiler-messages/cs8163.md + - name: CS8170 + href: ./compiler-messages/cs8170.md + - name: CS8171 + href: ./compiler-messages/cs8171.md + - name: CS8172 + href: ./compiler-messages/cs8172.md + - name: CS8173 + href: ./compiler-messages/cs8173.md + - name: CS8174 + href: ./compiler-messages/cs8174.md + - name: CS8176 + href: ./compiler-messages/cs8176.md + - name: CS8177 + href: ./compiler-messages/cs8177.md + - name: CS8178 + href: ./compiler-messages/cs8178.md + - name: CS8210 + href: ./compiler-messages/cs8210.md + - name: CS8333 + href: ./compiler-messages/cs8333.md + - name: CS8334 + href: ./compiler-messages/cs8334.md + - name: CS8354 + href: ./compiler-messages/cs8354.md + - name: CS8355 + href: ./compiler-messages/cs8355.md + - name: CS8403 + href: ./compiler-messages/cs8403.md + - name: CS8410 + href: ./compiler-messages/cs8410.md + - name: CS8411 + href: ./compiler-messages/cs8411.md + - name: CS8422 + href: ./compiler-messages/cs8422.md + - name: CS8515 + href: ./compiler-messages/cs8515.md + - name: CS8795 + href: ./compiler-messages/CS8795.md + - name: CS8803 + href: ./compiler-messages/cs8803.md + - name: CS8812 + href: ./compiler-messages/cs8812.md + - name: CS8515 + href: ./compiler-messages/cs8515.md + - name: CS8817 + href: ./compiler-messages/CS8817.md + - name: CS9043 + href: ./compiler-messages/cs9043.md + - name: CS9050 + href: ./compiler-messages/cs9050.md + - name: Level 1 warning messages + items: + - name: CS0183 + href: ../misc/cs0183.md + - name: CS0184 + href: ../misc/cs0184.md + - name: CS0197 + href: ../misc/cs0197.md + - name: CS0420 + href: ./compiler-messages/cs0420.md + - name: CS0465 + href: ./compiler-messages/cs0465.md + - name: CS0602 + href: ../misc/cs0602.md + - name: CS0612 + href: ../misc/cs0612.md + - name: CS0626 + href: ../misc/cs0626.md + - name: CS0657 + href: ../misc/cs0657.md + - name: CS0658 + href: ../misc/cs0658.md + - name: CS0672 + href: ../misc/cs0672.md + - name: CS0684 + href: ../misc/cs0684.md + - name: CS0688 + href: ../misc/cs0688.md + - name: CS0809 + href: ../misc/cs0809.md + - name: CS1030 + href: ../misc/cs1030.md + - name: CS1058 + href: ./compiler-messages/cs1058.md + - name: CS1060 + href: ./compiler-messages/cs1060.md + - name: CS1200 + href: ../misc/cs1200.md + - name: CS1201 + href: ../misc/cs1201.md + - name: CS1202 + href: ../misc/cs1202.md + - name: CS1203 + href: ../misc/cs1203.md + - name: CS1522 + href: ../misc/cs1522.md + - name: CS1570 + href: ../misc/cs1570.md + - name: CS1574 + href: ../misc/cs1574.md + - name: CS1580 + href: ../misc/cs1580.md + - name: CS1581 + href: ../misc/cs1581.md + - name: CS1584 + href: ../misc/cs1584.md + - name: CS1589 + href: ../misc/cs1589.md + - name: CS1590 + href: ../misc/cs1590.md + - name: CS1592 + href: ../misc/cs1592.md + - name: CS1598 + href: ./compiler-messages/cs1598.md + - name: CS1607 + href: ./compiler-messages/cs1607.md + - name: CS1616 + href: ./compiler-messages/cs1616.md + - name: CS1633 + href: ../misc/cs1633.md + - name: CS1634 + href: ../misc/cs1634.md + - name: CS1635 + href: ../misc/cs1635.md + - name: CS1645 + href: ../misc/cs1645.md + - name: CS1658 + href: ./compiler-messages/cs1658.md + - name: CS1682 + href: ../misc/cs1682.md + - name: CS1684 + href: ../misc/cs1684.md + - name: CS1685 + href: ./compiler-messages/cs1685.md + - name: CS1687 + href: ../misc/cs1687.md + - name: CS1690 + href: ./compiler-messages/cs1690.md + - name: CS1691 + href: ./compiler-messages/cs1691.md + - name: CS1692 + href: ../misc/cs1692.md + - name: CS1694 + href: ../misc/cs1694.md + - name: CS1695 + href: ../misc/cs1695.md + - name: CS1696 + href: ../misc/cs1696.md + - name: CS1697 + href: ../misc/cs1697.md + - name: CS1699 + href: ./compiler-messages/cs1699.md + - name: CS1707 + href: ../misc/cs1707.md + - name: CS1709 + href: ../misc/cs1709.md + - name: CS1720 + href: ../misc/cs1720.md + - name: CS1723 + href: ../misc/cs1723.md + - name: CS1762 + href: ./compiler-messages/cs1762.md + - name: CS1911 + href: ../misc/cs1911.md + - name: CS1956 + href: ./compiler-messages/cs1956.md + - name: CS1957 + href: ../misc/cs1957.md + - name: CS2002 + href: ../misc/cs2002.md + - name: CS2014 + href: ../misc/cs2014.md + - name: CS2023 + href: ../misc/cs2023.md + - name: CS2029 + href: ../misc/cs2029.md + - name: CS3000 + href: ../misc/cs3000.md + - name: CS3001 + href: ../misc/cs3001.md + - name: CS3002 + href: ../misc/cs3002.md + - name: CS3003 + href: ./compiler-messages/cs3003.md + - name: CS3004 + href: ../misc/cs3004.md + - name: CS3005 + href: ../misc/cs3005.md + - name: CS3006 + href: ../misc/cs3006.md + - name: CS3008 + href: ../misc/cs3008.md + - name: CS3009 + href: ./compiler-messages/cs3009.md + - name: CS3010 + href: ../misc/cs3010.md + - name: CS3011 + href: ../misc/cs3011.md + - name: CS3012 + href: ../misc/cs3012.md + - name: CS3013 + href: ../misc/cs3013.md + - name: CS3014 + href: ../misc/cs3014.md + - name: CS3015 + href: ../misc/cs3015.md + - name: CS3017 + href: ../misc/cs3017.md + - name: CS3018 + href: ../misc/cs3018.md + - name: CS3022 + href: ../misc/cs3022.md + - name: CS3023 + href: ../misc/cs3023.md + - name: CS3024 + href: ../misc/cs3024.md + - name: CS3026 + href: ../misc/cs3026.md + - name: CS3027 + href: ../misc/cs3027.md + - name: CS4014 + href: ./compiler-messages/cs4014.md + - name: CS5000 + href: ../misc/cs5000.md + - name: Level 2 warning messages + items: + - name: CS0108 + href: ./compiler-messages/cs0108.md + - name: CS0114 + href: ../misc/cs0114.md + - name: CS0162 + href: ../misc/cs0162.md + - name: CS0164 + href: ../misc/cs0164.md + - name: CS0252 + href: ../misc/cs0252.md + - name: CS0253 + href: ../misc/cs0253.md + - name: CS0278 + href: ../misc/cs0278.md + - name: CS0279 + href: ../misc/cs0279.md + - name: CS0280 + href: ../misc/cs0280.md + - name: CS0435 + href: ../misc/cs0435.md + - name: CS0436 + href: ../misc/cs0436.md + - name: CS0437 + href: ../misc/cs0437.md + - name: CS0444 + href: ../misc/cs0444.md + - name: CS0458 + href: ../misc/cs0458.md + - name: CS0464 + href: ../misc/cs0464.md + - name: CS0467 + href: ./compiler-messages/cs0467.md + - name: CS0469 + href: ../misc/cs0469.md + - name: CS0472 + href: ../misc/cs0472.md + - name: CS0618 + href: ./compiler-messages/cs0618.md + - name: CS0652 + href: ../misc/cs0652.md + - name: CS0728 + href: ../misc/cs0728.md + - name: CS1571 + href: ../misc/cs1571.md + - name: CS1572 + href: ../misc/cs1572.md + - name: CS1587 + href: ../misc/cs1587.md + - name: CS1668 + href: ../misc/cs1668.md + - name: CS1698 + href: ../misc/cs1698.md + - name: CS1701 + href: ./compiler-messages/cs1701.md + - name: CS1710 + href: ../misc/cs1710.md + - name: CS1711 + href: ../misc/cs1711.md + - name: CS1927 + href: ../misc/cs1927.md + - name: CS3019 + href: ../misc/cs3019.md + - name: CS3021 + href: ../misc/cs3021.md + - name: Level 3 warning messages + items: + - name: CS0067 + href: ../misc/cs0067.md + - name: CS0168 + href: ../misc/cs0168.md + - name: CS0169 + href: ../misc/cs0169.md + - name: CS0219 + href: ../misc/cs0219.md + - name: CS0282 + href: ../misc/cs0282.md + - name: CS0414 + href: ../misc/cs0414.md + - name: CS0419 + href: ../misc/cs0419.md + - name: CS0642 + href: ../misc/cs0642.md + - name: CS0659 + href: ../misc/cs0659.md + - name: CS0660 + href: ../misc/cs0660.md + - name: CS0661 + href: ../misc/cs0661.md + - name: CS0665 + href: ../misc/cs0665.md + - name: CS0675 + href: ./compiler-messages/cs0675.md + - name: CS0693 + href: ../misc/cs0693.md + - name: CS1700 + href: ./compiler-messages/cs1700.md + - name: CS1702 + href: ../misc/cs1702.md + - name: CS1717 + href: ../misc/cs1717.md + - name: CS1718 + href: ../misc/cs1718.md + - name: Level 4 warning messages + items: + - name: CS0028 + href: ../misc/cs0028.md + - name: CS0078 + href: ../misc/cs0078.md + - name: CS0109 + href: ../misc/cs0109.md + - name: CS0402 + href: ../misc/cs0402.md + - name: CS0422 + href: ../misc/cs0422.md + - name: CS0429 + href: ./compiler-messages/cs0429.md + - name: CS0628 + href: ../misc/cs0628.md + - name: CS0649 + href: ../misc/cs0649.md + - name: CS1573 + href: ../misc/cs1573.md + - name: CS1591 + href: ./compiler-messages/cs1591.md + - name: CS1610 + href: ./compiler-messages/cs1610.md + - name: CS1712 + href: ../misc/cs1712.md diff --git a/docs/csharp/language-reference/tokens/index.md b/docs/csharp/language-reference/tokens/index.md index b47e62a8b152f..fe9b812842f18 100644 --- a/docs/csharp/language-reference/tokens/index.md +++ b/docs/csharp/language-reference/tokens/index.md @@ -22,7 +22,3 @@ Special characters are predefined, contextual characters that modify the program - [$](./interpolated.md), the interpolated string character. This section only includes those tokens that are not operators. See the [operators](../operators/index.md) section for all operators. - -## See also - -- [C# Reference](../index.md) diff --git a/docs/csharp/language-reference/tokens/interpolated.md b/docs/csharp/language-reference/tokens/interpolated.md index 38b8885eb5546..8947b2af6ed52 100644 --- a/docs/csharp/language-reference/tokens/interpolated.md +++ b/docs/csharp/language-reference/tokens/interpolated.md @@ -111,7 +111,6 @@ For more information, see the [Interpolated string expressions](~/_csharpstandar ## See also -- [C# reference](../index.md) - [C# special characters](index.md) - [Strings](../../programming-guide/strings/index.md) - [Standard numeric format strings](../../../standard/base-types/standard-numeric-format-strings.md) diff --git a/docs/csharp/language-reference/tokens/raw-string.md b/docs/csharp/language-reference/tokens/raw-string.md index f403a10ff491c..bc7121d65b877 100644 --- a/docs/csharp/language-reference/tokens/raw-string.md +++ b/docs/csharp/language-reference/tokens/raw-string.md @@ -36,7 +36,6 @@ Raw string literals were introduced in C# 11. ## See also -- [C# reference](../index.md) - [C# special characters](./index.md) - [C# string interpolation](./interpolated.md) - [Raw string literals feature specification](~/_csharplang/proposals/csharp-11.0/raw-string-literal.md) diff --git a/docs/csharp/language-reference/tokens/verbatim.md b/docs/csharp/language-reference/tokens/verbatim.md index 416743ba5bf41..a51819136cb3f 100644 --- a/docs/csharp/language-reference/tokens/verbatim.md +++ b/docs/csharp/language-reference/tokens/verbatim.md @@ -31,5 +31,4 @@ The `@` special character serves as a verbatim identifier. You use it in the fol ## See also -- [C# Reference](../index.md) - [C# Special Characters](./index.md) diff --git a/docs/csharp/linq/standard-query-operators/set-operations.md b/docs/csharp/linq/standard-query-operators/set-operations.md index 22b0c384d99b5..4e07462a50949 100644 --- a/docs/csharp/linq/standard-query-operators/set-operations.md +++ b/docs/csharp/linq/standard-query-operators/set-operations.md @@ -20,7 +20,7 @@ The following example depicts the behavior of the method is an alternative approach to `Except` that takes two sequences of possibly heterogenous types and a `keySelector`. The `keySelector` is the same type as the first collection's type. Consider the following `Teacher` array and teacher IDs to exclude. To find teachers in the first collection that aren't in the second collection, you can project the teacher's ID onto the second collection: -:::code source="snippets/standard-query-operators/SetOperations.cs" id="ExceptBy"::: +:::code language="csharp" source="snippets/standard-query-operators/SetOperations.cs" id="ExceptBy"::: In the preceding C# code: @@ -58,11 +58,11 @@ The following example depicts the behavior of method is an alternative approach to `Intersect` that takes two sequences of possibly heterogenous types and a `keySelector`. The `keySelector` is used as the comparative discriminator of the second collection's type. Consider the following student and teacher arrays. The query matches items in each sequence by name to find those students who aren't also teachers: -:::code source="./snippets/standard-query-operators/SetOperations.cs" id="IntersectBy"::: +:::code language="csharp" source="./snippets/standard-query-operators/SetOperations.cs" id="IntersectBy"::: In the preceding C# code: @@ -76,11 +76,11 @@ The following example depicts a union operation on two sequences of strings. The :::image type="content" source="./media/set-operations/union-operation-two-sequences.png" alt-text="Graphic showing the union of two sequences."::: -:::code language="csharp;" source="./snippets/standard-query-operators/SetOperations.cs" id="Union"::: +:::code language="csharp" source="./snippets/standard-query-operators/SetOperations.cs" id="Union"::: The method is an alternative approach to `Union` that takes two sequences of the same type and a `keySelector`. The `keySelector` is used as the comparative discriminator of the source type. The following query produces the list of all people that are either students or teachers. Students who are also teachers are added to the union set only once: -:::code source="./snippets/standard-query-operators/SetOperations.cs" id="UnionBy"::: +:::code language="csharp" source="./snippets/standard-query-operators/SetOperations.cs" id="UnionBy"::: In the preceding C# code: diff --git a/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md b/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md index fdda2fe7e456a..1c6586bc5442e 100644 --- a/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md +++ b/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md @@ -649,6 +649,6 @@ Provides a QA website for questions about and issues with Visual C#. ## See also -- [C# Reference](../language-reference/index.md) +- [C# Reference](../language-reference/index.yml) - [Visual Studio feedback options](/visualstudio/ide/feedback-options) - [Additional Resources for Visual C# Programmers](../tour-of-csharp/index.md) diff --git a/docs/csharp/programming-guide/classes-and-structs/implicitly-typed-local-variables.md b/docs/csharp/programming-guide/classes-and-structs/implicitly-typed-local-variables.md index aeb08430a4d14..01fd7f38473fb 100644 --- a/docs/csharp/programming-guide/classes-and-structs/implicitly-typed-local-variables.md +++ b/docs/csharp/programming-guide/classes-and-structs/implicitly-typed-local-variables.md @@ -87,7 +87,7 @@ The use of `var` helps simplify your code, but its use should be restricted to c ## See also -- [C# Reference](../../language-reference/index.md) +- [C# Reference](../../language-reference/index.yml) - [Implicitly Typed Arrays](../../language-reference/builtin-types/arrays.md#implicitly-typed-arrays) - [How to use implicitly typed local variables and arrays in a query expression](how-to-use-implicitly-typed-local-variables-and-arrays-in-a-query-expression.md) - [Anonymous Types](../../fundamentals/types/anonymous-types.md) diff --git a/docs/csharp/programming-guide/classes-and-structs/named-and-optional-arguments.md b/docs/csharp/programming-guide/classes-and-structs/named-and-optional-arguments.md index 08434f3c5d35b..acf6dbd9c4655 100644 --- a/docs/csharp/programming-guide/classes-and-structs/named-and-optional-arguments.md +++ b/docs/csharp/programming-guide/classes-and-structs/named-and-optional-arguments.md @@ -111,7 +111,7 @@ The preceding code shows a number of examples where optional parameters aren't a ## Caller infomation attributes -[Caller information attributes](/dotnet/csharp/language-reference/attributes/caller-information), such as , , , and , are used to obtain information about the caller to a method. These attributes are especially useful when you're debugging or when you need to log information about method calls. +[Caller information attributes](../../language-reference/attributes/caller-information.md), such as , , , and , are used to obtain information about the caller to a method. These attributes are especially useful when you're debugging or when you need to log information about method calls. These attributes are optional parameters with default values provided by the compiler. The caller should not explicitly provide a value for these parameters. diff --git a/docs/csharp/specification/index.yml b/docs/csharp/specification/index.yml new file mode 100644 index 0000000000000..9de1b263b6728 --- /dev/null +++ b/docs/csharp/specification/index.yml @@ -0,0 +1,104 @@ +### YamlMime:Landing + +title: "C# specifications" +summary: "Read the detailed specification for the C# language and the detailed specifications for the latest features." + +metadata: + title: "C# specifications - ECMA specification and latest features." + description: "Read the detailed specifications for the C# language and the latest features. The specifications are the definitive source for the behavior of the C# language." + ms.topic: landing-page # Required + ms.date: 03/12/2024 + +landingContent: + - title: "ECMA specifications and latest features" + linkLists: + - linkListType: overview + links: + - text: Specification process + url: ./overview.md + - text: Detailed ECMA specification contents + url: ../../../_csharpstandard/standard/README.md + - linkListType: reference + links: + - text: Latest feature specifications + url: ../../../_csharplang/proposals/csharp-10.0/enhanced-line-directives.md + + + - title: "Draft C# ECMA specification - Introductory material" + linkLists: + - linkListType: reference + links: + - text: Foreword + url: ../../../_csharpstandard/standard/foreword.md + - text: Introduction + url: ../../../_csharpstandard/standard/introduction.md + - linkListType: reference + links: + - text: Scope + url: ../../../_csharpstandard/standard/scope.md + - text: Normative references + url: ../../../_csharpstandard/standard/normative-references.md + - text: Terms and definitions + url: ../../../_csharpstandard/standard/terms-and-definitions.md + - text: General description + url: ../../../_csharpstandard/standard/general-description.md + - text: Conformance + url: ../../../_csharpstandard/standard/conformance.md + + - title: "Draft C# ECMA specification - Language specification" + linkLists: + - linkListType: reference + links: + - text: Lexical structure + url: ../../../_csharpstandard/standard/lexical-structure.md + - text: Basic concepts + url: ../../../_csharpstandard/standard/basic-concepts.md + - text: Types + url: ../../../_csharpstandard/standard/types.md + - text: Variables + url: ../../../_csharpstandard/standard/variables.md + - text: Conversions + url: ../../../_csharpstandard/standard/conversions.md + - text: Patterns + url: ../../../_csharpstandard/standard/patterns.md + - text: Expressions + url: ../../../_csharpstandard/standard/expressions.md + - text: Statements + url: ../../../_csharpstandard/standard/statements.md + - linkListType: reference + links: + - text: Namespaces + url: ../../../_csharpstandard/standard/namespaces.md + - text: Classes + url: ../../../_csharpstandard/standard/classes.md + - text: Structs + url: ../../../_csharpstandard/standard/structs.md + - text: Arrays + url: ../../../_csharpstandard/standard/arrays.md + - text: Interfaces + url: ../../../_csharpstandard/standard/interfaces.md + - text: Enums + url: ../../../_csharpstandard/standard/enums.md + - text: Delegates + url: ../../../_csharpstandard/standard/delegates.md + - text: Exceptions + url: ../../../_csharpstandard/standard/exceptions.md + - text: Attributes + url: ../../../_csharpstandard/standard/attributes.md + - text: Unsafe code + url: ../../../_csharpstandard/standard/unsafe-code.md + + - title: "Draft C# ECMA specification - Annexes" + linkLists: + - linkListType: reference + links: + - text: Grammar + url: ../../../_csharpstandard/standard/grammar.md + - text: Portability issues + url: ../../../_csharpstandard/standard/portability-issues.md + - text: Standard library + url: ../../../_csharpstandard/standard/standard-library.md + - text: Documentation comments + url: ../../../_csharpstandard/standard/documentation-comments.md + - text: Bibliography + url: ../../../_csharpstandard/standard/bibliography.md diff --git a/docs/csharp/language-reference/specifications.md b/docs/csharp/specification/overview.md similarity index 100% rename from docs/csharp/language-reference/specifications.md rename to docs/csharp/specification/overview.md diff --git a/docs/csharp/specification/toc.yml b/docs/csharp/specification/toc.yml new file mode 100644 index 0000000000000..0239cf6c46153 --- /dev/null +++ b/docs/csharp/specification/toc.yml @@ -0,0 +1,222 @@ +items: +- name: C# specifications + href: index.yml + items: + - name: Overview + href: overview.md + - name: C# 8 draft specification + items: + - name: Detailed table of contents + href: ../../../_csharpstandard/standard/README.md + - name: Foreword + href: ../../../_csharpstandard/standard/foreword.md + - name: Introduction + href: ../../../_csharpstandard/standard/introduction.md + - name: Scope + href: ../../../_csharpstandard/standard/scope.md + - name: Normative references + href: ../../../_csharpstandard/standard/normative-references.md + - name: Terms and definitions + href: ../../../_csharpstandard/standard/terms-and-definitions.md + - name: General description + href: ../../../_csharpstandard/standard/general-description.md + - name: Conformance + href: ../../../_csharpstandard/standard/conformance.md + - name: Lexical structure + href: ../../../_csharpstandard/standard/lexical-structure.md + - name: Basic concepts + href: ../../../_csharpstandard/standard/basic-concepts.md + - name: Types + href: ../../../_csharpstandard/standard/types.md + - name: Variables + href: ../../../_csharpstandard/standard/variables.md + - name: Conversions + href: ../../../_csharpstandard/standard/conversions.md + - name: Patterns + href: ../../../_csharpstandard/standard/patterns.md + - name: Expressions + href: ../../../_csharpstandard/standard/expressions.md + - name: Statements + href: ../../../_csharpstandard/standard/statements.md + - name: Namespaces + href: ../../../_csharpstandard/standard/namespaces.md + - name: Classes + href: ../../../_csharpstandard/standard/classes.md + - name: Structs + href: ../../../_csharpstandard/standard/structs.md + - name: Arrays + href: ../../../_csharpstandard/standard/arrays.md + - name: Interfaces + href: ../../../_csharpstandard/standard/interfaces.md + - name: Enums + href: ../../../_csharpstandard/standard/enums.md + - name: Delegates + href: ../../../_csharpstandard/standard/delegates.md + - name: Exceptions + href: ../../../_csharpstandard/standard/exceptions.md + - name: Attributes + href: ../../../_csharpstandard/standard/attributes.md + - name: Unsafe code + href: ../../../_csharpstandard/standard/unsafe-code.md + - name: Grammar + href: ../../../_csharpstandard/standard/grammar.md + - name: Portability issues + href: ../../../_csharpstandard/standard/portability-issues.md + - name: Standard library + href: ../../../_csharpstandard/standard/standard-library.md + - name: Documentation comments + href: ../../../_csharpstandard/standard/documentation-comments.md + - name: Bibliography + href: ../../../_csharpstandard/standard/bibliography.md + - name: Feature specifications + items: + - name: Lexical structure + items: + - name: "Enhanced #line directives" + href: ../../../_csharplang/proposals/csharp-10.0/enhanced-line-directives.md + - name: Basic concepts + items: + - name: Top-level statements + href: ../../../_csharplang/proposals/csharp-9.0/top-level-statements.md + - name: Module initializers + href: ../../../_csharplang/proposals/csharp-9.0/module-initializers.md + - name: Suppress emitting localsinit flag + href: ../../../_csharplang/proposals/csharp-9.0/skip-localsinit.md + - name: Types + items: + - name: Nullable reference types - proposal + href: ../../../_csharplang/proposals/csharp-8.0/nullable-reference-types.md + - name: Nullable reference types - specification + href: ../../../_csharplang/proposals/csharp-9.0/nullable-reference-types-specification.md + - name: Records + href: ../../../_csharplang/proposals/csharp-9.0/records.md + - name: Record structs + href: ../../../_csharplang/proposals/csharp-10.0/record-structs.md + - name: File local types + href: ../../../_csharplang/proposals/csharp-11.0/file-local-types.md + - name: Unconstrained type parameter annotations + href: ../../../_csharplang/proposals/csharp-9.0/unconstrained-type-parameter-annotations.md + - name: Improved interpolated strings + href: ../../../_csharplang/proposals/csharp-10.0/improved-interpolated-strings.md + - name: Constant interpolated strings + href: ../../../_csharplang/proposals/csharp-10.0/constant_interpolated_strings.md + - name: Raw string literals + href: ../../../_csharplang/proposals/csharp-11.0/raw-string-literal.md + - name: Interpolated string newline + href: ../../../_csharplang/proposals/csharp-11.0/new-line-in-interpolation.md + - name: UTF-8 string literals + href: ../../../_csharplang/proposals/csharp-11.0/utf8-string-literals.md + - name: Native sized integers + href: ../../../_csharplang/proposals/csharp-9.0/native-integers.md + - name: Numeric IntPtr + href: ../../../_csharplang/proposals/csharp-11.0/numeric-intptr.md + - name: Variables + items: + - name: Improved definite assignment analysis + href: ../../../_csharplang/proposals/csharp-10.0/improved-definite-assignment.md + - name: Ref readonly parameters + href: ../../../_csharplang/proposals/csharp-12.0/ref-readonly-parameters.md + - name: Patterns + items: + - name: Recursive pattern matching + href: ../../../_csharplang/proposals/csharp-8.0/patterns.md + - name: Pattern matching enhancements + href: ../../../_csharplang/proposals/csharp-9.0/patterns3.md + - name: Extended property patterns + href: ../../../_csharplang/proposals/csharp-10.0/extended-property-patterns.md + - name: Pattern match span + href: ../../../_csharplang/proposals/csharp-11.0/pattern-match-span-of-char-on-string.md + - name: List patterns + href: ../../../_csharplang/proposals/csharp-11.0/list-patterns.md + - name: Expressions + items: + - name: Ranges + href: ../../../_csharplang/proposals/csharp-8.0/ranges.md + - name: Null coalescing assignment + href: ../../../_csharplang/proposals/csharp-8.0/null-coalescing-assignment.md + - name: Target-typed new expressions + href: ../../../_csharplang/proposals/csharp-9.0/target-typed-new.md + - name: Target-typed conditional expression + href: ../../../_csharplang/proposals/csharp-9.0/target-typed-conditional-expression.md + - name: Extension GetEnumerator in foreach loops + href: ../../../_csharplang/proposals/csharp-9.0/extension-getenumerator.md + - name: Collection expressions + href: ../../../_csharplang/proposals/csharp-12.0/collection-expressions.md + - name: Lambda discard parameters + href: ../../../_csharplang/proposals/csharp-9.0/lambda-discard-parameters.md + - name: Static anonymous functions + href: ../../../_csharplang/proposals/csharp-9.0/static-anonymous-functions.md + - name: Function pointers + href: ../../../_csharplang/proposals/csharp-9.0/function-pointers.md + - name: Lambda improvements + href: ../../../_csharplang/proposals/csharp-10.0/lambda-improvements.md + - name: Method group natural type conversion + href: ../../../_csharplang/proposals/method-group-natural-type-improvements.md + - name: Optional Lambda expression parameters + href: ../../../_csharplang/proposals/csharp-12.0/lambda-method-group-defaults.md + - name: Checked user-defined operators + href: ../../../_csharplang/proposals/csharp-11.0/checked-user-defined-operators.md + - name: Unsigned right-shift operator + href: ../../../_csharplang/proposals/csharp-11.0/unsigned-right-shift-operator.md + - name: Relaxing shift operator + href: ../../../_csharplang/proposals/csharp-11.0/relaxing_shift_operator_requirements.md + - name: Caller argument expression + href: ../../../_csharplang/proposals/csharp-10.0/caller-argument-expression.md + - name: Extended nameof scope + href: ../../../_csharplang/proposals/csharp-11.0/extended-nameof-scope.md + - name: Statements + items: + - name: Global using directive + href: ../../../_csharplang/proposals/csharp-10.0/GlobalUsingDirective.md + - name: Alias any type + href: ../../../_csharplang/proposals/csharp-12.0/using-alias-types.md + - name: Attributes on local functions + href: ../../../_csharplang/proposals/csharp-9.0/local-function-attributes.md + - name: Pattern based using and using declarations + href: ../../../_csharplang/proposals/csharp-8.0/using.md + - name: Async streams + href: ../../../_csharplang/proposals/csharp-8.0/async-streams.md + - name: Nested stackalloc + href: ../../../_csharplang/proposals/csharp-8.0/nested-stackalloc.md + - name: Namespaces + items: + - name: File scoped namespaces + href: ../../../_csharplang/proposals/csharp-10.0/file-scoped-namespaces.md + - name: Classes + items: + - name: Extending partial methods + href: ../../../_csharplang/proposals/csharp-9.0/extending-partial-methods.md + - name: Covariant return types + href: ../../../_csharplang/proposals/csharp-9.0/covariant-returns.md + - name: Primary constructors + href: ../../../_csharplang/proposals/csharp-12.0/primary-constructors.md + - name: Init only setters + href: ../../../_csharplang/proposals/csharp-9.0/init.md + - name: Required members + href: ../../../_csharplang/proposals/csharp-11.0/required-members.md + - name: AsyncMethodBuilder override + href: ../../../_csharplang/proposals/csharp-10.0/async-method-builders.md + - name: Structs + items: + - name: Readonly instance members + href: ../../../_csharplang/proposals/csharp-8.0/readonly-instance-members.md + - name: Parameterless struct constructors + href: ../../../_csharplang/proposals/csharp-10.0/parameterless-struct-constructors.md + - name: Auto-default struct + href: ../../../_csharplang/proposals/csharp-11.0/auto-default-structs.md + - name: Low-level struct improvements + href: ../../../_csharplang/proposals/csharp-11.0/low-level-struct-improvements.md + - name: Inline arrays + href: ../../../_csharplang/proposals/csharp-12.0/inline-arrays.md + - name: Interfaces + items: + - name: Default interface methods + 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: Attributes + items: + - name: Generic attributes + href: ../../../_csharplang/proposals/csharp-11.0/generic-attributes.md + - name: Experimental attribute + href: ../../../_csharplang/proposals/csharp-12.0/experimental-attribute.md diff --git a/docs/csharp/toc.yml b/docs/csharp/toc.yml index 2b1b43dc1e8ec..b6fe30d2b728d 100644 --- a/docs/csharp/toc.yml +++ b/docs/csharp/toc.yml @@ -726,653 +726,3 @@ items: href: programming-guide/generics/differences-between-cpp-templates-and-csharp-generics.md - name: Generics in the Run Time href: programming-guide/generics/generics-in-the-run-time.md -- name: Language reference - items: - - name: Overview - displayName: language reference - href: language-reference/index.md - - name: Configure language version - href: language-reference/configure-language-version.md - - name: Types - items: - - name: Value types - items: - - name: Overview - href: language-reference/builtin-types/value-types.md - displayName: "value types, simple types" - - name: Integral numeric types - href: language-reference/builtin-types/integral-numeric-types.md - displayName: sbyte, byte, short, ushort, int, uint, nint, nuint, long, ulong, integer, literal - - name: Floating-point numeric types - href: language-reference/builtin-types/floating-point-numeric-types.md - displayName: float, decimal, double, rational, real, literal - - name: Built-in numeric conversions - href: language-reference/builtin-types/numeric-conversions.md - - name: bool - href: language-reference/builtin-types/bool.md - displayName: "Boolean, true, false" - - name: char - href: language-reference/builtin-types/char.md - displayName: "Unicode, character, UTF-16" - - name: Enumeration types - href: language-reference/builtin-types/enum.md - displayName: "enum, bit flags, bit field" - - name: Struct types - href: language-reference/builtin-types/struct.md - displayName: "struct type, readonly struct, ref struct, readonly ref struct" - - name: Ref struct types - href: language-reference/builtin-types/ref-struct.md - displayName: "ref struct, readonly ref struct" - - name: Tuple types - href: language-reference/builtin-types/value-tuples.md - displayName: "value tuples, ValueTuple" - - name: Nullable value types - href: language-reference/builtin-types/nullable-value-types.md - displayName: "? token, ? symbol" - - name: Reference types - items: - - name: Features of reference types - href: language-reference/keywords/reference-types.md - - name: Built-in reference types - displayName: object, delegate, dynamic, string - href: language-reference/builtin-types/reference-types.md - - name: record - href: language-reference/builtin-types/record.md - - name: class - href: language-reference/keywords/class.md - - name: interface - href: language-reference/keywords/interface.md - - name: Nullable reference types - href: language-reference/builtin-types/nullable-reference-types.md - displayName: "? token, ? symbol" - - name: Collections and arrays - items: - - name: Collections - href: language-reference/builtin-types/collections.md - - name: Arrays - href: language-reference/builtin-types/arrays.md - - name: void - href: language-reference/builtin-types/void.md - - name: Built-in types - href: language-reference/builtin-types/built-in-types.md - - name: Unmanaged types - href: language-reference/builtin-types/unmanaged-types.md - - name: Default values - href: language-reference/builtin-types/default-values.md - - name: Keywords - items: - - name: Overview - displayName: keywords, contextual keywords - href: language-reference/keywords/index.md - - name: Modifiers - items: - - name: Access Modifiers - items: - - name: Quick reference - href: language-reference/keywords/access-modifiers.md - - name: Accessibility Levels - href: language-reference/keywords/accessibility-levels.md - - name: Accessibility Domain - href: language-reference/keywords/accessibility-domain.md - - name: Restrictions on Using Accessibility Levels - href: language-reference/keywords/restrictions-on-using-accessibility-levels.md - - name: internal - href: language-reference/keywords/internal.md - - name: private - href: language-reference/keywords/private.md - - name: protected - href: language-reference/keywords/protected.md - - name: public - href: language-reference/keywords/public.md - - name: protected internal - href: language-reference/keywords/protected-internal.md - - name: private protected - href: language-reference/keywords/private-protected.md - - name: file - href: language-reference/keywords/file.md - - name: abstract - href: language-reference/keywords/abstract.md - - name: async - href: language-reference/keywords/async.md - displayName: await - - name: const - href: language-reference/keywords/const.md - - name: event - href: language-reference/keywords/event.md - - name: extern - href: language-reference/keywords/extern.md - - name: in (generic modifier) - href: language-reference/keywords/in-generic-modifier.md - - name: new (member modifier) - href: language-reference/keywords/new-modifier.md - - name: out (generic modifier) - href: language-reference/keywords/out-generic-modifier.md - - name: override - href: language-reference/keywords/override.md - - name: readonly - href: language-reference/keywords/readonly.md - - name: sealed - href: language-reference/keywords/sealed.md - - name: static - href: language-reference/keywords/static.md - - name: unsafe - href: language-reference/keywords/unsafe.md - - name: virtual - href: language-reference/keywords/virtual.md - - name: volatile - href: language-reference/keywords/volatile.md - - name: Statement Keywords - href: language-reference/keywords/statement-keywords.md - - name: Method Parameters - displayName: ref, in, out, params, reference parameter, value parameter, ref readonly - href: language-reference/keywords/method-parameters.md - - name: Namespace Keywords - items: - - name: namespace - href: language-reference/keywords/namespace.md - - name: using directive - href: language-reference/keywords/using-directive.md - - name: extern alias - href: language-reference/keywords/extern-alias.md - - name: Generic Type Constraint Keywords - items: - - name: new constraint - href: language-reference/keywords/new-constraint.md - - name: where - href: language-reference/keywords/where-generic-type-constraint.md - - name: Access Keywords - items: - - name: base - href: language-reference/keywords/base.md - - name: this - href: language-reference/keywords/this.md - - name: Literal Keywords - items: - - name: "null" - href: language-reference/keywords/null.md - - name: "true and false" - href: language-reference/builtin-types/bool.md - - name: default - href: language-reference/keywords/default.md - - name: Contextual Keywords - items: - - name: add - href: language-reference/keywords/add.md - - name: get - href: language-reference/keywords/get.md - - name: init - href: language-reference/keywords/init.md - - name: partial (Type) - href: language-reference/keywords/partial-type.md - - name: partial (Method) - href: language-reference/keywords/partial-method.md - - name: remove - href: language-reference/keywords/remove.md - - name: required - href: language-reference/keywords/required.md - - name: set - href: language-reference/keywords/set.md - - name: when (filter condition) - href: language-reference/keywords/when.md - - name: value - href: language-reference/keywords/value.md - - name: Query Keywords - items: - - name: Quick reference - displayName: query keywords - href: language-reference/keywords/query-keywords.md - - name: from clause - href: language-reference/keywords/from-clause.md - - name: where clause - href: language-reference/keywords/where-clause.md - - name: select clause - href: language-reference/keywords/select-clause.md - - name: group clause - href: language-reference/keywords/group-clause.md - - name: into - href: language-reference/keywords/into.md - - name: orderby clause - href: language-reference/keywords/orderby-clause.md - - name: join clause - href: language-reference/keywords/join-clause.md - - name: let clause - href: language-reference/keywords/let-clause.md - - name: ascending - href: language-reference/keywords/ascending.md - - name: descending - href: language-reference/keywords/descending.md - - name: "on" - href: language-reference/keywords/on.md - - name: equals - href: language-reference/keywords/equals.md - - name: by - href: language-reference/keywords/by.md - - name: in - href: language-reference/keywords/in.md - - name: Operators and expressions - items: - - name: Overview - href: language-reference/operators/index.md - displayName: operator precedence, operator associativity, expressions - - name: Arithmetic operators - href: language-reference/operators/arithmetic-operators.md - displayName: ++, --, +, -, *, /, %, +=, -=, *=, /=, %=, checked, unchecked - - name: Boolean logical operators - href: language-reference/operators/boolean-logical-operators.md - displayName: "!, &&, ||, &, |, ^, &=, |=, ^=, AND, XOR, OR" - - name: Bitwise and shift operators - href: language-reference/operators/bitwise-and-shift-operators.md - displayName: "~, &, |, ^, <<, >>, &=, |=, ^=, <<=, >>=, AND, XOR, OR" - - name: Collection expressions - displayName: Collection literal, ".. token", ".. symbol", "[] token", "[] symbol" - href: language-reference/operators/collection-expressions.md - - name: Equality operators - href: language-reference/operators/equality-operators.md - displayName: ==, != - - name: Comparison operators - href: language-reference/operators/comparison-operators.md - displayName: ">, <, >=, <=, greater, less" - - name: Member access and null-conditional operators and expressions - href: language-reference/operators/member-access-operators.md - displayName: "., [], ?., ?[], (), indexer, null-conditional, Elvis, invocation, ^, index from end, hat, .., range" - - name: Type-testing operators and cast expression - href: language-reference/operators/type-testing-and-cast.md - displayName: "is operator, is keyword, as operator, as keyword, typeof, (), explicit, conversion" - - name: User-defined conversion operators - href: language-reference/operators/user-defined-conversion-operators.md - displayName: implicit, explicit - - name: Pointer-related operators - href: language-reference/operators/pointer-related-operators.md - displayName: "&, *, ->, [], +, -, ++, --, ==, !=, <, >, <=, >=, dereference, address-of, indirection" - - name: Assignment operators - href: language-reference/operators/assignment-operator.md - displayName: "=, ref, compound" - - name: Lambda expressions - href: language-reference/operators/lambda-expressions.md - displayName: anonymous functions - - name: Patterns - href: language-reference/operators/patterns.md - displayName: pattern matching, and keyword, or keyword, not keyword, pattern reference - - name: + and += operators - href: language-reference/operators/addition-operator.md - displayName: string concatenation, delegate combination, event subscription - - name: "- and -= operators" - href: language-reference/operators/subtraction-operator.md - displayName: delegate removal, event unsubscription - - name: "?: operator" - href: language-reference/operators/conditional-operator.md - displayName: conditional, ternary, ref - - name: "! (null-forgiving) operator" - href: language-reference/operators/null-forgiving.md - displayName: nullable reference, null-forgiveness, null suppression - - name: "?? and ??= operators" - href: language-reference/operators/null-coalescing-operator.md - displayName: null-coalescing, assignment - - name: => operator - href: language-reference/operators/lambda-operator.md - displayName: lambda, expression body definition - - name: ":: operator" - href: language-reference/operators/namespace-alias-qualifier.md - displayName: "namespace alias qualifier, global namespace" - - name: await operator - href: language-reference/operators/await.md - displayName: async - - name: default value expressions - href: language-reference/operators/default.md - displayName: default value, default operator, default literal, type default - - name: delegate operator - href: language-reference/operators/delegate-operator.md - displayName: anonymous - - name: is operator - href: language-reference/operators/is.md - displayName: pattern matching - - name: nameof expression - href: language-reference/operators/nameof.md - displayName: nameof operator - - name: new operator - href: language-reference/operators/new-operator.md - displayName: constructor - - name: sizeof operator - href: language-reference/operators/sizeof.md - - name: stackalloc expression - href: language-reference/operators/stackalloc.md - displayName: stack allocation, span, stackalloc operator - - name: switch expression - href: language-reference/operators/switch-expression.md - displayName: pattern matching, patterns, when - - name: true and false operators - href: language-reference/operators/true-false-operators.md - - name: with expression - href: language-reference/operators/with-expression.md - displayName: "records, copy" - - name: Operator overloading - href: language-reference/operators/operator-overloading.md - - name: Statements - items: - - name: Declaration statements - displayName: var, ref, const, local, by-reference - href: language-reference/statements/declarations.md - - name: Exception-handling statements - displayName: throw, try, catch, finally, when, error, fault - href: language-reference/statements/exception-handling-statements.md - - name: Iteration statements - displayName: for, foreach, do, while, loop - href: language-reference/statements/iteration-statements.md - - name: Selection statements - displayName: if, else, switch, case, when - href: language-reference/statements/selection-statements.md - - name: Jump statements - displayName: break, continue, goto, return - href: language-reference/statements/jump-statements.md - - name: checked and unchecked statements - displayName: overflow checking - href: language-reference/statements/checked-and-unchecked.md - - name: fixed statement - displayName: pin, pinned - href: language-reference/statements/fixed.md - - name: lock statement - displayName: thread synchronization, monitor - href: language-reference/statements/lock.md - - name: using statement - displayName: dispose, disposable, await using, using declaration - href: language-reference/statements/using.md - - name: yield statement - displayName: iterator, yield break, yield return - href: language-reference/statements/yield.md - - name: Special characters - items: - - name: Overview - displayName: special characters - href: language-reference/tokens/index.md - - name: Comments - displayName: /* */, // - href: language-reference/tokens/comments.md - - name: $ -- string interpolation - href: language-reference/tokens/interpolated.md - - name: "@ -- verbatim identifier" - href: language-reference/tokens/verbatim.md - - name: "\"\"\" -- raw string literal" - href: language-reference/tokens/raw-string.md - - name: Attributes read by the compiler - items: - - name: Global attributes - displayName: AssemblyName, AssemblyVersion, AssemblyCulture, AssemblyFlags, AssemblyProduct, AssemblyTrademark, AssemblyInformationalVersion, AssemblyCompany, AssemblyCopyright, AssemblyFileVersion, CLSCompliant, AssemblyTitle, AssemblyDescription, AssemblyConfiguration, AssemblyDefaultAlias - href: language-reference/attributes/global.md - - name: Caller information - displayName: CallerFilePath, CallerLineNumber, CallerMemberName - href: language-reference/attributes/caller-information.md - - name: Nullable static analysis - displayName: AllowNull, DisallowNull, MaybeNull, NotNull, MaybeNullWhen, NotNullWhen, NotNullIfNotNull, DoesNotReturn, DoesNotReturnIf - href: language-reference/attributes/nullable-analysis.md - - name: Miscellaneous - displayName: Conditional, Obsolete, Experimental, SetsRequiredMembers, AttributeUsage, ModuleInitializer, SkipLocalsInit, module initializer - href: language-reference/attributes/general.md - - name: Unsafe code and pointers - displayName: unsafe code, pointers, fixed size buffer, function pointer - href: language-reference/unsafe-code.md - - name: Preprocessor directives - href: language-reference/preprocessor-directives.md - displayName: \#if, \#else, \#elif, \#endif, \#define, \#undef, \#warning, \#error, \#line, \#nullable, \#region, \#endregion, \#pragma, warning, checksum - - name: Compiler options - items: - - name: Overview - href: language-reference/compiler-options/index.md - - name: Language options - displayName: CheckForOverflowUnderflow, checked, AllowUnsafeBlocks, unsafe, DefineConstants, define, LangVersion, langversion, Nullable, nullable - href: language-reference/compiler-options/language.md - - name: Output options - displayName: DocumentationFile, doc, OutputAssembly, out, PlatformTarget, platform, ProduceReferenceAssembly, refout, TargetType, target, - href: language-reference/compiler-options/output.md - - name: Input options - displayName: References, reference, references, AddModules, addmodule, EmbedInteropTypes, link - href: language-reference/compiler-options/inputs.md - - name: Error and warning options - displayName: WarningLevel, warn, TreatWarningsAsErrors, warnaserror, WarningsAsErrors, WarningsNotAsErrors, DisabledWarnings, nowarn, CodeAnalysisRuleSet, ruleset, ErrorLog, errorlog, ReportAnalyzer, reportanalyzer - href: language-reference/compiler-options/errors-warnings.md - - name: Code generation options - displayName: DebugType, debug, Optimize, optimize, Deterministic, deterministic, ProduceOnlyReferenceAssembly, refonly - href: language-reference/compiler-options/code-generation.md - - name: Security options - displayName: DelaySign, delaysign, KeyFile, keyfile, KeyContainer, keycontainer, PublicSign, publicsign, highentropyva, HighEntropyVA - href: language-reference/compiler-options/security.md - - name: Resources options - displayName: Win32Resource, win32res, Win32Icon, win32icon, Win32Manifest, win32manifest, NoWin32Manifest, nowin32manifest, Resources, resource, LinkResources - href: language-reference/compiler-options/resources.md - - name: Miscellaneous options - displayName: ResponseFiles, @, NoLogo, nologo, NoConfig, noconfig - href: language-reference/compiler-options/miscellaneous.md - - name: Advanced options - displayName: MainEntryPoint, StartupObject, main, PdbFile, pdb, PathMap, pathmap, ApplicationConfiguration, appconfig, AdditionalLibPaths, lib, GenerateFullPaths, fullpath, PreferredUILang, preferreduilang, BaseAddress, baseaddress, ChecksumAlgorithm, checksumalgorithm, CodePage, codepage, Utf8Output, utf8output, FileAlignment, filealign, ErrorEndLocation, errorendlocation, NoStandardLib, nostdlib, SubsystemVersion, subsystemversion, ModuleAssemblyName, moduleassemblyname - href: language-reference/compiler-options/advanced.md - - name: XML documentation comments - items: - - name: Generate API documentation - href: language-reference/xmldoc/index.md - - name: Recommended tags - href: language-reference/xmldoc/recommended-tags.md - - name: Examples - href: language-reference/xmldoc/examples.md - - name: Compiler messages - href: language-reference/compiler-messages/index.md -- name: C# Specifications - items: - - name: Overview - href: language-reference/specifications.md - - name: Draft specification (ECMA C# 8) - items: - - name: Detailed table of contents - href: ../../_csharpstandard/standard/README.md - - name: Foreword - href: ../../_csharpstandard/standard/foreword.md - - name: Introduction - href: ../../_csharpstandard/standard/introduction.md - - name: Scope - href: ../../_csharpstandard/standard/scope.md - - name: Normative references - href: ../../_csharpstandard/standard/normative-references.md - - name: Terms and definitions - href: ../../_csharpstandard/standard/terms-and-definitions.md - - name: General description - href: ../../_csharpstandard/standard/general-description.md - - name: Conformance - href: ../../_csharpstandard/standard/conformance.md - - name: Lexical structure - href: ../../_csharpstandard/standard/lexical-structure.md - - name: Basic concepts - href: ../../_csharpstandard/standard/basic-concepts.md - - name: Types - href: ../../_csharpstandard/standard/types.md - - name: Variables - href: ../../_csharpstandard/standard/variables.md - - name: Conversions - href: ../../_csharpstandard/standard/conversions.md - - name: Patterns - href: ../../_csharpstandard/standard/patterns.md - - name: Expressions - href: ../../_csharpstandard/standard/expressions.md - - name: Statements - href: ../../_csharpstandard/standard/statements.md - - name: Namespaces - href: ../../_csharpstandard/standard/namespaces.md - - name: Classes - href: ../../_csharpstandard/standard/classes.md - - name: Structs - href: ../../_csharpstandard/standard/structs.md - - name: Arrays - href: ../../_csharpstandard/standard/arrays.md - - name: Interfaces - href: ../../_csharpstandard/standard/interfaces.md - - name: Enums - href: ../../_csharpstandard/standard/enums.md - - name: Delegates - href: ../../_csharpstandard/standard/delegates.md - - name: Exceptions - href: ../../_csharpstandard/standard/exceptions.md - - name: Attributes - href: ../../_csharpstandard/standard/attributes.md - - name: Unsafe code - href: ../../_csharpstandard/standard/unsafe-code.md - - name: Grammar - href: ../../_csharpstandard/standard/grammar.md - - name: Portability issues - href: ../../_csharpstandard/standard/portability-issues.md - - name: Standard library - href: ../../_csharpstandard/standard/standard-library.md - - name: Documentation comments - href: ../../_csharpstandard/standard/documentation-comments.md - - name: Bibliography - href: ../../_csharpstandard/standard/bibliography.md - - name: Feature specifications - items: - - name: Lexical structure - items: - - name: "Enhanced #line directives" - href: ../../_csharplang/proposals/csharp-10.0/enhanced-line-directives.md - - name: Basic concepts - items: - - name: Top-level statements - href: ../../_csharplang/proposals/csharp-9.0/top-level-statements.md - - name: Module initializers - href: ../../_csharplang/proposals/csharp-9.0/module-initializers.md - - name: Suppress emitting localsinit flag - href: ../../_csharplang/proposals/csharp-9.0/skip-localsinit.md - - name: Types - items: - - name: Nullable reference types - proposal - href: ../../_csharplang/proposals/csharp-8.0/nullable-reference-types.md - - name: Nullable reference types - specification - href: ../../_csharplang/proposals/csharp-9.0/nullable-reference-types-specification.md - - name: Records - href: ../../_csharplang/proposals/csharp-9.0/records.md - - name: Record structs - href: ../../_csharplang/proposals/csharp-10.0/record-structs.md - - name: File local types - href: ../../_csharplang/proposals/csharp-11.0/file-local-types.md - - name: Unconstrained type parameter annotations - href: ../../_csharplang/proposals/csharp-9.0/unconstrained-type-parameter-annotations.md - - name: Improved interpolated strings - href: ../../_csharplang/proposals/csharp-10.0/improved-interpolated-strings.md - - name: Constant interpolated strings - href: ../../_csharplang/proposals/csharp-10.0/constant_interpolated_strings.md - - name: Raw string literals - href: ../../_csharplang/proposals/csharp-11.0/raw-string-literal.md - - name: Interpolated string newline - href: ../../_csharplang/proposals/csharp-11.0/new-line-in-interpolation.md - - name: UTF-8 string literals - href: ../../_csharplang/proposals/csharp-11.0/utf8-string-literals.md - - name: Native sized integers - href: ../../_csharplang/proposals/csharp-9.0/native-integers.md - - name: Numeric IntPtr - href: ../../_csharplang/proposals/csharp-11.0/numeric-intptr.md - - name: Variables - items: - - name: Improved definite assignment analysis - href: ../../_csharplang/proposals/csharp-10.0/improved-definite-assignment.md - - name: Ref readonly parameters - href: ../../_csharplang/proposals/csharp-12.0/ref-readonly-parameters.md - - name: Patterns - items: - - name: Recursive pattern matching - href: ../../_csharplang/proposals/csharp-8.0/patterns.md - - name: Pattern matching enhancements - href: ../../_csharplang/proposals/csharp-9.0/patterns3.md - - name: Extended property patterns - href: ../../_csharplang/proposals/csharp-10.0/extended-property-patterns.md - - name: Pattern match span - href: ../../_csharplang/proposals/csharp-11.0/pattern-match-span-of-char-on-string.md - - name: List patterns - href: ../../_csharplang/proposals/csharp-11.0/list-patterns.md - - name: Expressions - items: - - name: Ranges - href: ../../_csharplang/proposals/csharp-8.0/ranges.md - - name: Null coalescing assignment - href: ../../_csharplang/proposals/csharp-8.0/null-coalescing-assignment.md - - name: Target-typed new expressions - href: ../../_csharplang/proposals/csharp-9.0/target-typed-new.md - - name: Target-typed conditional expression - href: ../../_csharplang/proposals/csharp-9.0/target-typed-conditional-expression.md - - name: Extension GetEnumerator in foreach loops - href: ../../_csharplang/proposals/csharp-9.0/extension-getenumerator.md - - name: Collection expressions - href: ../../_csharplang/proposals/csharp-12.0/collection-expressions.md - - name: Lambda discard parameters - href: ../../_csharplang/proposals/csharp-9.0/lambda-discard-parameters.md - - name: Static anonymous functions - href: ../../_csharplang/proposals/csharp-9.0/static-anonymous-functions.md - - name: Function pointers - href: ../../_csharplang/proposals/csharp-9.0/function-pointers.md - - name: Lambda improvements - href: ../../_csharplang/proposals/csharp-10.0/lambda-improvements.md - - name: Method group natural type conversion - href: ../../_csharplang/proposals/method-group-natural-type-improvements.md - - name: Optional Lambda expression parameters - href: ../../_csharplang/proposals/csharp-12.0/lambda-method-group-defaults.md - - name: Checked user-defined operators - href: ../../_csharplang/proposals/csharp-11.0/checked-user-defined-operators.md - - name: Unsigned right-shift operator - href: ../../_csharplang/proposals/csharp-11.0/unsigned-right-shift-operator.md - - name: Relaxing shift operator - href: ../../_csharplang/proposals/csharp-11.0/relaxing_shift_operator_requirements.md - - name: Caller argument expression - href: ../../_csharplang/proposals/csharp-10.0/caller-argument-expression.md - - name: Extended nameof scope - href: ../../_csharplang/proposals/csharp-11.0/extended-nameof-scope.md - - name: Statements - items: - - name: Global using directive - href: ../../_csharplang/proposals/csharp-10.0/GlobalUsingDirective.md - - name: Alias any type - href: ../../_csharplang/proposals/csharp-12.0/using-alias-types.md - - name: Static local functions - href: ../../_csharplang/proposals/csharp-8.0/static-local-functions.md - - name: Attributes on local functions - href: ../../_csharplang/proposals/csharp-9.0/local-function-attributes.md - - name: Pattern based using and using declarations - href: ../../_csharplang/proposals/csharp-8.0/using.md - - name: Async streams - href: ../../_csharplang/proposals/csharp-8.0/async-streams.md - - name: Nested stackalloc - href: ../../_csharplang/proposals/csharp-8.0/nested-stackalloc.md - - name: Namespaces - items: - - name: File scoped namespaces - href: ../../_csharplang/proposals/csharp-10.0/file-scoped-namespaces.md - - name: Classes - items: - - name: Extending partial methods - href: ../../_csharplang/proposals/csharp-9.0/extending-partial-methods.md - - name: Covariant return types - href: ../../_csharplang/proposals/csharp-9.0/covariant-returns.md - - name: Primary constructors - href: ../../_csharplang/proposals/csharp-12.0/primary-constructors.md - - name: Init only setters - href: ../../_csharplang/proposals/csharp-9.0/init.md - - name: Required members - href: ../../_csharplang/proposals/csharp-11.0/required-members.md - - name: AsyncMethodBuilder override - href: ../../_csharplang/proposals/csharp-10.0/async-method-builders.md - - name: Structs - items: - - name: Readonly instance members - href: ../../_csharplang/proposals/csharp-8.0/readonly-instance-members.md - - name: Parameterless struct constructors - href: ../../_csharplang/proposals/csharp-10.0/parameterless-struct-constructors.md - - name: Auto-default struct - href: ../../_csharplang/proposals/csharp-11.0/auto-default-structs.md - - name: Low-level struct improvements - href: ../../_csharplang/proposals/csharp-11.0/low-level-struct-improvements.md - - name: Inline arrays - href: ../../_csharplang/proposals/csharp-12.0/inline-arrays.md - - name: Interfaces - items: - - name: Default interface methods - 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: Attributes - items: - - name: Generic attributes - href: ../../_csharplang/proposals/csharp-11.0/generic-attributes.md - - name: Experimental attribute - href: ../../_csharplang/proposals/csharp-12.0/experimental-attribute.md diff --git a/docs/framework/app-domains/how-to-load-assemblies-into-an-application-domain.md b/docs/framework/app-domains/how-to-load-assemblies-into-an-application-domain.md index fdbd8b5c80c3f..f53f353508be4 100644 --- a/docs/framework/app-domains/how-to-load-assemblies-into-an-application-domain.md +++ b/docs/framework/app-domains/how-to-load-assemblies-into-an-application-domain.md @@ -35,7 +35,7 @@ There are several ways to load an assembly into an application domain. The recom ## Example - The following code loads an assembly named "example.exe" or "example.dll" into the current application domain, gets a type named `Example` from the assembly, gets a parameterless method named `MethodA` for that type, and executes the method. For a complete discussion on obtaining information from a loaded assembly, see [Dynamically Loading and Using Types](../reflection-and-codedom/dynamically-loading-and-using-types.md). + The following code loads an assembly named "example.exe" or "example.dll" into the current application domain, gets a type named `Example` from the assembly, gets a parameterless method named `MethodA` for that type, and executes the method. For a complete discussion on obtaining information from a loaded assembly, see [Dynamically Loading and Using Types](../../fundamentals/reflection/dynamically-loading-and-using-types.md). [!code-cpp[System.AppDomain.Load#2](../../../samples/snippets/cpp/VS_Snippets_CLR_System/system.appdomain.load/cpp/source2.cpp#2)] [!code-csharp[System.AppDomain.Load#2](../../../samples/snippets/csharp/VS_Snippets_CLR_System/system.appdomain.load/cs/source2.cs#2)] @@ -45,7 +45,7 @@ There are several ways to load an assembly into an application domain. The recom - - [Programming with Application Domains](application-domains.md#programming-with-application-domains) -- [Reflection](../reflection-and-codedom/reflection.md) +- [Reflection](../../fundamentals/reflection/reflection.md) - [Using Application Domains](use.md) - [How to: Load Assemblies into the Reflection-Only Context](../reflection-and-codedom/how-to-load-assemblies-into-the-reflection-only-context.md) - [Application domains and assemblies](application-domains.md#application-domains-and-assemblies) diff --git a/docs/framework/app-domains/index.md b/docs/framework/app-domains/index.md index acd1f227549f8..84a3fb1830088 100644 --- a/docs/framework/app-domains/index.md +++ b/docs/framework/app-domains/index.md @@ -25,7 +25,7 @@ Describes how to create, sign, and set attributes on assemblies. ## Related Sections -[Emitting Dynamic Methods and Assemblies](../reflection-and-codedom/emitting-dynamic-methods-and-assemblies.md)\ +[Emitting Dynamic Methods and Assemblies](../../fundamentals/reflection/emitting-dynamic-methods-and-assemblies.md)\ Describes how to create dynamic assemblies. [Assemblies in .NET](../../standard/assembly/index.md)\ @@ -34,5 +34,5 @@ Provides a conceptual overview of assemblies. [Application Domains](application-domains.md)\ Provides a conceptual overview of application domains. -[Reflection Overview](../reflection-and-codedom/reflection.md)\ +[Reflection Overview](../../fundamentals/reflection/reflection.md)\ Describes how to use the **Reflection** class to obtain information about an assembly. diff --git a/docs/framework/app-domains/use.md b/docs/framework/app-domains/use.md index 806b64e2adbbd..8518009da11ab 100644 --- a/docs/framework/app-domains/use.md +++ b/docs/framework/app-domains/use.md @@ -31,7 +31,7 @@ Describes how to retrieve setup information from an application domain. [How to: Load Assemblies into an Application Domain](how-to-load-assemblies-into-an-application-domain.md) Describes how to load an assembly into an application domain. -[How to: Obtain Type and Member Information from an Assembly](../reflection-and-codedom/get-type-member-information.md) +[How to: Obtain Type and Member Information from an Assembly](../../fundamentals/reflection/get-type-member-information.md) Describes how to retrieve information about an assembly. [Shadow Copying Assemblies](shadow-copy-assemblies.md) @@ -56,11 +56,11 @@ Provides an overview of the functions performed by assemblies. [Programming with Assemblies](../../standard/assembly/index.md) Describes how to create, sign, and set attributes on assemblies. -[Emitting Dynamic Methods and Assemblies](../reflection-and-codedom/emitting-dynamic-methods-and-assemblies.md) +[Emitting Dynamic Methods and Assemblies](../../fundamentals/reflection/emitting-dynamic-methods-and-assemblies.md) Describes how to create dynamic assemblies. [Application Domains](application-domains.md) Provides a conceptual overview of application domains. -[Reflection Overview](../reflection-and-codedom/reflection.md) +[Reflection Overview](../../fundamentals/reflection/reflection.md) Describes how to use the **Reflection** class to obtain information about an assembly. diff --git a/docs/framework/configure-apps/file-schema/compiler/compiler-element.md b/docs/framework/configure-apps/file-schema/compiler/compiler-element.md index a6207c163471e..4f2afc034af48 100644 --- a/docs/framework/configure-apps/file-schema/compiler/compiler-element.md +++ b/docs/framework/configure-apps/file-schema/compiler/compiler-element.md @@ -44,7 +44,7 @@ The following sections describe attributes, child elements, and parent elements. |`compilerOptions`|Optional attribute.

Specifies additional compiler-specific arguments for compilation. The values for the `compilerOptions` attribute are typically listed in a compiler options topic for the compiler.| |`extension`|Required attribute.

Provides a semicolon-separated list of file name extensions used by source files for the language provider. For example, ".cs".| |`language`|Required attribute.

Provides a semicolon-separated list of language names supported by the language provider. For example, "c#;cs;csharp".| -|`type`|Required attribute.

Specifies the type name of the language provider, including the name of the assembly containing the provider implementation. The type name must meet the requirements defined in [Specifying Fully Qualified Type Names](../../../reflection-and-codedom/specifying-fully-qualified-type-names.md).| +|`type`|Required attribute.

Specifies the type name of the language provider, including the name of the assembly containing the provider implementation. The type name must meet the requirements defined in [Specifying Fully Qualified Type Names](../../../../fundamentals/reflection/specifying-fully-qualified-type-names.md).| |`warningLevel`|Optional attribute.

Specifies the default compiler warning level; determines the level at which the language provider treats compilation warnings as errors.| ### Child Elements @@ -101,5 +101,5 @@ The following example illustrates a typical compiler configuration element: - - [Configuration File Schema](../index.md) - [\ Element](compilers-element.md) -- [Specifying Fully Qualified Type Names](../../../reflection-and-codedom/specifying-fully-qualified-type-names.md) +- [Specifying Fully Qualified Type Names](../../../../fundamentals/reflection/specifying-fully-qualified-type-names.md) - [compiler Element for compilers for compilation (ASP.NET Settings Schema)](/previous-versions/dotnet/netframework-4.0/a15ebt6c(v=vs.100)) diff --git a/docs/framework/configure-apps/file-schema/compiler/provideroption-element.md b/docs/framework/configure-apps/file-schema/compiler/provideroption-element.md index bc7d861c05f10..02fc301ae2989 100644 --- a/docs/framework/configure-apps/file-schema/compiler/provideroption-element.md +++ b/docs/framework/configure-apps/file-schema/compiler/provideroption-element.md @@ -95,5 +95,5 @@ Specifies the compiler version attributes for a language provider. - - [Configuration File Schema](../index.md) - [\ Element](compilers-element.md) -- [Specifying Fully Qualified Type Names](../../../reflection-and-codedom/specifying-fully-qualified-type-names.md) +- [Specifying Fully Qualified Type Names](../../../../fundamentals/reflection/specifying-fully-qualified-type-names.md) - [compiler Element for compilers for compilation (ASP.NET Settings Schema)](/previous-versions/dotnet/netframework-4.0/a15ebt6c(v=vs.100)) diff --git a/docs/framework/configure-apps/file-schema/cryptography/cryptoclass-element.md b/docs/framework/configure-apps/file-schema/cryptography/cryptoclass-element.md index 7ec63a15d4153..157ee1936f1a1 100644 --- a/docs/framework/configure-apps/file-schema/cryptography/cryptoclass-element.md +++ b/docs/framework/configure-apps/file-schema/cryptography/cryptoclass-element.md @@ -35,7 +35,7 @@ Contains a cryptography class that has a mapping to a friendly name in the [\
Contains the information for the cryptography class. Use this attribute to provide a short name for your class. You must specify a string that meets the requirements specified in [Specifying Fully Qualified Type Names](../../../reflection-and-codedom/specifying-fully-qualified-type-names.md).| +|`customClassName`|Required attribute.

Contains the information for the cryptography class. Use this attribute to provide a short name for your class. You must specify a string that meets the requirements specified in [Specifying Fully Qualified Type Names](../../../../fundamentals/reflection/specifying-fully-qualified-type-names.md).| ### Child Elements diff --git a/docs/framework/configure-apps/file-schema/trace-debug/add-element-for-listeners-for-source.md b/docs/framework/configure-apps/file-schema/trace-debug/add-element-for-listeners-for-source.md index 6ce3766d544f8..b5c12dea9d15c 100644 --- a/docs/framework/configure-apps/file-schema/trace-debug/add-element-for-listeners-for-source.md +++ b/docs/framework/configure-apps/file-schema/trace-debug/add-element-for-listeners-for-source.md @@ -37,7 +37,7 @@ Adds a listener to the `Listeners` collection for a trace source. |Attribute|Description| |---------------|-----------------| -|`type`|Required attribute, unless you're referencing a listener in the `sharedListeners` collection, in which case you only need to refer to it by name (see the [Example](#example)).

Specifies the type of the listener. You must use a string that meets the requirements specified in [Specifying Fully Qualified Type Names](../../../reflection-and-codedom/specifying-fully-qualified-type-names.md).| +|`type`|Required attribute, unless you're referencing a listener in the `sharedListeners` collection, in which case you only need to refer to it by name (see the [Example](#example)).

Specifies the type of the listener. You must use a string that meets the requirements specified in [Specifying Fully Qualified Type Names](../../../../fundamentals/reflection/specifying-fully-qualified-type-names.md).| |`initializeData`|Optional attribute.

The string passed to the constructor for the specified class. A is thrown if the class does not have a constructor that takes a string.| |`name`|Optional attribute.

Specifies the name of the listener.| |`traceOutputOptions`|Optional attribute.

Specifies the property value for the trace listener.| diff --git a/docs/framework/configure-apps/file-schema/trace-debug/add-element-for-listeners-for-trace.md b/docs/framework/configure-apps/file-schema/trace-debug/add-element-for-listeners-for-trace.md index 6c3c6ecde1818..cb57f55251288 100644 --- a/docs/framework/configure-apps/file-schema/trace-debug/add-element-for-listeners-for-trace.md +++ b/docs/framework/configure-apps/file-schema/trace-debug/add-element-for-listeners-for-trace.md @@ -36,7 +36,7 @@ Adds a listener to the **Listeners** collection. |Attribute|Description| |---------------|-----------------| -|**type**|Required attribute.

Specifies the type of the listener. You must use a string that meets the requirements specified in [Specifying Fully Qualified Type Names](../../../reflection-and-codedom/specifying-fully-qualified-type-names.md).| +|**type**|Required attribute.

Specifies the type of the listener. You must use a string that meets the requirements specified in [Specifying Fully Qualified Type Names](../../../../fundamentals/reflection/specifying-fully-qualified-type-names.md).| |**initializeData**|Optional attribute.

The string passed to the constructor for the specified class.| |**name**|Optional attribute.

Specifies the name of the listener.| diff --git a/docs/framework/configure-apps/file-schema/trace-debug/add-element-for-sharedlisteners.md b/docs/framework/configure-apps/file-schema/trace-debug/add-element-for-sharedlisteners.md index 3f0fdd9b2c7be..2125a0a7dd2a9 100644 --- a/docs/framework/configure-apps/file-schema/trace-debug/add-element-for-sharedlisteners.md +++ b/docs/framework/configure-apps/file-schema/trace-debug/add-element-for-sharedlisteners.md @@ -38,7 +38,7 @@ Adds a listener to the `sharedListeners` collection. `sharedListeners` is a coll |Attribute|Description| |---------------|-----------------| |`name`|Required attribute.

Specifies the name of the listener that is used to add the shared listener to a `Listeners` collection.| -|`type`|Required attribute.

Specifies the type of the listener. You must use a string that meets the requirements specified in [Specifying Fully Qualified Type Names](../../../reflection-and-codedom/specifying-fully-qualified-type-names.md).| +|`type`|Required attribute.

Specifies the type of the listener. You must use a string that meets the requirements specified in [Specifying Fully Qualified Type Names](../../../../fundamentals/reflection/specifying-fully-qualified-type-names.md).| |`initializeData`|Optional attribute.

The string passed to the constructor for the specified class.| |`traceOutputOptions`|Optional attribute.

The string representation of one or more enumeration members that indicates the data to be written to the trace output. Multiple items are separated by commas. The default value is "None".| diff --git a/docs/framework/configure-apps/file-schema/trace-debug/filter-element-for-add-for-listeners-for-source.md b/docs/framework/configure-apps/file-schema/trace-debug/filter-element-for-add-for-listeners-for-source.md index cc31b60be1074..4c2f24a2b8fd9 100644 --- a/docs/framework/configure-apps/file-schema/trace-debug/filter-element-for-add-for-listeners-for-source.md +++ b/docs/framework/configure-apps/file-schema/trace-debug/filter-element-for-add-for-listeners-for-source.md @@ -39,7 +39,7 @@ Adds a filter to a listener in the `Listeners` collection for a trace source. |Attribute|Description| |---------------|-----------------| -|`type`|Required attribute.

Specifies the type of the filter, which should inherit from the class. You can use the namespace-qualified name of the type, which corresponds to the type's property, or you can use the fully qualified type name including the assembly information, which corresponds to the property. For information about fully qualified type names, see [Specifying Fully Qualified Type Names](../../../reflection-and-codedom/specifying-fully-qualified-type-names.md).| +|`type`|Required attribute.

Specifies the type of the filter, which should inherit from the class. You can use the namespace-qualified name of the type, which corresponds to the type's property, or you can use the fully qualified type name including the assembly information, which corresponds to the property. For information about fully qualified type names, see [Specifying Fully Qualified Type Names](../../../../fundamentals/reflection/specifying-fully-qualified-type-names.md).| |`initializeData`|Optional attribute.

The string passed to the constructor for the specified filter class.| ### Child Elements diff --git a/docs/framework/configure-apps/file-schema/trace-debug/filter-element-for-add-for-listeners-for-trace.md b/docs/framework/configure-apps/file-schema/trace-debug/filter-element-for-add-for-listeners-for-trace.md index 36de5d0ad6502..85119ad167375 100644 --- a/docs/framework/configure-apps/file-schema/trace-debug/filter-element-for-add-for-listeners-for-trace.md +++ b/docs/framework/configure-apps/file-schema/trace-debug/filter-element-for-add-for-listeners-for-trace.md @@ -37,7 +37,7 @@ Adds a filter to a listener in the `Listeners` collection for a trace. |Attribute|Description| |---------------|-----------------| -|`type`|Required attribute.

Specifies the type of the filter, which should inherit from the class. You can use the namespace-qualified name of the type, which corresponds to the type's property, or you can use the fully qualified type name including the assembly information, which corresponds to the property. For information about fully qualified type names, see [Specifying Fully Qualified Type Names](../../../reflection-and-codedom/specifying-fully-qualified-type-names.md).| +|`type`|Required attribute.

Specifies the type of the filter, which should inherit from the class. You can use the namespace-qualified name of the type, which corresponds to the type's property, or you can use the fully qualified type name including the assembly information, which corresponds to the property. For information about fully qualified type names, see [Specifying Fully Qualified Type Names](../../../../fundamentals/reflection/specifying-fully-qualified-type-names.md).| |`initializeData`|Optional attribute.

The string passed to the constructor for the specified filter class.| ### Child Elements diff --git a/docs/framework/configure-apps/file-schema/trace-debug/filter-element-for-add-for-sharedlisteners.md b/docs/framework/configure-apps/file-schema/trace-debug/filter-element-for-add-for-sharedlisteners.md index cee13a72167c4..1fb983e813e0d 100644 --- a/docs/framework/configure-apps/file-schema/trace-debug/filter-element-for-add-for-sharedlisteners.md +++ b/docs/framework/configure-apps/file-schema/trace-debug/filter-element-for-add-for-sharedlisteners.md @@ -37,7 +37,7 @@ Adds a filter to a listener in the `sharedListeners` collection. |Attribute|Description| |---------------|-----------------| -|**type**|Required attribute.

Specifies the type of the filter. You can use only the full name of the type (in the format of the property), or you can use the fully qualified type name including the assembly information (in the format of the property). For information on creating a fully qualified type name, see [Specifying Fully Qualified Type Names](../../../reflection-and-codedom/specifying-fully-qualified-type-names.md).| +|**type**|Required attribute.

Specifies the type of the filter. You can use only the full name of the type (in the format of the property), or you can use the fully qualified type name including the assembly information (in the format of the property). For information on creating a fully qualified type name, see [Specifying Fully Qualified Type Names](../../../../fundamentals/reflection/specifying-fully-qualified-type-names.md).| |**initializeData**|Optional attribute.

The string passed to the constructor for the specified class.| ### Child Elements diff --git a/docs/framework/configure-apps/map-algorithm-names-to-cryptography-classes.md b/docs/framework/configure-apps/map-algorithm-names-to-cryptography-classes.md index 2bdd034408eb1..dc605ac97b3af 100644 --- a/docs/framework/configure-apps/map-algorithm-names-to-cryptography-classes.md +++ b/docs/framework/configure-apps/map-algorithm-names-to-cryptography-classes.md @@ -55,7 +55,7 @@ There are four ways a developer can create a cryptography object using the Windo ``` - You can specify the name of the attribute in the [ element](./file-schema/cryptography/cryptoclass-element.md) (the previous example names the attribute `MySHA1Hash`). The value of the attribute in the **\** element is a string that the common language runtime uses to find the class. You can use any string that meets the requirements specified in [Specifying Fully Qualified Type Names](../reflection-and-codedom/specifying-fully-qualified-type-names.md). + You can specify the name of the attribute in the [ element](./file-schema/cryptography/cryptoclass-element.md) (the previous example names the attribute `MySHA1Hash`). The value of the attribute in the **\** element is a string that the common language runtime uses to find the class. You can use any string that meets the requirements specified in [Specifying Fully Qualified Type Names](../../fundamentals/reflection/specifying-fully-qualified-type-names.md). Many algorithm names can map to the same class. The [\ element](./file-schema/cryptography/nameentry-element.md) maps a class to one friendly algorithm name. The **name** attribute can be either a string that is used when calling the **System.Security.Cryptography.CryptoConfig.CreateFromName** method or the name of an abstract cryptography class in the namespace. The value of the **class** attribute is the name of the attribute in the **\** element. diff --git a/docs/framework/reflection-and-codedom/accessing-custom-attributes.md b/docs/framework/reflection-and-codedom/accessing-custom-attributes.md deleted file mode 100644 index 9f2771bcaa638..0000000000000 --- a/docs/framework/reflection-and-codedom/accessing-custom-attributes.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: "Accessing Custom Attributes" -description: Access custom attributes in .NET. After attributes have been associated with program elements, you can use reflection to query their existence and values. -ms.date: "03/30/2017" -dev_langs: - - "csharp" - - "vb" - - "cpp" -helpviewer_keywords: - - "custom attributes, accessibility" - - "attributes [.NET Framework], accessing" - - "reflection, custom attributes" -ms.assetid: 1d8e3398-00d8-47d5-a084-214f9859d3d7 ---- -# Accessing Custom Attributes - -After attributes have been associated with program elements, reflection can be used to query their existence and values. In the .NET Framework version 1.0 and 1.1, custom attributes are examined in the execution context. The .NET Framework version 2.0 provides a new load context, the reflection-only context, which can be used to examine code that cannot be loaded for execution. - -## The Reflection-Only Context - - Code loaded into the reflection-only context cannot be executed. This means that instances of custom attributes cannot be created, because that would require executing their constructors. To load and examine custom attributes in the reflection-only context, use the class. You can obtain instances of this class by using the appropriate overload of the static method. See [How to: Load Assemblies into the Reflection-Only Context](how-to-load-assemblies-into-the-reflection-only-context.md). - -## The Execution Context - - The main reflection methods to query attributes in the execution context are and . - - The accessibility of a custom attribute is checked with respect to the assembly in which it is attached. This is equivalent to checking whether a method on a type in the assembly in which the custom attribute is attached can call the constructor of the custom attribute. - - Methods such as check the visibility and accessibility of the type argument. Only code in the assembly that contains the user-defined type can retrieve a custom attribute of that type using **GetCustomAttributes**. - - The following C# example is a typical custom attribute design pattern. It illustrates the runtime custom attribute reflection model. - -```csharp -System.DLL -public class DescriptionAttribute : Attribute -{ -} - -System.Web.DLL -internal class MyDescriptionAttribute : DescriptionAttribute -{ -} - -public class LocalizationExtenderProvider -{ - [MyDescriptionAttribute(...)] - public CultureInfo GetLanguage(...) - { - } -} -``` - - If the runtime is attempting to retrieve the custom attributes for the public custom attribute type attached to the **GetLanguage** method, it performs the following actions: - -1. The runtime checks that the type argument **DescriptionAttribute** to **Type.GetCustomAttributes**(Type *type*) is public, and therefore is visible and accessible. - -2. The runtime checks that the user-defined type **MyDescriptionAttribute** that is derived from **DescriptionAttribute** is visible and accessible within the **System.Web.DLL** assembly, where it is attached to the method **GetLanguage**(). - -3. The runtime checks that the constructor of **MyDescriptionAttribute** is visible and accessible within the **System.Web.DLL** assembly. - -4. The runtime calls the constructor of **MyDescriptionAttribute** with the custom attribute parameters and returns the new object to the caller. - - The custom attribute reflection model could leak instances of user-defined types outside the assembly in which the type is defined. This is no different from the members in the runtime system library that return instances of user-defined types, such as returning an array of **RuntimeMethodInfo** objects. To prevent a client from discovering information about a user-defined custom attribute type, define the type's members to be nonpublic. - - The following example demonstrates the basic way of using reflection to get access to custom attributes. - - [!code-cpp[CustomAttributeData#2](../../../samples/snippets/cpp/VS_Snippets_CLR/CustomAttributeData/CPP/source2.cpp#2)] - [!code-csharp[CustomAttributeData#2](../../../samples/snippets/csharp/VS_Snippets_CLR/CustomAttributeData/CS/source2.cs#2)] - [!code-vb[CustomAttributeData#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CustomAttributeData/VB/source2.vb#2)] - -## See also - -- -- -- [Viewing Type Information](viewing-type-information.md) -- [Security Considerations for Reflection](security-considerations-for-reflection.md) diff --git a/docs/framework/reflection-and-codedom/dynamic-language-runtime-overview.md b/docs/framework/reflection-and-codedom/dynamic-language-runtime-overview.md index 7faab370a4d7c..214f9da778847 100644 --- a/docs/framework/reflection-and-codedom/dynamic-language-runtime-overview.md +++ b/docs/framework/reflection-and-codedom/dynamic-language-runtime-overview.md @@ -1,7 +1,7 @@ --- -title: "Dynamic Language Runtime Overview | Microsoft Docs" +title: "Dynamic Language Runtime Overview" description: Read an overview of the dynamic language runtime (DLR) in .NET. The DLR is a runtime environment that adds a set of services for dynamic languages to the CLR. -ms.date: "03/30/2017" +ms.date: 03/27/2024 helpviewer_keywords: - "dynamic language runtime" - "IronPython" @@ -9,23 +9,21 @@ helpviewer_keywords: - "IronRuby" ms.assetid: f769a271-8aff-4bea-bfab-6160217ce23d --- -# Dynamic Language Runtime Overview +# Dynamic language runtime overview -The *dynamic language runtime* (DLR) is a runtime environment that adds a set of services for dynamic languages to the common language runtime (CLR). The DLR makes it easier to develop dynamic languages to run on the .NET Framework and to add dynamic features to statically typed languages. +The *dynamic language runtime* (DLR) is a runtime environment that adds a set of services for dynamic languages to the common language runtime (CLR). The DLR makes it easier to develop dynamic languages to run on .NET and to add dynamic features to statically typed languages. -Dynamic languages can identify the type of an object at run time, whereas in statically typed languages such as C# and Visual Basic (when you use `Option Explicit On`) you must specify object types at design time. Examples of dynamic languages are Lisp, Smalltalk, JavaScript, PHP, Ruby, Python, ColdFusion, Lua, Cobra, and Groovy. +Dynamic languages can identify the type of an object at run time, whereas in statically typed languages such as C# and Visual Basic (when you use `Option Explicit On`), you must specify object types at design time. Examples of dynamic languages are Lisp, Smalltalk, JavaScript, PHP, Ruby, Python, ColdFusion, Lua, Cobra, and Groovy. Most dynamic languages provide the following advantages for developers: - The ability to use a rapid feedback loop (REPL, or read-evaluate-print loop). This lets you enter several statements and immediately execute them to see the results. +- Support for both top-down development and more traditional bottom-up development. For example, when you use a top-down approach, you can call functions that aren't yet implemented and then add underlying implementations when you need them. +- Easier refactoring and code modifications, because you don't have to change static type declarations throughout the code. -- Support for both top-down development and more traditional bottom-up development. For example, when you use a top-down approach, you can call functions that are not yet implemented and then add underlying implementations when you need them. +Dynamic languages make excellent scripting languages. Customers can easily extend applications created by using dynamic languages with new commands and functionality. Dynamic languages are also frequently used for creating web sites and test harnesses, maintaining server farms, developing various utilities, and performing data transformations. -- Easier refactoring and code modifications, because you do not have to change static type declarations throughout the code. - -Dynamic languages make excellent scripting languages. Customers can easily extend applications created by using dynamic languages with new commands and functionality. Dynamic languages are also frequently used for creating Web sites and test harnesses, maintaining server farms, developing various utilities, and performing data transformations. - -The purpose of the DLR is to enable a system of dynamic languages to run on the .NET Framework and give them .NET interoperability. The DLR adds dynamic objects to C# and Visual Basic to support dynamic behavior in these languages and enable their interoperation with dynamic languages. +The purpose of the DLR is to enable a system of dynamic languages to run on .NET and give them .NET interoperability. The DLR adds dynamic objects to C# and Visual Basic to support dynamic behavior in these languages and enable their interoperation with dynamic languages. The DLR also helps you create libraries that support dynamic operations. For example, if you have a library that uses XML or JavaScript Object Notation (JSON) objects, your objects can appear as dynamic objects to languages that use the DLR. This lets library users write syntactically simpler and more natural code for operating with objects and accessing object members. @@ -37,47 +35,37 @@ By using the DLR, you could use the following code instead for the same operatio `scriptobj.Count += 1;` -Like the CLR, the DLR is a part of the .NET Framework and is provided with the .NET Framework and Visual Studio installation packages. The open-source version of the DLR is also available for download on the [IronLanguages/dlr](https://github.com/IronLanguages/dlr) repo on GitHub. - -> [!NOTE] -> The open-source version of the DLR has all the features of the DLR that is included in Visual Studio and the .NET Framework. It also provides additional support for language implementers. For more information, see the documentation on the [IronLanguages/dlr](https://github.com/IronLanguages/dlr) repo on GitHub. - -Examples of languages developed by using the DLR include the following: - -- IronPython. Available as open-source software from the [GitHub](https://github.com/IronLanguages/ironpython2) Web site. - -## Primary DLR Advantages +Like the CLR, the DLR is a part of .NET. It's available for download on the [IronLanguages/dlr](https://github.com/IronLanguages/dlr) repo on GitHub. - The DLR provides the following advantages. +[IronPython](https://github.com/IronLanguages/ironpython2) is an example of a language that was developed by using the DLR. -### Simplifies Porting Dynamic Languages to the .NET Framework +## Primary DLR advantages - The DLR allows language implementers to avoid creating lexical analyzers, parsers, semantic analyzers, code generators, and other tools that they traditionally had to create themselves. To use the DLR, a language needs to produce *expression trees*, which represent language-level code in a tree-shaped structure, runtime helper routines, and optional dynamic objects that implement the interface. The DLR and the .NET Framework automate a lot of code analysis and code generation tasks. This enables language implementers to concentrate on unique language features. +The DLR provides the following advantages. -### Enables Dynamic Features in Statically Typed Languages +### Simplifies porting dynamic languages to .NET - Existing .NET Framework languages such as C# and Visual Basic can create dynamic objects and use them together with statically typed objects. For example, C# and Visual Basic can use dynamic objects for HTML, Document Object Model (DOM), and .NET reflection. +The DLR allows language implementers to avoid creating lexical analyzers, parsers, semantic analyzers, code generators, and other tools that they traditionally had to create themselves. To use the DLR, a language needs to produce *expression trees*, which represent language-level code in a tree-shaped structure, runtime helper routines, and optional dynamic objects that implement the interface. The DLR and .NET automate a lot of code analysis and code generation tasks. This enables language implementers to concentrate on unique language features. -### Provides Future Benefits of the DLR and .NET Framework +### Enables dynamic features in statically typed languages - Languages implemented by using the DLR can benefit from future DLR and .NET Framework improvements. For example, if the .NET Framework releases a new version that has an improved garbage collector or faster assembly loading time, languages implemented by using the DLR immediately get the same benefit. If the DLR adds optimizations such as better compilation, the performance also improves for all languages implemented by using the DLR. +Existing .NET languages such as C# and Visual Basic can create dynamic objects and use them together with statically typed objects. For example, C# and Visual Basic can use dynamic objects for HTML, Document Object Model (DOM), and reflection. -### Enables Sharing of Libraries and Objects +### Provides future benefits of the DLR and .NET - The objects and libraries implemented in one language can be used by other languages. The DLR also enables interoperation between statically typed and dynamic languages. For example, C# can declare a dynamic object that uses a library that is written in a dynamic language. At the same time, dynamic languages can use libraries from the .NET Framework. +Languages implemented by using the DLR can benefit from future DLR and .NET improvements. For example, if .NET releases a new version that has an improved garbage collector or faster assembly loading time, languages implemented by using the DLR immediately get the same benefit. If the DLR adds optimizations such as better compilation, the performance also improves for all languages implemented by using the DLR. -### Provides Fast Dynamic Dispatch and Invocation +### Enables sharing of libraries and objects - The DLR provides fast execution of dynamic operations by supporting advanced polymorphic caching. The DLR creates rules for binding operations that use objects to the necessary runtime implementations and then caches these rules to avoid resource-exhausting binding computations during successive executions of the same code on the same types of objects. +The objects and libraries implemented in one language can be used by other languages. The DLR also enables interoperation between statically typed and dynamic languages. For example, C# can declare a dynamic object that uses a library that is written in a dynamic language. At the same time, dynamic languages can use libraries from the .NET Framework. -## DLR Architecture +### Provides fast dynamic dispatch and invocation - The following illustration shows the architecture of the dynamic language runtime. +The DLR provides fast execution of dynamic operations by supporting advanced polymorphic caching. The DLR creates rules for binding operations that use objects to the necessary runtime implementations and then caches these rules to avoid resource-exhausting binding computations during successive executions of the same code on the same types of objects. - ![Dynamic Language Runtime Architecture Overview](./media/dlr-archoverview.png "DLR_ArchOverview") -DLR architecture +## DLR architecture - The DLR adds a set of services to the CLR for better supporting dynamic languages. These services include the following: +The DLR adds a set of services to the CLR for better supporting dynamic languages. These services include the following: - Expression trees. The DLR uses expression trees to represent language semantics. For this purpose, the DLR has extended LINQ expression trees to include control flow, assignment, and other language-modeling nodes. For more information, see [Expression Trees (C#)](../../csharp/advanced-topics/expression-trees/index.md) or [Expression Trees (Visual Basic)](../../visual-basic/programming-guide/concepts/expression-trees/index.md). @@ -85,11 +73,11 @@ DLR architecture - Dynamic object interoperability. The DLR provides a set of classes and interfaces that represent dynamic objects and operations and can be used by language implementers and authors of dynamic libraries. These classes and interfaces include , , , and . -The DLR uses binders in call sites to communicate not only with the .NET Framework, but with other infrastructures and services, including Silverlight and COM. Binders encapsulate a language's semantics and specify how to perform operations in a call site by using expression trees. This enables dynamic and statically typed languages that use the DLR to share libraries and gain access to all the technologies that the DLR supports. +The DLR uses binders in call sites to communicate not only with .NET, but with other infrastructures and services, such as COM. Binders encapsulate a language's semantics and specify how to perform operations in a call site by using expression trees. This enables dynamic and statically typed languages that use the DLR to share libraries and gain access to all the technologies that the DLR supports. -## DLR Documentation +## DLR documentation - For more information about how to use the open source version of the DLR to add dynamic behavior to a language, or about how to enable the use of a dynamic language with the .NET Framework, see the documentation on the [IronLanguages/dlr](https://github.com/IronLanguages/dlr/tree/master/Docs) repo on GitHub. +For more information about how to use the open source version of the DLR to add dynamic behavior to a language, or about how to enable the use of a dynamic language with .NET, see the documentation on the [IronLanguages/dlr](https://github.com/IronLanguages/dlr/tree/master/Docs) repo on GitHub. ## See also @@ -98,4 +86,4 @@ The DLR uses binders in call sites to communicate not only with the .NET Framewo - [Common Language Runtime](../../standard/clr.md) - [Expression Trees (C#)](../../csharp/advanced-topics/expression-trees/index.md) - [Expression Trees (Visual Basic)](../../visual-basic/programming-guide/concepts/expression-trees/index.md) -- [Walkthrough: Creating and Using Dynamic Objects](../../csharp/advanced-topics/interop/walkthrough-creating-and-using-dynamic-objects.md) +- [Walkthrough: Create and Use Dynamic Objects](../../csharp/advanced-topics/interop/walkthrough-creating-and-using-dynamic-objects.md) diff --git a/docs/framework/reflection-and-codedom/dynamic-source-code-generation-and-compilation.md b/docs/framework/reflection-and-codedom/dynamic-source-code-generation-and-compilation.md index 556fb2e6dc6dd..d309f5e8f2983 100644 --- a/docs/framework/reflection-and-codedom/dynamic-source-code-generation-and-compilation.md +++ b/docs/framework/reflection-and-codedom/dynamic-source-code-generation-and-compilation.md @@ -1,8 +1,8 @@ --- title: "Dynamic Source Code Generation and Compilation" description: Compile and generate dynamic source code in .NET with the Code Document Object Model (CodeDOM). CodeDOM elements are linked to form a CodeDOM graph. -ms.date: "03/30/2017" -helpviewer_keywords: +ms.date: 03/27/2024 +helpviewer_keywords: - "Code Document Object Model" - "System.CodeDom namespace" - "language-independent source code modeling" @@ -14,44 +14,26 @@ ms.assetid: d077a3e8-bd81-4bdf-b6a3-323857ea30fb --- # Compile and generate dynamic source code -The .NET Framework includes a mechanism called the Code Document Object Model (CodeDOM) that enables developers of programs that emit source code to generate source code in multiple programming languages at run time, based on a single model that represents the code to render. - -To represent source code, CodeDOM elements are linked to each other to form a data structure known as a CodeDOM graph, which models the structure of some source code. - -The namespace defines types that can represent the logical structure of source code, independent of a specific programming language. The namespace defines types for generating source code from CodeDOM graphs and managing the compilation of source code in supported languages. Compiler vendors or developers can extend the set of supported languages. - -Language-independent source code modeling can be valuable when a program needs to generate source code for a program model in multiple languages or for an uncertain target language. For example, some designers use the CodeDOM as a language abstraction interface to produce source code in the correct programming language, if CodeDOM support for the language is available. - -The .NET Framework includes code generators and code compilers for , , and . - -## In this section - -- [Using the CodeDOM](using-the-codedom.md) - - Describes common uses, and demonstrates building a simple object graph using the CodeDOM. - -- [Generate Source Code and Compile a Program from a CodeDOM Graph](generating-and-compiling-source-code-from-a-codedom-graph.md) - - Describes how to generate source code and compile the generated code with an external compiler using classes defined in the `System.CodeDom.Compiler` namespace. - -- [How to: Create an XML Documentation File Using CodeDOM](how-to-create-an-xml-documentation-file-using-codedom.md) - - Describes how to use CodeDOM to generate code with XML documentation comments, and compile the generated code so that it creates the XML documentation output. - -- [How to: Create a Class Using CodeDOM](how-to-create-a-class-using-codedom.md) - - Describes how to use CodeDOM to generate a class containing fields, properties, a method, a constructor, and an entry point. - -## Reference - -- - - Defines elements that represent code elements in programming languages that target the common language runtime. - -- - - Defines interfaces for generating and compiling code at run time. - -## Related sections +.NET includes a mechanism called the Code Document Object Model (CodeDOM) that enables developers of programs that emit source code to generate source code in multiple programming languages at run time, based on a single model that represents the code to render. + +To represent source code, CodeDOM elements are linked to each other to form a data structure known as a CodeDOM graph, which models the structure of some source code. + +The namespace defines types that can represent the logical structure of source code, independent of a specific programming language. The namespace defines types for generating source code from CodeDOM graphs and managing the compilation of source code in supported languages. Compiler vendors or developers can extend the set of supported languages. + +Language-independent source code modeling can be valuable when a program needs to generate source code for a program model in multiple languages or for an uncertain target language. For example, some designers use the CodeDOM as a language abstraction interface to produce source code in the correct programming language, if CodeDOM support for the language is available. + +.NET includes code generators and code compilers for , , and . + +## Reference + +- + + Defines elements that represent code elements in programming languages that target the common language runtime. + +- + + Defines interfaces for generating and compiling code at run time. + +## Related sections - [CodeDOM Quick Reference](/previous-versions/dotnet/netframework-4.0/f1dfsbhc(v=vs.100)) provides a quick way for developers to find the CodeDOM elements that represent source code elements. diff --git a/docs/framework/reflection-and-codedom/dynamically-loading-and-using-types.md b/docs/framework/reflection-and-codedom/dynamically-loading-and-using-types.md deleted file mode 100644 index 6ff4aeee64b39..0000000000000 --- a/docs/framework/reflection-and-codedom/dynamically-loading-and-using-types.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: "Dynamically Loading and Using Types" -description: Dynamically load and use types in .NET. Use reflection, which provides infrastructure used by language compilers to implement implicit late binding. -ms.date: "03/30/2017" -dev_langs: - - "csharp" - - "vb" - - "cpp" -helpviewer_keywords: - - "late binding, about late binding" - - "early binding" - - "dynamically loading and using types" - - "implicit late binding" - - "reflection, dynamically using types" -ms.assetid: db985bec-5942-40ec-b13a-771ae98623dc ---- -# Dynamically Loading and Using Types - -Reflection provides infrastructure used by language compilers to implement implicit late binding. Binding is the process of locating the declaration (that is, the implementation) that corresponds to a uniquely specified type. When this process occurs at run time rather than at compile time, it is called late binding. Visual Basic allows you to use implicit late binding in your code; the Visual Basic compiler calls a helper method that uses reflection to obtain the object type. The arguments passed to the helper method cause the appropriate method to be invoked at run time. These arguments are the instance (an object) on which to invoke the method, the name of the invoked method (a string), and the arguments passed to the invoked method (an array of objects). - - In the following example, the Visual Basic compiler uses reflection implicitly to call a method on an object whose type is not known at compile time. A **HelloWorld** class has a **PrintHello** method that prints out "Hello World" concatenated with some text that is passed to the **PrintHello** method. The **PrintHello** method called in this example is actually a ; the Visual Basic code allows the **PrintHello** method to be invoked as if the type of the object (helloObj) were known at compile time (early binding) rather than at run time (late binding). - -```vb -Module Hello - Sub Main() - ' Sets up the variable. - Dim helloObj As Object - ' Creates the object. - helloObj = new HelloWorld() - ' Invokes the print method as if it was early bound - ' even though it is really late bound. - helloObj.PrintHello("Visual Basic Late Bound") - End Sub -End Module -``` - -## Custom Binding - - In addition to being used implicitly by compilers for late binding, reflection can be used explicitly in code to accomplish late binding. - - The [common language runtime](../../standard/clr.md) supports multiple programming languages, and the binding rules of these languages differ. In the early-bound case, code generators can completely control this binding. However, in late binding through reflection, binding must be controlled by customized binding. The class provides custom control of member selection and invocation. - - Using custom binding, you can load an assembly at run time, obtain information about types in that assembly, specify the type that you want, and then invoke methods or access fields or properties on that type. This technique is useful if you do not know an object's type at compile time, such as when the object type is dependent on user input. - - The following example demonstrates a simple custom binder that provides no argument type conversion. Code for `Simple_Type.dll` precedes the main example. Be sure to build `Simple_Type.dll` and then include a reference to it in the project at build time. - - [!code-cpp[Conceptual.Types.Dynamic#1](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.dynamic/cpp/source1.cpp#1)] - [!code-csharp[Conceptual.Types.Dynamic#1](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.dynamic/cs/source1.cs#1)] - [!code-vb[Conceptual.Types.Dynamic#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.dynamic/vb/source1.vb#1)] - -### InvokeMember and CreateInstance - - Use to invoke a member of a type. The **CreateInstance** methods of various classes, such as and , are specialized forms of **InvokeMember** that create new instances of the specified type. The **Binder** class is used for overload resolution and argument coercion in these methods. - - The following example shows the three possible combinations of argument coercion (type conversion) and member selection. In Case 1, no argument coercion or member selection is needed. In Case 2, only member selection is needed. In Case 3, only argument coercion is needed. - - [!code-cpp[Conceptual.Types.Dynamic#2](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.dynamic/cpp/source2.cpp#2)] - [!code-csharp[Conceptual.Types.Dynamic#2](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.dynamic/cs/source2.cs#2)] - [!code-vb[Conceptual.Types.Dynamic#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.dynamic/vb/source2.vb#2)] - - Overload resolution is needed when more than one member with the same name is available. The and methods are used to resolve binding to a single member. **Binder.BindToMethod** also provides property resolution through the **get** and **set** property accessors. - - **BindToMethod** returns the to invoke, or a null reference (**Nothing** in Visual Basic) if no such invocation is possible. The **MethodBase** return value need not be one of those contained in the *match* parameter, although that is the usual case. - - When ByRef arguments are present, the caller might want to get them back. Therefore, **Binder** allows a client to map the array of arguments back to its original form if **BindToMethod** has manipulated the argument array. In order to do this, the caller must be guaranteed that the order of the arguments is unchanged. When arguments are passed by name, **Binder** reorders the argument array, and that is what the caller sees. For more information, see . - - The set of available members are those members defined in the type or any base type. If is specified, members of any accessibility will be returned in the set. If **BindingFlags.NonPublic** is not specified, the binder must enforce accessibility rules. When specifying the **Public** or **NonPublic** binding flag, you must also specify the **Instance** or **Static** binding flag, or no members will be returned. - - If there is only one member of the given name, no callback is necessary, and binding is done on that method. Case 1 of the code example illustrates this point: Only one **PrintBob** method is available, and therefore no callback is needed. - - If there is more than one member in the available set, all these methods are passed to **BindToMethod**, which selects the appropriate method and returns it. In Case 2 of the code example, there are two methods named **PrintValue**. The appropriate method is selected by the call to **BindToMethod**. - - performs argument coercion (type conversion), which converts the actual arguments to the type of the formal arguments of the selected method. **ChangeType** is called for every argument even if the types match exactly. - - In Case 3 of the code example, an actual argument of type **String** with a value of "5.5" is passed to a method with a formal argument of type **Double**. For the invocation to succeed, the string value "5.5" must be converted to a double value. **ChangeType** performs this conversion. - - **ChangeType** performs only lossless or [widening coercions](../../standard/base-types/type-conversion.md), as shown in the following table. - -|Source type|Target type| -|-----------------|-----------------| -|Any type|Its base type| -|Any type|Interface it implements| -|Char|UInt16, UInt32, Int32, UInt64, Int64, Single, Double| -|Byte|Char, UInt16, Int16, UInt32, Int32, UInt64, Int64, Single, Double| -|SByte|Int16, Int32, Int64, Single, Double| -|UInt16|UInt32, Int32, UInt64, Int64, Single, Double| -|Int16|Int32, Int64, Single, Double| -|UInt32|UInt64, Int64, Single, Double| -|Int32|Int64, Single, Double| -|UInt64|Single, Double| -|Int64|Single, Double| -|Single|Double| -|Nonreference type|Reference type| - - The class has **Get** methods that use parameters of type **Binder** to resolve references to a particular member. , , and search for a particular member of the current type by providing signature information for that member. and are called back on to select the given signature information of the appropriate methods. - -## See also - -- -- -- [Viewing Type Information](viewing-type-information.md) -- [Type Conversion in the .NET Framework](../../standard/base-types/type-conversion.md) diff --git a/docs/framework/reflection-and-codedom/emitting-dynamic-methods-and-assemblies.md b/docs/framework/reflection-and-codedom/emitting-dynamic-methods-and-assemblies.md deleted file mode 100644 index 36e09b0f6c5c5..0000000000000 --- a/docs/framework/reflection-and-codedom/emitting-dynamic-methods-and-assemblies.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: "Emitting Dynamic Methods and Assemblies" -description: Emit dynamic methods and assemblies using the System.Reflection.Emit namespace, which allows a compiler or tool to emit metadata and MSIL code at run time. -ms.date: "08/30/2017" -helpviewer_keywords: - - "reflection emit" - - "dynamic assemblies" - - "metadata, emit interfaces" - - "reflection emit, overview" - - "assemblies [.NET Framework], emitting dynamic assemblies" ---- -# Emitting Dynamic Methods and Assemblies - -This section describes a set of managed types in the namespace that allow a compiler or tool to emit metadata and Microsoft intermediate language (MSIL) at run time and optionally generate a portable executable (PE) file on disk. Script engines and compilers are the primary users of this namespace. In this section, the functionality provided by the namespace is referred to as reflection emit. - -Reflection emit provides the following capabilities: - -- Define lightweight global methods at run time, using the class, and execute them using delegates. - -- Define assemblies at run time and then run them and/or save them to disk. - -- Define assemblies at run time, run them, and then unload them and allow garbage collection to reclaim their resources. - -- Define modules in new assemblies at run time and then run and/or save them to disk. - -- Define types in modules at run time, create instances of these types, and invoke their methods. - -- Define symbolic information for defined modules that can be used by tools such as debuggers and code profilers. - -In addition to the managed types in the namespace, there are unmanaged metadata interfaces which are described in the [Metadata Interfaces](../unmanaged-api/metadata/metadata-interfaces.md) reference documentation. Managed reflection emit provides stronger semantic error checking and a higher level of abstraction of the metadata than the unmanaged metadata interfaces. - -Another useful resource for working with metadata and MSIL is the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics" and "Partition III: CIL Instruction Set". The documentation is available online at the [Ecma Web site](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/). - -## In This Section - -[Security issues in reflection emit](security-issues-in-reflection-emit.md) -Describes security issues related to creating dynamic assemblies using reflection emit. - -[How to: Define and execute dynamic methods](how-to-define-and-execute-dynamic-methods.md) -Shows how to execute a simple dynamic method and a dynamic method bound to an instance of a class. - -[How to: Define a generic type with reflection emit](how-to-define-a-generic-type-with-reflection-emit.md) -Shows how to create a simple generic type with two type parameters, how to apply class, interface, and special constraints to the type parameters, and how to create members that use the type parameters of the class as parameter types and return types. - -[How to: Define a generic method with reflection emit](how-to-define-a-generic-method-with-reflection-emit.md) -Shows how to create, emit, and invoke a simple generic method. - -[Collectible assemblies for dynamic type generation](collectible-assemblies.md) -Introduces collectible assemblies, which are dynamic assemblies that can be unloaded without unloading the application domain in which they were created. - -## Reference - - -Catalogs the MSIL instruction codes you can use to build method bodies. - - -Contains managed classes used to emit dynamic methods, assemblies, and types. - - -Describes the class, which represents types in managed reflection and reflection emit, and which is key to the use of these technologies. - - -Contains managed classes used to explore metadata and managed code. - -## Related Sections - -[Reflection](reflection.md) -Explains how to explore metadata and managed code. - -[Assemblies in .NET](../../standard/assembly/index.md) -Provides an overview of assemblies in .NET implementations. diff --git a/docs/framework/reflection-and-codedom/generating-and-compiling-source-code-from-a-codedom-graph.md b/docs/framework/reflection-and-codedom/generating-and-compiling-source-code-from-a-codedom-graph.md index 757812c9b5b89..782920824df6e 100644 --- a/docs/framework/reflection-and-codedom/generating-and-compiling-source-code-from-a-codedom-graph.md +++ b/docs/framework/reflection-and-codedom/generating-and-compiling-source-code-from-a-codedom-graph.md @@ -1,12 +1,12 @@ --- title: "Generating and Compiling Source Code from a CodeDOM Graph" description: Generate and compile source code from a CodeDOM graph in .NET. Use a CodeDOM code provider to generate source code and compile assemblies. -ms.date: "03/30/2017" -dev_langs: +ms.date: 03/27/2024 +dev_langs: - "csharp" - "vb" - "cpp" -helpviewer_keywords: +helpviewer_keywords: - "code compilers" - "CodeDOM, generating source code" - "Code Document Object Model, graphs" @@ -28,68 +28,68 @@ helpviewer_keywords: - "CodeDOM, graphs" ms.assetid: 6c864c8e-6dd3-4a65-ace0-36879d9a9c42 --- -# Generating and Compiling Source Code from a CodeDOM Graph - -The namespace provides interfaces for generating source code from CodeDOM object graphs and for managing compilation with supported compilers. A code provider can produce source code in a particular programming language according to a CodeDOM graph. A class that derives from can typically provide methods for generating and compiling code for the language the provider supports. - -## Using a CodeDOM code provider to generate source code - - To generate source code in a particular language, you need a CodeDOM graph that represents the structure of the source code to generate. - - The following example demonstrate how to create an instance of a : - - [!code-cpp[CodeDomExample#21](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source3.cpp#21)] - [!code-csharp[CodeDomExample#21](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source3.cs#21)] - [!code-vb[CodeDomExample#21](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source3.vb#21)] - - The graph for code generation is typically contained in a . To generate code for a **CodeCompileUnit** that contains a CodeDOM graph, call the method of the code provider. This method has a parameter for a that it uses to generate the source code, so it is sometimes necessary to first create a **TextWriter** that can be written to. The following example demonstrates generating code from a **CodeCompileUnit** and writing the generated source code to a file named HelloWorld.cs. - - [!code-cpp[CodeDomExample#22](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source3.cpp#22)] - [!code-csharp[CodeDomExample#22](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source3.cs#22)] - [!code-vb[CodeDomExample#22](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source3.vb#22)] - -## Using a CodeDOM code provider to compile assemblies - - **Invoking compilation** - - To compile an assembly using a CodeDom provider, you must have either source code to compile in a language for which you have a compiler, or a CodeDOM graph that source code to compile can be generated from. - - If you are compiling from a CodeDOM graph, pass the containing the graph to the method of the code provider. If you have a source code file in a language that the compiler understands, pass the name of the file containing the source code to the method of the CodeDom provider. You can also pass a string containing source code in a language that the compiler understands to the method of the CodeDom provider. - - **Configuring compilation parameters** - - All of the standard compilation-invoking methods of a CodeDom provider have a parameter of type that indicates the options to use for compilation. - - You can specify a file name for the output assembly in the property of the **CompilerParameters**. Otherwise, a default output file name will be used. - - By default, a new **CompilerParameters** is initialized with its property set to **false**. If you are compiling an executable program, you must set the **GenerateExecutable** property to **true**. When the **GenerateExecutable** is set to **false**, the compiler will generate a class library. - - If you are compiling an executable from a CodeDOM graph, a must be defined in the graph. If there are multiple code entry points, it may be necessary to set the property of the **CompilerParameters** to the name of the class that defines the entry point to use. - - To include debug information in a generated executable, set the property to **true**. - - If your project references any assemblies, you must specify the assembly names as items in a as the property of the **CompilerParameters** you use when invoking compilation. - - You can compile an assembly that is written to memory rather than disk by setting the property to **true**. When an assembly is generated in memory, your code can obtain a reference to the generated assembly from the property of a . If an assembly is written to disk, you can obtain the path to the generated assembly from the property of a **CompilerResults**. - - To specify a custom command-line arguments string to use when invoking the compilation process, set the string in the property. - - If a Win32 security token is required to invoke the compiler process, specify the token in the property. - - To link a Win32 resource file into the compiled assembly, specify the name of the Win32 resource file in the property. - - To specify a warning level at which to halt compilation, set the property to an integer that represents the warning level at which to halt compilation. You can also configure the compiler to halt compilation if warnings are encountered by setting the property to **true**. - - The following code example demonstrates compiling a source file using a CodeDom provider derived from the class. - - [!code-cpp[CodeDomExample#23](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source3.cpp#23)] - [!code-csharp[CodeDomExample#23](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source3.cs#23)] - [!code-vb[CodeDomExample#23](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source3.vb#23)] - -## Languages with Initial Support - - The .NET Framework provides code compilers and code generators for the following languages: C#, Visual Basic, C++, and JScript. CodeDOM support can be extended to other languages by implementing language-specific code generators and code compilers. - +# Generate and compile source code from a CodeDOM fraph + +The namespace provides interfaces for generating source code from CodeDOM object graphs and for managing compilation with supported compilers. A code provider can produce source code in a particular programming language according to a CodeDOM graph. A class that derives from can typically provide methods for generating and compiling code for the language the provider supports. + +## Use a CodeDOM code provider to generate source code + +To generate source code in a particular language, you need a CodeDOM graph that represents the structure of the source code to generate. + +The following example demonstrate how to create an instance of a : + +[!code-cpp[CodeDomExample#21](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source3.cpp#21)] +[!code-csharp[CodeDomExample#21](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source3.cs#21)] +[!code-vb[CodeDomExample#21](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source3.vb#21)] + +The graph for code generation is typically contained in a . To generate code for a `CodeCompileUnit` that contains a CodeDOM graph, call the method of the code provider. This method has a parameter for a that it uses to generate the source code, so it is sometimes necessary to first create a `TextWriter` that can be written to. The following example demonstrates generating code from a `CodeCompileUnit` and writing the generated source code to a file named HelloWorld.cs. + +[!code-cpp[CodeDomExample#22](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source3.cpp#22)] +[!code-csharp[CodeDomExample#22](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source3.cs#22)] +[!code-vb[CodeDomExample#22](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source3.vb#22)] + +## Use a CodeDOM code provider to compile assemblies + +### Invoke compilation + +To compile an assembly using a CodeDom provider, you must have either source code to compile in a language for which you have a compiler, or a CodeDOM graph that source code to compile can be generated from. + +If you are compiling from a CodeDOM graph, pass the containing the graph to the method of the code provider. If you have a source code file in a language that the compiler understands, pass the name of the file containing the source code to the method of the CodeDom provider. You can also pass a string containing source code in a language that the compiler understands to the method of the CodeDom provider. + +### Configure compilation parameters + +All of the standard compilation-invoking methods of a CodeDom provider have a parameter of type that indicates the options to use for compilation. + +You can specify a file name for the output assembly in the property of the `CompilerParameters`. Otherwise, a default output file name will be used. + +By default, a new `CompilerParameters` is initialized with its property set to `false`. If you are compiling an executable program, you must set the `GenerateExecutable` property to `true`. When the `GenerateExecutable` is set to `false`, the compiler will generate a class library. + +If you are compiling an executable from a CodeDOM graph, a must be defined in the graph. If there are multiple code entry points, it may be necessary to set the property of the `CompilerParameters` to the name of the class that defines the entry point to use. + +To include debug information in a generated executable, set the property to `true`. + +If your project references any assemblies, you must specify the assembly names as items in a as the property of the `CompilerParameters` you use when invoking compilation. + +You can compile an assembly that is written to memory rather than disk by setting the property to `true`. When an assembly is generated in memory, your code can obtain a reference to the generated assembly from the property of a . If an assembly is written to disk, you can obtain the path to the generated assembly from the property of a `CompilerResults`. + +To specify a custom command-line arguments string to use when invoking the compilation process, set the string in the property. + +If a Win32 security token is required to invoke the compiler process, specify the token in the property. + +To link a Win32 resource file into the compiled assembly, specify the name of the Win32 resource file in the property. + +To specify a warning level at which to halt compilation, set the property to an integer that represents the warning level at which to halt compilation. You can also configure the compiler to halt compilation if warnings are encountered by setting the property to `true`. + +The following code example demonstrates compiling a source file using a CodeDom provider derived from the class. + +[!code-cpp[CodeDomExample#23](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source3.cpp#23)] +[!code-csharp[CodeDomExample#23](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source3.cs#23)] +[!code-vb[CodeDomExample#23](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source3.vb#23)] + +## Languages with initial support + +.NET provides code compilers and code generators for the following languages: C#, Visual Basic, C++, and JScript. CodeDOM support can be extended to other languages by implementing language-specific code generators and code compilers. + ## See also - diff --git a/docs/framework/reflection-and-codedom/how-to-create-a-class-using-codedom.md b/docs/framework/reflection-and-codedom/how-to-create-a-class-using-codedom.md index 5d6a96b32b8d6..59b289d2edb67 100644 --- a/docs/framework/reflection-and-codedom/how-to-create-a-class-using-codedom.md +++ b/docs/framework/reflection-and-codedom/how-to-create-a-class-using-codedom.md @@ -2,10 +2,10 @@ title: "How to: Create a Class Using CodeDOM" description: See a detailed example that explains how to create a class using the Code Document Object Model (CodeDOM). ms.date: "03/30/2017" -dev_langs: +dev_langs: - "csharp" - "vb" -helpviewer_keywords: +helpviewer_keywords: - "Code Document Object Model, graphs" - "Code Document Object Model, creating classes" - "graphing with CodeDOM" @@ -13,106 +13,106 @@ helpviewer_keywords: - "CodeDOM, graphs" ms.assetid: 0ceb70fe-36e1-49bb-922b-e9f615c20a14 --- -# How to: Create a Class Using CodeDOM - -The following procedures illustrate how to create and compile a CodeDOM graph that generates a class containing two fields, three properties, a method, a constructor, and an entry point. - -1. Create a console application that will use CodeDOM code to generate the source code for a class. - - In this example, the generating class is named `Sample`, and the generated code is a class named `CodeDOMCreatedClass` in a file named SampleCode. - -2. In the generating class, initialize the CodeDOM graph and use CodeDOM methods to define the members, constructor, and entry point (`Main` method) of the generated class. - - In this example, the generated class has two fields, three properties, a constructor, a method, and a `Main` method. - -3. In the generating class, create a language-specific code provider and call its method to generate the code from the graph. - -4. Compile and execute the application to generate the code. - - In this example, the generated code is in a file named SampleCode. Compile and execute that code to see the sample output. - -### To create the application that will execute the CodeDOM code - -- Create a console application class to contain the CodeDOM code. Define the global fields that are to be used in the class to reference the assembly () and class (), specify the name of the generated source file, and declare the `Main` method. - - [!code-csharp[CodeDOM Class Sample Main#1](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample Main/CS/program.cs#1)] - [!code-vb[CodeDOM Class Sample Main#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample Main/VB/program.vb#1)] - -### To initialize the CodeDOM graph - -- In the constructor for the console application class, initialize the assembly and class, and add the appropriate declarations to the CodeDOM graph. - - [!code-csharp[CodeDOM Class Sample#2](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#2)] - [!code-vb[CodeDOM Class Sample#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#2)] - -### To add members to the CodeDOM graph - -- Add fields to the CodeDOM graph by adding objects to the property of the class. - - [!code-csharp[CodeDOM Class Sample#3](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#3)] - [!code-vb[CodeDOM Class Sample#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#3)] - -- Add properties to the CodeDOM graph by adding objects to the property of the class. - - [!code-csharp[CodeDOM Class Sample#4](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#4)] - [!code-vb[CodeDOM Class Sample#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#4)] - -- Add a method to the CodeDOM graph by adding a object to the property of the class. - - [!code-csharp[CodeDOM Class Sample#5](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#5)] - [!code-vb[CodeDOM Class Sample#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#5)] - -- Add a constructor to the CodeDOM graph by adding a object to the property of the class. - - [!code-csharp[CodeDOM Class Sample#6](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#6)] - [!code-vb[CodeDOM Class Sample#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#6)] - -- Add an entry point to the CodeDOM graph by adding a object to the property of the class. - - [!code-csharp[CodeDOM Class Sample#7](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#7)] - [!code-vb[CodeDOM Class Sample#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#7)] - -### To generate the code from the CodeDOM graph - -- Generate source code from the CodeDOM graph by calling the method. - - [!code-csharp[CodeDOM Class Sample#8](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#8)] - [!code-vb[CodeDOM Class Sample#8](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#8)] - -### To create the graph and generate the code - -1. Add the methods created in the preceding steps to the `Main` method defined in the first step. - - [!code-csharp[CodeDOM Class Sample#9](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#9)] - [!code-vb[CodeDOM Class Sample#9](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#9)] - -2. Compile and execute the generating class. - -## Example - - The following code example shows the code from the preceding steps. - - [!code-csharp[CodeDOM Class Sample#1](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#1)] - [!code-vb[CodeDOM Class Sample#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#1)] - - When the preceding example is compiled and executed, it produces the following source code. - - [!code-csharp[CodeDOM Class Sample#99](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/SampleCode.cs#99)] - [!code-vb[CodeDOM Class Sample#99](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/SampleCode.vb#99)] - - The generated source code produces the following output when compiled and executed. - +# How to: Create a class Using CodeDOM + +The following procedures illustrate how to create and compile a CodeDOM graph that generates a class containing two fields, three properties, a method, a constructor, and an entry point. + +1. Create a console application that will use CodeDOM code to generate the source code for a class. + + In this example, the generating class is named `Sample`, and the generated code is a class named `CodeDOMCreatedClass` in a file named SampleCode. + +2. In the generating class, initialize the CodeDOM graph and use CodeDOM methods to define the members, constructor, and entry point (`Main` method) of the generated class. + + In this example, the generated class has two fields, three properties, a constructor, a method, and a `Main` method. + +3. In the generating class, create a language-specific code provider and call its method to generate the code from the graph. + +4. Compile and execute the application to generate the code. + + In this example, the generated code is in a file named SampleCode. Compile and execute that code to see the sample output. + +## Create the application that will execute the CodeDOM code + +Create a console application class to contain the CodeDOM code. Define the global fields that are to be used in the class to reference the assembly () and class (), specify the name of the generated source file, and declare the `Main` method. + +[!code-csharp[CodeDOM Class Sample Main#1](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample Main/CS/program.cs#1)] +[!code-vb[CodeDOM Class Sample Main#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample Main/VB/program.vb#1)] + +### Initialize the CodeDOM graph + +In the constructor for the console application class, initialize the assembly and class, and add the appropriate declarations to the CodeDOM graph. + +[!code-csharp[CodeDOM Class Sample#2](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#2)] +[!code-vb[CodeDOM Class Sample#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#2)] + +### Add members to the CodeDOM graph + +- Add fields to the CodeDOM graph by adding objects to the property of the class. + + [!code-csharp[CodeDOM Class Sample#3](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#3)] + [!code-vb[CodeDOM Class Sample#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#3)] + +- Add properties to the CodeDOM graph by adding objects to the property of the class. + + [!code-csharp[CodeDOM Class Sample#4](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#4)] + [!code-vb[CodeDOM Class Sample#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#4)] + +- Add a method to the CodeDOM graph by adding a object to the property of the class. + + [!code-csharp[CodeDOM Class Sample#5](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#5)] + [!code-vb[CodeDOM Class Sample#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#5)] + +- Add a constructor to the CodeDOM graph by adding a object to the property of the class. + + [!code-csharp[CodeDOM Class Sample#6](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#6)] + [!code-vb[CodeDOM Class Sample#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#6)] + +- Add an entry point to the CodeDOM graph by adding a object to the property of the class. + + [!code-csharp[CodeDOM Class Sample#7](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#7)] + [!code-vb[CodeDOM Class Sample#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#7)] + +### Generate the code from the CodeDOM graph + +Generate source code from the CodeDOM graph by calling the method. + +[!code-csharp[CodeDOM Class Sample#8](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#8)] +[!code-vb[CodeDOM Class Sample#8](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#8)] + +### Create the graph and generate the code + +1. Add the methods created in the preceding steps to the `Main` method defined in the first step. + + [!code-csharp[CodeDOM Class Sample#9](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#9)] + [!code-vb[CodeDOM Class Sample#9](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#9)] + +2. Compile and execute the generating class. + +## Example + +The following code example shows the code from the preceding steps. + +[!code-csharp[CodeDOM Class Sample#1](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/program.cs#1)] +[!code-vb[CodeDOM Class Sample#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/program.vb#1)] + +When the preceding example is compiled and executed, it produces the following source code. + +[!code-csharp[CodeDOM Class Sample#99](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDOM Class Sample/CS/SampleCode.cs#99)] +[!code-vb[CodeDOM Class Sample#99](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/SampleCode.vb#99)] + +The generated source code produces the following output when compiled and executed. + ```output -The object: - width = 5.3, - height = 6.9, - area = 36.57 -``` - -## Compiling the Code - +The object: + width = 5.3, + height = 6.9, + area = 36.57 +``` + +## Compiling the Code + - This code example requires the `FullTrust` permission set to execute successfully. - + ## See also - [Using the CodeDOM](using-the-codedom.md) diff --git a/docs/framework/reflection-and-codedom/how-to-create-an-xml-documentation-file-using-codedom.md b/docs/framework/reflection-and-codedom/how-to-create-an-xml-documentation-file-using-codedom.md index 90f235f91c935..55e13d01812f4 100644 --- a/docs/framework/reflection-and-codedom/how-to-create-an-xml-documentation-file-using-codedom.md +++ b/docs/framework/reflection-and-codedom/how-to-create-an-xml-documentation-file-using-codedom.md @@ -2,10 +2,10 @@ title: "How to: Create an XML Documentation File Using CodeDOM" description: In this detailed example, see how to generate code that creates an XML documentation file using the Code Document Object Model (CodeDOM). ms.date: "03/30/2017" -dev_langs: +dev_langs: - "csharp" - "vb" -helpviewer_keywords: +helpviewer_keywords: - "CodeDOM, generating XML documentation" - "XML documentation, creating using CodeDOM" - "Code Document Object Model, generating XML documentation" @@ -13,69 +13,68 @@ ms.assetid: e3b80484-36b9-41dd-9d21-a2f9a36381dc --- # How to: Create an XML documentation file using CodeDOM -CodeDOM can be used to create code that generates XML documentation. The process involves creating the CodeDOM graph that contains the XML documentation comments, generating the code, and compiling the generated code with the compiler option that creates the XML documentation output. - +CodeDOM can be used to create code that generates XML documentation. The process involves creating the CodeDOM graph that contains the XML documentation comments, generating the code, and compiling the generated code with the compiler option that creates the XML documentation output. + ## Create a CodeDOM graph - -1. Create a containing the CodeDOM graph for the sample application. - -2. Use the constructor with the `docComment` parameter set to `true` to create the XML documentation comment elements and text. - - [!code-csharp[CodeDomHelloWorldSample#4](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomHelloWorldSample/cs/program.cs#4)] - [!code-vb[CodeDomHelloWorldSample#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomHelloWorldSample/vb/program.vb#4)] - + +1. Create a containing the CodeDOM graph for the sample application. + +2. Use the constructor with the `docComment` parameter set to `true` to create the XML documentation comment elements and text. + + [!code-csharp[CodeDomHelloWorldSample#4](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomHelloWorldSample/cs/program.cs#4)] + [!code-vb[CodeDomHelloWorldSample#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomHelloWorldSample/vb/program.vb#4)] + ### Generate the code from the CodeCompileUnit - -1. Use the method to generate the code and create a source file to be compiled. - - [!code-csharp[CodeDomHelloWorldSample#5](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomHelloWorldSample/cs/program.cs#5)] - [!code-vb[CodeDomHelloWorldSample#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomHelloWorldSample/vb/program.vb#5)] - + +Use the method to generate the code and create a source file to be compiled. + +[!code-csharp[CodeDomHelloWorldSample#5](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomHelloWorldSample/cs/program.cs#5)] +[!code-vb[CodeDomHelloWorldSample#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomHelloWorldSample/vb/program.vb#5)] + ### Compile the code and generate the documentation file - -1. Add the **/doc** compiler option to the property of a object and pass the object to the method to create the XML documentation file when the code is compiled. - - [!code-csharp[CodeDomHelloWorldSample#6](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomHelloWorldSample/cs/program.cs#6)] - [!code-vb[CodeDomHelloWorldSample#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomHelloWorldSample/vb/program.vb#6)] - + +Add the **/doc** compiler option to the property of a object and pass the object to the method to create the XML documentation file when the code is compiled. + +[!code-csharp[CodeDomHelloWorldSample#6](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomHelloWorldSample/cs/program.cs#6)] +[!code-vb[CodeDomHelloWorldSample#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomHelloWorldSample/vb/program.vb#6)] + ## Example -The following code example creates a CodeDOM graph with documentation comments, generates a code file from the graph, and compiles the file and creates an associated XML documentation file. - - [!code-csharp[CodeDomHelloWorldSample#1](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomHelloWorldSample/cs/program.cs#1)] - [!code-vb[CodeDomHelloWorldSample#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomHelloWorldSample/vb/program.vb#1)] - - The code example creates the following XML documentation in the *HelloWorldDoc.xml* file. - -```xml +The following code example creates a CodeDOM graph with documentation comments, generates a code file from the graph, and compiles the file and creates an associated XML documentation file. + +[!code-csharp[CodeDomHelloWorldSample#1](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomHelloWorldSample/cs/program.cs#1)] +[!code-vb[CodeDomHelloWorldSample#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomHelloWorldSample/vb/program.vb#1)] + +The code example creates the following XML documentation in the *HelloWorldDoc.xml* file. + +```xml - - + + HelloWorld - - - - + + + + Create a Hello World application. - - - + + + Main method for HelloWorld application. Add a new paragraph to the description. - - - - -``` - + + + + +``` + ## Compile permissions - + This code example requires the `FullTrust` permission set to execute successfully. - + ## See also - [Document your code with XML (Visual Basic)](../../visual-basic/programming-guide/program-structure/documenting-your-code-with-xml.md) - [XML documentation comments](../../csharp/language-reference/xmldoc/index.md) -- [XML documentation (C++)](/cpp/ide/xml-documentation-visual-cpp) diff --git a/docs/framework/reflection-and-codedom/how-to-define-a-generic-method-with-reflection-emit.md b/docs/framework/reflection-and-codedom/how-to-define-a-generic-method-with-reflection-emit.md deleted file mode 100644 index 4c5088e97de5f..0000000000000 --- a/docs/framework/reflection-and-codedom/how-to-define-a-generic-method-with-reflection-emit.md +++ /dev/null @@ -1,165 +0,0 @@ ---- -title: "How to: Define a Generic Method with Reflection Emit" -description: Define a generic method with reflection emit. One example creates a generic method with two type parameters. A second example shows how to emit the method body. -ms.date: "03/30/2017" -dev_langs: - - "csharp" - - "vb" -helpviewer_keywords: - - "generics [.NET Framework], reflection emit" - - "reflection emit, generic methods" - - "generics [.NET Framework], dynamic types" -ms.assetid: 93892fa4-90b3-4ec4-b147-4bec9880de2b ---- -# How to: Define a Generic Method with Reflection Emit - -The first procedure shows how to create a simple generic method with two type parameters, and how to apply class constraints, interface constraints, and special constraints to the type parameters. - -The second procedure shows how to emit the method body, and how to use the type parameters of the generic method to create instances of generic types and to call their methods. - -The third procedure shows how to invoke the generic method. - -> [!IMPORTANT] -> A method is not generic just because it belongs to a generic type and uses the type parameters of that type. A method is generic only if it has its own type parameter list. A generic method can appear on a nongeneric type, as in this example. For an example of a nongeneric method on a generic type, see [How to: Define a Generic Type with Reflection Emit](how-to-define-a-generic-type-with-reflection-emit.md). - -### To define a generic method - -1. Before beginning, it is useful to look at how the generic method appears when written using a high-level language. The following code is included in the example code for this topic, along with code to call the generic method. The method has two type parameters, `TInput` and `TOutput`, the second of which must be a reference type (`class`), must have a parameterless constructor (`new`), and must implement `ICollection(Of TInput)` (`ICollection` in C#). This interface constraint ensures that the method can be used to add elements to the `TOutput` collection that the method creates. The method has one formal parameter, `input`, which is an array of `TInput`. The method creates a collection of type `TOutput` and copies the elements of `input` to the collection. - - [!code-csharp[GenericMethodHowTo#20](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#20)] - [!code-vb[GenericMethodHowTo#20](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#20)] - -2. Define a dynamic assembly and a dynamic module to contain the type the generic method belongs to. In this case, the assembly has only one module, named `DemoMethodBuilder1`, and the module name is the same as the assembly name plus an extension. In this example, the assembly is saved to disk and also executed, so is specified. You can use the [Ildasm.exe (IL Disassembler)](../tools/ildasm-exe-il-disassembler.md) to examine DemoMethodBuilder1.dll and to compare it to the Microsoft intermediate language (MSIL) for the method shown in step 1. - - [!code-csharp[GenericMethodHowTo#2](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#2)] - [!code-vb[GenericMethodHowTo#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#2)] - -3. Define the type the generic method belongs to. The type does not have to be generic. A generic method can belong to either a generic or nongeneric type. In this example, the type is a class, is not generic, and is named `DemoType`. - - [!code-csharp[GenericMethodHowTo#3](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#3)] - [!code-vb[GenericMethodHowTo#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#3)] - -4. Define the generic method. If the types of a generic method's formal parameters are specified by generic type parameters of the generic method, use the method overload to define the method. The generic type parameters of the method are not yet defined, so you cannot specify the types of the method's formal parameters in the call to . In this example, the method is named `Factory`. The method is public and `static` (`Shared` in Visual Basic). - - [!code-csharp[GenericMethodHowTo#4](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#4)] - [!code-vb[GenericMethodHowTo#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#4)] - -5. Define the generic type parameters of `DemoMethod` by passing an array of strings containing the names of the parameters to the method. This makes the method a generic method. The following code makes `Factory` a generic method with type parameters `TInput` and `TOutput`. To make the code easier to read, variables with these names are created to hold the objects representing the two type parameters. - - [!code-csharp[GenericMethodHowTo#5](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#5)] - [!code-vb[GenericMethodHowTo#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#5)] - -6. Optionally add special constraints to the type parameters. Special constraints are added using the method. In this example, `TOutput` is constrained to be a reference type and to have a parameterless constructor. - - [!code-csharp[GenericMethodHowTo#6](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#6)] - [!code-vb[GenericMethodHowTo#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#6)] - -7. Optionally add class and interface constraints to the type parameters. In this example, type parameter `TOutput` is constrained to types that implement the `ICollection(Of TInput)` (`ICollection` in C#) interface. This ensures that the method can be used to add elements. - - [!code-csharp[GenericMethodHowTo#7](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#7)] - [!code-vb[GenericMethodHowTo#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#7)] - -8. Define the formal parameters of the method, using the method. In this example, the `Factory` method has one parameter, an array of `TInput`. This type is created by calling the method on the that represents `TInput`. The argument of is an array of objects. - - [!code-csharp[GenericMethodHowTo#8](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#8)] - [!code-vb[GenericMethodHowTo#8](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#8)] - -9. Define the return type for the method, using the method. In this example, an instance of `TOutput` is returned. - - [!code-csharp[GenericMethodHowTo#9](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#9)] - [!code-vb[GenericMethodHowTo#9](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#9)] - -10. Emit the method body, using . For details, see the accompanying procedure for emitting the method body. - - > [!IMPORTANT] - > When you emit calls to methods of generic types, and the type arguments of those types are type parameters of the generic method, you must use the `static`, , and method overloads of the class to obtain constructed forms of the methods. The accompanying procedure for emitting the method body demonstrates this. - -11. Complete the type that contains the method and save the assembly. The accompanying procedure for invoking the generic method shows two ways to invoke the completed method. - - [!code-csharp[GenericMethodHowTo#14](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#14)] - [!code-vb[GenericMethodHowTo#14](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#14)] - - - -### To emit the method body - -1. Get a code generator and declare local variables and labels. The method is used to declare local variables. The `Factory` method has four local variables: `retVal` to hold the new `TOutput` that is returned by the method, `ic` to hold the `TOutput` when it is cast to `ICollection(Of TInput)` (`ICollection` in C#), `input` to hold the input array of `TInput` objects, and `index` to iterate through the array. The method also has two labels, one to enter the loop (`enterLoop`) and one for the top of the loop (`loopAgain`), defined using the method. - - The first thing the method does is to load its argument using opcode and to store it in the local variable `input` using opcode. - - [!code-csharp[GenericMethodHowTo#10](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#10)] - [!code-vb[GenericMethodHowTo#10](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#10)] - -2. Emit code to create an instance of `TOutput`, using the generic method overload of the method. Using this overload requires the specified type to have a parameterless constructor, which is the reason for adding that constraint to `TOutput`. Create the constructed generic method by passing `TOutput` to . After emitting code to call the method, emit code to store it in the local variable `retVal` using - - [!code-csharp[GenericMethodHowTo#11](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#11)] - [!code-vb[GenericMethodHowTo#11](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#11)] - -3. Emit code to cast the new `TOutput` object to `ICollection(Of TInput)` and store it in the local variable `ic`. - - [!code-csharp[GenericMethodHowTo#31](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#31)] - [!code-vb[GenericMethodHowTo#31](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#31)] - -4. Get a representing the method. The method is acting on an `ICollection(Of TInput)` (`ICollection` in C#), so it is necessary to get the `Add` method specific to that constructed type. You cannot use the method to get this directly from `icollOfTInput`, because is not supported on a type that has been constructed with a . Instead, call on `icoll`, which contains the generic type definition for the generic interface. Then use the `static` method to produce the for the constructed type. The following code demonstrates this. - - [!code-csharp[GenericMethodHowTo#12](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#12)] - [!code-vb[GenericMethodHowTo#12](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#12)] - -5. Emit code to initialize the `index` variable, by loading a 32-bit integer 0 and storing it in the variable. Emit code to branch to the label `enterLoop`. This label has not yet been marked, because it is inside the loop. Code for the loop is emitted in the next step. - - [!code-csharp[GenericMethodHowTo#32](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#32)] - [!code-vb[GenericMethodHowTo#32](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#32)] - -6. Emit code for the loop. The first step is to mark the top of the loop, by calling with the `loopAgain` label. Branch statements that use the label will now branch to this point in the code. The next step is to push the `TOutput` object, cast to `ICollection(Of TInput)`, onto the stack. It is not needed immediately, but needs to be in position for calling the `Add` method. Next the input array is pushed onto the stack, then the `index` variable containing the current index into the array. The opcode pops the index and the array off the stack and pushes the indexed array element onto the stack. The stack is now ready for the call to the method, which pops the collection and the new element off the stack and adds the element to the collection. - - The rest of the code in the loop increments the index and tests to see whether the loop is finished: The index and a 32-bit integer 1 are pushed onto the stack and added, leaving the sum on the stack; the sum is stored in `index`. is called to set this point as the entry point for the loop. The index is loaded again. The input array is pushed on the stack, and is emitted to get its length. The index and the length are now on the stack, and is emitted to compare them. If the index is less than the length, branches back to the beginning of the loop. - - [!code-csharp[GenericMethodHowTo#13](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#13)] - [!code-vb[GenericMethodHowTo#13](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#13)] - -7. Emit code to push the `TOutput` object onto the stack and return from the method. The local variables `retVal` and `ic` both contain references to the new `TOutput`; `ic` is used only to access the method. - - [!code-csharp[GenericMethodHowTo#33](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#33)] - [!code-vb[GenericMethodHowTo#33](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#33)] - - - -### To invoke the generic method - -1. `Factory` is a generic method definition. In order to invoke it, you must assign types to its generic type parameters. Use the method to do this. The following code creates a constructed generic method, specifying for `TInput` and `List(Of String)` (`List` in C#) for `TOutput`, and displays a string representation of the method. - - [!code-csharp[GenericMethodHowTo#21](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#21)] - [!code-vb[GenericMethodHowTo#21](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#21)] - -2. To invoke the method late-bound, use the method. The following code creates an array of , containing as its only element an array of strings, and passes it as the argument list for the generic method. The first parameter of is a null reference because the method is `static`. The return value is cast to `List(Of String)`, and its first element is displayed. - - [!code-csharp[GenericMethodHowTo#22](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#22)] - [!code-vb[GenericMethodHowTo#22](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#22)] - -3. To invoke the method using a delegate, you must have a delegate that matches the signature of the constructed generic method. An easy way to do this is to create a generic delegate. The following code creates an instance of the generic delegate `D` defined in the example code, using the method overload, and invokes the delegate. Delegates perform better than late-bound calls. - - [!code-csharp[GenericMethodHowTo#23](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#23)] - [!code-vb[GenericMethodHowTo#23](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#23)] - -4. The emitted method can also be called from a program that refers to the saved assembly. - -## Example - -The following code example creates a nongeneric type, `DemoType`, with a generic method, `Factory`. This method has two generic type parameters, `TInput` to specify an input type and `TOutput` to specify an output type. The `TOutput` type parameter is constrained to implement `ICollection` (`ICollection(Of TInput)` in Visual Basic), to be a reference type, and to have a parameterless constructor. - -The method has one formal parameter, which is an array of `TInput`. The method returns an instance of `TOutput` that contains all the elements of the input array. `TOutput` can be any generic collection type that implements the generic interface. - -When the code is executed, the dynamic assembly is saved as DemoGenericMethod1.dll, and can be examined using the [Ildasm.exe (IL Disassembler)](../tools/ildasm-exe-il-disassembler.md). - -> [!NOTE] -> A good way to learn how to emit code is to write a Visual Basic, C#, or Visual C++ program that performs the task you are trying to emit, and use the disassembler to examine the MSIL produced by the compiler. - -The code example includes source code that is equivalent to the emitted method. The emitted method is invoked late-bound and also by using a generic delegate declared in the code example. - -[!code-csharp[GenericMethodHowTo#1](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#1)] -[!code-vb[GenericMethodHowTo#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#1)] - -## See also - -- -- [How to: Define a Generic Type with Reflection Emit](how-to-define-a-generic-type-with-reflection-emit.md) diff --git a/docs/framework/reflection-and-codedom/how-to-define-a-generic-type-with-reflection-emit.md b/docs/framework/reflection-and-codedom/how-to-define-a-generic-type-with-reflection-emit.md deleted file mode 100644 index c874213ff5fd4..0000000000000 --- a/docs/framework/reflection-and-codedom/how-to-define-a-generic-type-with-reflection-emit.md +++ /dev/null @@ -1,129 +0,0 @@ ---- -title: "How to: Define a Generic Type with Reflection Emit" -description: See how to define a generic type with reflection emit. Create a generic type with two type parameters, apply class constraints, interface constraints, and more. -ms.date: "03/30/2017" -dev_langs: - - "csharp" - - "vb" - - "cpp" -helpviewer_keywords: - - "generics [.NET Framework], reflection emit" - - "generics [.NET Framework], dynamic types" - - "reflection emit, generic types" -ms.assetid: 07d5f01a-7b5b-40ea-9b15-f21561098fe4 ---- -# How to: Define a Generic Type with Reflection Emit - -This topic shows how to create a simple generic type with two type parameters, how to apply class constraints, interface constraints, and special constraints to the type parameters, and how to create members that use the type parameters of the class as parameter types and return types. - -> [!IMPORTANT] -> A method is not generic just because it belongs to a generic type and uses the type parameters of that type. A method is generic only if it has its own type parameter list. Most methods on generic types are not generic, as in this example. For an example of emitting a generic method, see [How to: Define a Generic Method with Reflection Emit](how-to-define-a-generic-method-with-reflection-emit.md). - -### To define a generic type - -1. Define a dynamic assembly named `GenericEmitExample1`. In this example, the assembly is executed and saved to disk, so is specified. - - [!code-cpp[EmitGenericType#2](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#2)] - [!code-csharp[EmitGenericType#2](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#2)] - [!code-vb[EmitGenericType#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#2)] - -2. Define a dynamic module. An assembly is made up of executable modules. For a single-module assembly, the module name is the same as the assembly name, and the file name is the module name plus an extension. - - [!code-cpp[EmitGenericType#3](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#3)] - [!code-csharp[EmitGenericType#3](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#3)] - [!code-vb[EmitGenericType#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#3)] - -3. Define a class. In this example, the class is named `Sample`. - - [!code-cpp[EmitGenericType#4](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#4)] - [!code-csharp[EmitGenericType#4](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#4)] - [!code-vb[EmitGenericType#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#4)] - -4. Define the generic type parameters of `Sample` by passing an array of strings containing the names of the parameters to the method. This makes the class a generic type. The return value is an array of objects representing the type parameters, which can be used in your emitted code. - - In the following code, `Sample` becomes a generic type with type parameters `TFirst` and `TSecond`. To make the code easier to read, each is placed in a variable with the same name as the type parameter. - - [!code-cpp[EmitGenericType#5](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#5)] - [!code-csharp[EmitGenericType#5](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#5)] - [!code-vb[EmitGenericType#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#5)] - -5. Add special constraints to the type parameters. In this example, type parameter `TFirst` is constrained to types that have parameterless constructors, and to reference types. - - [!code-cpp[EmitGenericType#6](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#6)] - [!code-csharp[EmitGenericType#6](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#6)] - [!code-vb[EmitGenericType#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#6)] - -6. Optionally add class and interface constraints to the type parameters. In this example, type parameter `TFirst` is constrained to types that derive from the base class represented by the object contained in the variable `baseType`, and that implement the interfaces whose types are contained in the variables `interfaceA` and `interfaceB`. See the code example for the declaration and assignment of these variables. - - [!code-cpp[EmitGenericType#7](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#7)] - [!code-csharp[EmitGenericType#7](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#7)] - [!code-vb[EmitGenericType#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#7)] - -7. Define a field. In this example, the type of the field is specified by type parameter `TFirst`. derives from , so you can use generic type parameters anywhere a type can be used. - - [!code-cpp[EmitGenericType#21](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#21)] - [!code-csharp[EmitGenericType#21](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#21)] - [!code-vb[EmitGenericType#21](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#21)] - -8. Define a method that uses the type parameters of the generic type. Note that such methods are not generic unless they have their own type parameter lists. The following code defines a `static` method (`Shared` in Visual Basic) that takes an array of `TFirst` and returns a `List` (`List(Of TFirst)` in Visual Basic) containing all the elements of the array. To define this method, it is necessary to create the type `List` by calling on the generic type definition, `List`. (The `T` is omitted when you use the `typeof` operator (`GetType` in Visual Basic) to get the generic type definition.) The parameter type is created by using the method. - - [!code-cpp[EmitGenericType#22](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#22)] - [!code-csharp[EmitGenericType#22](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#22)] - [!code-vb[EmitGenericType#22](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#22)] - -9. Emit the method body. The method body consists of three opcodes that load the input array onto the stack, call the `List` constructor that takes `IEnumerable` (which does all the work of putting the input elements into the list), and return (leaving the new object on the stack). The difficult part of emitting this code is getting the constructor. - - The method is not supported on a , so it is not possible to get the constructor of `List` directly. First, it is necessary to get the constructor of the generic type definition `List` and then to call a method that converts it to the corresponding constructor of `List`. - - The constructor used for this code example takes an `IEnumerable`. Note, however, that this is not the generic type definition of the generic interface; instead, the type parameter `T` from `List` must be substituted for the type parameter `T` of `IEnumerable`. (This seems confusing only because both types have type parameters named `T`. That is why this code example uses the names `TFirst` and `TSecond`.) To get the type of the constructor argument, start with the generic type definition `IEnumerable` and call with the first generic type parameter of `List`. The constructor argument list must be passed as an array, with just one argument in this case. - - > [!NOTE] - > The generic type definition is expressed as `IEnumerable<>` when you use the `typeof` operator in C#, or `IEnumerable(Of )` when you use the `GetType` operator in Visual Basic. - - Now it is possible to get the constructor of `List` by calling on the generic type definition. To convert this constructor to the corresponding constructor of `List`, pass `List` and the constructor from `List` to the static method. - - [!code-cpp[EmitGenericType#23](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#23)] - [!code-csharp[EmitGenericType#23](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#23)] - [!code-vb[EmitGenericType#23](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#23)] - -10. Create the type and save the file. - - [!code-cpp[EmitGenericType#8](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#8)] - [!code-csharp[EmitGenericType#8](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#8)] - [!code-vb[EmitGenericType#8](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#8)] - -11. Invoke the method. `ExampleMethod` is not generic, but the type it belongs to is generic, so in order to get a that can be invoked it is necessary to create a constructed type from the type definition for `Sample`. The constructed type uses the `Example` class, which satisfies the constraints on `TFirst` because it is a reference type and has a default parameterless constructor, and the `ExampleDerived` class which satisfies the constraints on `TSecond`. (The code for `ExampleDerived` can be found in the example code section.) These two types are passed to to create the constructed type. The is then obtained using the method. - - [!code-cpp[EmitGenericType#9](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#9)] - [!code-csharp[EmitGenericType#9](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#9)] - [!code-vb[EmitGenericType#9](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#9)] - -12. The following code creates an array of `Example` objects, places that array in an array of type representing the arguments of the method to be invoked, and passes them to the method. The first argument of the method is a null reference because the method is `static`. - - [!code-cpp[EmitGenericType#10](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#10)] - [!code-csharp[EmitGenericType#10](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#10)] - [!code-vb[EmitGenericType#10](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#10)] - -## Example - - The following code example defines a class named `Sample`, along with a base class and two interfaces. The program defines two generic type parameters for `Sample`, turning it into a generic type. Type parameters are the only thing that makes a type generic. The program shows this by displaying a test message before and after the definition of the type parameters. - - The type parameter `TSecond` is used to demonstrate class and interface constraints, using the base class and interfaces, and the type parameter `TFirst` is used to demonstrate special constraints. - - The code example defines a field and a method using the class's type parameters for the field type and for the parameter and return type of the method. - - After the `Sample` class has been created, the method is invoked. - - The program includes a method that lists information about a generic type, and a method that lists the special constraints on a type parameter. These methods are used to display information about the finished `Sample` class. - - The program saves the finished module to disk as `GenericEmitExample1.dll`, so you can open it with the [Ildasm.exe (IL Disassembler)](../tools/ildasm-exe-il-disassembler.md) and examine the MSIL for the `Sample` class. - - [!code-cpp[EmitGenericType#1](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#1)] - [!code-csharp[EmitGenericType#1](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#1)] - [!code-vb[EmitGenericType#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#1)] - -## See also - -- -- [Using Reflection Emit](/previous-versions/dotnet/netframework-4.0/3y322t50(v=vs.100)) -- [Reflection Emit Dynamic Assembly Scenarios](/previous-versions/dotnet/netframework-4.0/tt9483fk(v=vs.100)) diff --git a/docs/framework/reflection-and-codedom/how-to-define-and-execute-dynamic-methods.md b/docs/framework/reflection-and-codedom/how-to-define-and-execute-dynamic-methods.md deleted file mode 100644 index 6142196ae1310..0000000000000 --- a/docs/framework/reflection-and-codedom/how-to-define-and-execute-dynamic-methods.md +++ /dev/null @@ -1,116 +0,0 @@ ---- -title: "How to: Define and Execute Dynamic Methods" -description: See how to define and execute dynamic methods in .NET. View examples of a simple dynamic method and a dynamic method bound to an instance of a class. -ms.date: "03/30/2017" -dev_langs: - - "csharp" - - "vb" - - "cpp" -helpviewer_keywords: - - "reflection emit, dynamic methods" - - "dynamic methods" -ms.assetid: 07d08a99-62c5-4254-bce2-2a75e55a18ab ---- -# How to: Define and Execute Dynamic Methods - -The following procedures show how to define and execute a simple dynamic method and a dynamic method bound to an instance of a class. For more information on dynamic methods, see the class and [Reflection Emit Dynamic Method Scenarios](/previous-versions/dotnet/netframework-4.0/sfk2s47t(v=vs.100)). - -### To define and execute a dynamic method - -1. Declare a delegate type to execute the method. Consider using a generic delegate to minimize the number of delegate types you need to declare. The following code declares two delegate types that could be used for the `SquareIt` method, and one of them is generic. - - [!code-cpp[DynamicMethodHowTo#2](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#2)] - [!code-csharp[DynamicMethodHowTo#2](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#2)] - [!code-vb[DynamicMethodHowTo#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#2)] - -2. Create an array that specifies the parameter types for the dynamic method. In this example, the only parameter is an `int` (`Integer` in Visual Basic), so the array has only one element. - - [!code-cpp[DynamicMethodHowTo#3](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#3)] - [!code-csharp[DynamicMethodHowTo#3](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#3)] - [!code-vb[DynamicMethodHowTo#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#3)] - -3. Create a . In this example the method is named `SquareIt`. - - > [!NOTE] - > It is not necessary to give dynamic methods names, and they cannot be invoked by name. Multiple dynamic methods can have the same name. However, the name appears in call stacks and can be useful for debugging. - - The type of the return value is specified as `long`. The method is associated with the module that contains the `Example` class, which contains the example code. Any loaded module could be specified. The dynamic method acts like a module-level `static` method (`Shared` in Visual Basic). - - [!code-cpp[DynamicMethodHowTo#4](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#4)] - [!code-csharp[DynamicMethodHowTo#4](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#4)] - [!code-vb[DynamicMethodHowTo#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#4)] - -4. Emit the method body. In this example, an object is used to emit the Microsoft intermediate language (MSIL). Alternatively, a object can be used in conjunction with unmanaged code generators to emit the method body for a . - - The MSIL in this example loads the argument, which is an `int`, onto the stack, converts it to a `long`, duplicates the `long`, and multiplies the two numbers. This leaves the squared result on the stack, and all the method has to do is return. - - [!code-cpp[DynamicMethodHowTo#5](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#5)] - [!code-csharp[DynamicMethodHowTo#5](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#5)] - [!code-vb[DynamicMethodHowTo#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#5)] - -5. Create an instance of the delegate (declared in step 1) that represents the dynamic method by calling the method. Creating the delegate completes the method, and any further attempts to change the method — for example, adding more MSIL — are ignored. The following code creates the delegate and invokes it, using a generic delegate. - - [!code-cpp[DynamicMethodHowTo#6](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#6)] - [!code-csharp[DynamicMethodHowTo#6](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#6)] - [!code-vb[DynamicMethodHowTo#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#6)] - -### To define and execute a dynamic method that is bound to an object - -1. Declare a delegate type to execute the method. Consider using a generic delegate to minimize the number of delegate types you need to declare. The following code declares a generic delegate type that can be used to execute any method with one parameter and a return value, or a method with two parameters and a return value if the delegate is bound to an object. - - [!code-cpp[DynamicMethodHowTo#12](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#12)] - [!code-csharp[DynamicMethodHowTo#12](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#12)] - [!code-vb[DynamicMethodHowTo#12](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#12)] - -2. Create an array that specifies the parameter types for the dynamic method. If the delegate representing the method is to be bound to an object, the first parameter must match the type the delegate is bound to. In this example, there are two parameters, of type `Example` and type `int` (`Integer` in Visual Basic). - - [!code-cpp[DynamicMethodHowTo#13](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#13)] - [!code-csharp[DynamicMethodHowTo#13](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#13)] - [!code-vb[DynamicMethodHowTo#13](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#13)] - -3. Create a . In this example the method has no name. The type of the return value is specified as `int` (`Integer` in Visual Basic). The method has access to the private and protected members of the `Example` class. - - [!code-cpp[DynamicMethodHowTo#14](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#14)] - [!code-csharp[DynamicMethodHowTo#14](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#14)] - [!code-vb[DynamicMethodHowTo#14](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#14)] - -4. Emit the method body. In this example, an object is used to emit the Microsoft intermediate language (MSIL). Alternatively, a object can be used in conjunction with unmanaged code generators to emit the method body for a . - - The MSIL in this example loads the first argument, which is an instance of the `Example` class, and uses it to load the value of a private instance field of type `int`. The second argument is loaded, and the two numbers are multiplied. If the result is larger than `int`, the value is truncated and the most significant bits are discarded. The method returns, with the return value on the stack. - - [!code-cpp[DynamicMethodHowTo#15](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#15)] - [!code-csharp[DynamicMethodHowTo#15](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#15)] - [!code-vb[DynamicMethodHowTo#15](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#15)] - -5. Create an instance of the delegate (declared in step 1) that represents the dynamic method by calling the method overload. Creating the delegate completes the method, and any further attempts to change the method — for example, adding more MSIL — are ignored. - - > [!NOTE] - > You can call the method multiple times to create delegates bound to other instances of the target type. - - The following code binds the method to a new instance of the `Example` class whose private test field is set to 42. That is, each time the delegate is invoked the instance of `Example` is passed to the first parameter of the method. - - The delegate `OneParameter` is used because the first parameter of the method always receives the instance of `Example`. When the delegate is invoked, only the second parameter is required. - - [!code-cpp[DynamicMethodHowTo#16](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#16)] - [!code-csharp[DynamicMethodHowTo#16](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#16)] - [!code-vb[DynamicMethodHowTo#16](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#16)] - -## Example - - The following code example demonstrates a simple dynamic method and a dynamic method bound to an instance of a class. - - The simple dynamic method takes one argument, a 32-bit integer, and returns the 64-bit square of that integer. A generic delegate is used to invoke the method. - - The second dynamic method has two parameters, of type `Example` and type `int` (`Integer` in Visual Basic). When the dynamic method has been created, it is bound to an instance of `Example`, using a generic delegate that has one argument of type `int`. The delegate does not have an argument of type `Example` because the first parameter of the method always receives the bound instance of `Example`. When the delegate is invoked, only the `int` argument is supplied. This dynamic method accesses a private field of the `Example` class and returns the product of the private field and the `int` argument. - - The code example defines delegates that can be used to execute the methods. - - [!code-cpp[DynamicMethodHowTo#1](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#1)] - [!code-csharp[DynamicMethodHowTo#1](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#1)] - [!code-vb[DynamicMethodHowTo#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#1)] - -## See also - -- -- [Using Reflection Emit](/previous-versions/dotnet/netframework-4.0/3y322t50(v=vs.100)) -- [Reflection Emit Dynamic Method Scenarios](/previous-versions/dotnet/netframework-4.0/sfk2s47t(v=vs.100)) diff --git a/docs/framework/reflection-and-codedom/how-to-examine-and-instantiate-generic-types-with-reflection.md b/docs/framework/reflection-and-codedom/how-to-examine-and-instantiate-generic-types-with-reflection.md deleted file mode 100644 index e08de60601e43..0000000000000 --- a/docs/framework/reflection-and-codedom/how-to-examine-and-instantiate-generic-types-with-reflection.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: "How to: Examine and Instantiate Generic Types with Reflection" -description: See how to examine and instantiate generic types with reflection. Use the IsGenericType, IsGenericParameter, and GenericParameterPosition properties. -ms.date: "03/30/2017" -dev_langs: - - "csharp" - - "vb" - - "cpp" -helpviewer_keywords: - - "reflection, generic types" - - "generics [.NET Framework], reflection" -ms.assetid: f93b03b0-1778-43fc-bc6d-35983d210e74 ---- -# How to: Examine and Instantiate Generic Types with Reflection - -Information about generic types is obtained in the same way as information about other types: by examining a object that represents the generic type. The principle difference is that a generic type has a list of objects representing its generic type parameters. The first procedure in this section examines generic types. - - You can create a object that represents a constructed type by binding type arguments to the type parameters of a generic type definition. The second procedure demonstrates this. - -### To examine a generic type and its type parameters - -1. Get an instance of that represents the generic type. In the following code, the type is obtained using the C# `typeof` operator (`GetType` in Visual Basic, `typeid` in Visual C++). See the class topic for other ways to get a object. Note that in the rest of this procedure, the type is contained in a method parameter named `t`. - - [!code-cpp[HowToGeneric#2](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#2)] - [!code-csharp[HowToGeneric#2](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#2)] - [!code-vb[HowToGeneric#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#2)] - -2. Use the property to determine whether the type is generic, and use the property to determine whether the type is a generic type definition. - - [!code-cpp[HowToGeneric#3](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#3)] - [!code-csharp[HowToGeneric#3](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#3)] - [!code-vb[HowToGeneric#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#3)] - -3. Get an array that contains the generic type arguments, using the method. - - [!code-cpp[HowToGeneric#4](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#4)] - [!code-csharp[HowToGeneric#4](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#4)] - [!code-vb[HowToGeneric#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#4)] - -4. For each type argument, determine whether it is a type parameter (for example, in a generic type definition) or a type that has been specified for a type parameter (for example, in a constructed type), using the property. - - [!code-cpp[HowToGeneric#5](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#5)] - [!code-csharp[HowToGeneric#5](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#5)] - [!code-vb[HowToGeneric#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#5)] - -5. In the type system, a generic type parameter is represented by an instance of , just as ordinary types are. The following code displays the name and parameter position of a object that represents a generic type parameter. The parameter position is trivial information here; it is of more interest when you are examining a type parameter that has been used as a type argument of another generic type. - - [!code-cpp[HowToGeneric#6](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#6)] - [!code-csharp[HowToGeneric#6](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#6)] - [!code-vb[HowToGeneric#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#6)] - -6. Determine the base type constraint and the interface constraints of a generic type parameter by using the method to obtain all the constraints in a single array. Constraints are not guaranteed to be in any particular order. - - [!code-cpp[HowToGeneric#7](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#7)] - [!code-csharp[HowToGeneric#7](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#7)] - [!code-vb[HowToGeneric#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#7)] - -7. Use the property to discover the special constraints on a type parameter, such as requiring that it be a reference type. The property also includes values that represent variance, which you can mask off as shown in the following code. - - [!code-cpp[HowToGeneric#8](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#8)] - [!code-csharp[HowToGeneric#8](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#8)] - [!code-vb[HowToGeneric#8](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#8)] - -8. The special constraint attributes are flags, and the same flag () that represents no special constraints also represents no covariance or contravariance. Thus, to test for either of these conditions you must use the appropriate mask. In this case, use to isolate the special constraint flags. - - [!code-cpp[HowToGeneric#9](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#9)] - [!code-csharp[HowToGeneric#9](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#9)] - [!code-vb[HowToGeneric#9](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#9)] - -## Constructing an Instance of a Generic Type - - A generic type is like a template. You cannot create instances of it unless you specify real types for its generic type parameters. To do this at run time, using reflection, requires the method. - -#### To construct an instance of a generic type - -1. Get a object that represents the generic type. The following code gets the generic type in two different ways: by using the method overload with a string describing the type, and by calling the method on the constructed type `Dictionary\` (`Dictionary(Of String, Example)` in Visual Basic). The method requires a generic type definition. - - [!code-cpp[HowToGeneric#10](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#10)] - [!code-csharp[HowToGeneric#10](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#10)] - [!code-vb[HowToGeneric#10](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#10)] - -2. Construct an array of type arguments to substitute for the type parameters. The array must contain the correct number of objects, in the same order as they appear in the type parameter list. In this case, the key (first type parameter) is of type , and the values in the dictionary are instances of a class named `Example`. - - [!code-cpp[HowToGeneric#11](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#11)] - [!code-csharp[HowToGeneric#11](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#11)] - [!code-vb[HowToGeneric#11](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#11)] - -3. Call the method to bind the type arguments to the type parameters and construct the type. - - [!code-cpp[HowToGeneric#12](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#12)] - [!code-csharp[HowToGeneric#12](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#12)] - [!code-vb[HowToGeneric#12](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#12)] - -4. Use the method overload to create an object of the constructed type. The following code stores two instances of the `Example` class in the resulting `Dictionary` object. - - [!code-cpp[HowToGeneric#13](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#13)] - [!code-csharp[HowToGeneric#13](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#13)] - [!code-vb[HowToGeneric#13](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#13)] - -## Example - - The following code example defines a `DisplayGenericType` method to examine the generic type definitions and constructed types used in the code and display their information. The `DisplayGenericType` method shows how to use the , , and properties and the method. - - The example also defines a `DisplayGenericParameter` method to examine a generic type parameter and display its constraints. - - The code example defines a set of test types, including a generic type that illustrates type parameter constraints, and shows how to display information about these types. - - The example constructs a type from the class by creating an array of type arguments and calling the method. The program compares the object constructed using with a object obtained using `typeof` (`GetType` in Visual Basic), demonstrating that they are the same. Similarly, the program uses the method to obtain the generic type definition of the constructed type, and compares it to the object representing the class. - - [!code-cpp[HowToGeneric#1](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#1)] - [!code-csharp[HowToGeneric#1](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#1)] - [!code-vb[HowToGeneric#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#1)] - -## See also - -- -- -- [Reflection and Generic Types](reflection-and-generic-types.md) -- [Viewing Type Information](viewing-type-information.md) -- [Generics](../../standard/generics/index.md) diff --git a/docs/framework/reflection-and-codedom/how-to-hook-up-a-delegate-using-reflection.md b/docs/framework/reflection-and-codedom/how-to-hook-up-a-delegate-using-reflection.md deleted file mode 100644 index 87a24e2ccfbe2..0000000000000 --- a/docs/framework/reflection-and-codedom/how-to-hook-up-a-delegate-using-reflection.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: "How to: Hook Up a Delegate Using Reflection" -description: See how to hook up a delegate using reflection in .NET. Connect an existing method to an event by getting the necessary types through reflection. -ms.date: "03/30/2017" -dev_langs: - - "csharp" - - "vb" - - "cpp" -helpviewer_keywords: - - "events [.NET Framework], adding event handlers with reflection" - - "reflection, adding event-handler delegates" - - "delegates [.NET Framework], adding event handlers with reflection" -ms.assetid: 076ee62d-a964-449e-a447-c31b33518b81 ---- -# How to: Hook Up a Delegate Using Reflection - -When you use reflection to load and run assemblies, you cannot use language features like the C# `+=` operator or the Visual Basic [AddHandler statement](../../visual-basic/language-reference/statements/addhandler-statement.md) to hook up events. The following procedures show how to hook up an existing method to an event by getting all the necessary types through reflection, and how to create a dynamic method using reflection emit and hook it up to an event. - -> [!NOTE] -> For another way to hook up an event-handling delegate, see the code example for the method of the class. - -### To hook up a delegate using reflection - -1. Load an assembly that contains a type that raises events. Assemblies are usually loaded with the method. To keep this example simple, a derived form in the current assembly is used, so the method is used to load the current assembly. - - [!code-cpp[HookUpDelegate#3](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#3)] - [!code-csharp[HookUpDelegate#3](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#3)] - [!code-vb[HookUpDelegate#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#3)] - -2. Get a object representing the type, and create an instance of the type. The method is used in the following code because the form has a parameterless constructor. There are several other overloads of the method that you can use if the type you are creating does not have a parameterless constructor. The new instance is stored as type to maintain the fiction that nothing is known about the assembly. (Reflection allows you to get the types in an assembly without knowing their names in advance.) - - [!code-cpp[HookUpDelegate#4](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#4)] - [!code-csharp[HookUpDelegate#4](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#4)] - [!code-vb[HookUpDelegate#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#4)] - -3. Get an object representing the event, and use the property to get the type of delegate used to handle the event. In the following code, an for the event is obtained. - - [!code-cpp[HookUpDelegate#5](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#5)] - [!code-csharp[HookUpDelegate#5](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#5)] - [!code-vb[HookUpDelegate#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#5)] - -4. Get a object representing the method that handles the event. The complete program code in the Example section later in this topic contains a method that matches the signature of the delegate, which handles the event, but you can also generate dynamic methods at run time. For details, see the accompanying procedure, for generating an event handler at run time by using a dynamic method. - - [!code-cpp[HookUpDelegate#6](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#6)] - [!code-csharp[HookUpDelegate#6](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#6)] - [!code-vb[HookUpDelegate#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#6)] - -5. Create an instance of the delegate, using the method. This method is static (`Shared` in Visual Basic), so the delegate type must be supplied. Using the overloads of that take a is recommended. - - [!code-cpp[HookUpDelegate#7](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#7)] - [!code-csharp[HookUpDelegate#7](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#7)] - [!code-vb[HookUpDelegate#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#7)] - -6. Get the `add` accessor method and invoke it to hook up the event. All events have an `add` accessor and a `remove` accessor, which are hidden by the syntax of high-level languages. For example, C# uses the `+=` operator to hook up events, and Visual Basic uses the [AddHandler statement](../../visual-basic/language-reference/statements/addhandler-statement.md). The following code gets the `add` accessor of the event and invokes it late-bound, passing in the delegate instance. The arguments must be passed as an array. - - [!code-cpp[HookUpDelegate#8](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#8)] - [!code-csharp[HookUpDelegate#8](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#8)] - [!code-vb[HookUpDelegate#8](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#8)] - -7. Test the event. The following code shows the form defined in the code example. Clicking the form invokes the event handler. - - [!code-cpp[HookUpDelegate#12](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#12)] - [!code-csharp[HookUpDelegate#12](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#12)] - [!code-vb[HookUpDelegate#12](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#12)] - - - -### To generate an event handler at run time by using a dynamic method - -1. Event-handler methods can be generated at run time, using lightweight dynamic methods and reflection emit. To construct an event handler, you need the return type and parameter types of the delegate. These can be obtained by examining the delegate's `Invoke` method. The following code uses the `GetDelegateReturnType` and `GetDelegateParameterTypes` methods to obtain this information. The code for these methods can be found in the Example section later in this topic. - - It is not necessary to name a , so the empty string can be used. In the following code, the last argument associates the dynamic method with the current type, giving the delegate access to all the public and private members of the `Example` class. - - [!code-cpp[HookUpDelegate#9](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#9)] - [!code-csharp[HookUpDelegate#9](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#9)] - [!code-vb[HookUpDelegate#9](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#9)] - -2. Generate a method body. This method loads a string, calls the overload of the method that takes a string, pops the return value off the stack (because the handler has no return type), and returns. To learn more about emitting dynamic methods, see [How to: Define and Execute Dynamic Methods](how-to-define-and-execute-dynamic-methods.md). - - [!code-cpp[HookUpDelegate#10](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#10)] - [!code-csharp[HookUpDelegate#10](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#10)] - [!code-vb[HookUpDelegate#10](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#10)] - -3. Complete the dynamic method by calling its method. Use the `add` accessor to add the delegate to the invocation list for the event. - - [!code-cpp[HookUpDelegate#11](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#11)] - [!code-csharp[HookUpDelegate#11](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#11)] - [!code-vb[HookUpDelegate#11](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#11)] - -4. Test the event. The following code loads the form defined in the code example. Clicking the form invokes both the predefined event handler and the emitted event handler. - - [!code-cpp[HookUpDelegate#12](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#12)] - [!code-csharp[HookUpDelegate#12](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#12)] - [!code-vb[HookUpDelegate#12](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#12)] - -## Example - - The following code example shows how to hook up an existing method to an event using reflection, and also how to use the class to emit a method at run time and hook it up to an event. - - [!code-cpp[HookUpDelegate#1](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#1)] - [!code-csharp[HookUpDelegate#1](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#1)] - [!code-vb[HookUpDelegate#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#1)] - -## See also - -- -- -- -- -- [How to: Define and Execute Dynamic Methods](how-to-define-and-execute-dynamic-methods.md) -- [Reflection](reflection.md) diff --git a/docs/framework/reflection-and-codedom/how-to-load-assemblies-into-the-reflection-only-context.md b/docs/framework/reflection-and-codedom/how-to-load-assemblies-into-the-reflection-only-context.md index 97fbb08e20f47..690f7cf7e95ed 100644 --- a/docs/framework/reflection-and-codedom/how-to-load-assemblies-into-the-reflection-only-context.md +++ b/docs/framework/reflection-and-codedom/how-to-load-assemblies-into-the-reflection-only-context.md @@ -1,7 +1,7 @@ --- title: "How to: Load Assemblies into the Reflection-Only Context" description: View an example of how to load assemblies into the reflection-only context in .NET. Examine assemblies compiled for other platforms or .NET versions. -ms.date: "03/30/2017" +ms.date: 03/27/2024 dev_langs: - "csharp" - "vb" @@ -14,16 +14,16 @@ helpviewer_keywords: - "reflection-only loader context" ms.assetid: 9818b660-52f5-423d-a9af-e75163aa7068 --- -# How to: Load Assemblies into the Reflection-Only Context +# How to: Load assemblies into the reflection-only context -The reflection-only load context allows you to examine assemblies compiled for other platforms or for other versions of the .NET Framework. Code loaded into this context can only be examined; it cannot be executed. This means that objects cannot be created, because constructors cannot be executed. Because the code cannot be executed, dependencies are not automatically loaded. If you need to examine them, you must load them yourself. +The reflection-only load context allows you to examine assemblies compiled for other platforms or for other versions of .NET. Code loaded into this context can only be examined; it can't be executed. This means that objects can't be created, because constructors can't be executed. Because the code can't be executed, dependencies are not automatically loaded. If you need to examine them, you must load them yourself. ## To load an assembly into the reflection-only load context 1. Use the method overload to load the assembly given its display name, or the method to load the assembly given its path. If the assembly is a binary image, use the method overload. > [!NOTE] - > You cannot use the reflection-only context to load a version of mscorlib.dll from a version of the .NET Framework other than the version in the execution context. + > You can't use the reflection-only context to load a version of mscorlib.dll from a version of the .NET Framework other than the version in the execution context. 2. If the assembly has dependencies, the method does not load them. If you need to examine them, you must load them yourself. diff --git a/docs/framework/reflection-and-codedom/index.md b/docs/framework/reflection-and-codedom/index.md deleted file mode 100644 index d3414e98ac4f5..0000000000000 --- a/docs/framework/reflection-and-codedom/index.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: "Dynamic Programming in the .NET Framework" -description: See links to articles about dynamic programming in .NET. The articles cover reflection, emitting dynamic methods and assemblies, and more. -ms.date: "03/30/2017" -helpviewer_keywords: - - ".NET Framework, dynamic programming" - - "dynamic programming [.NET Framework]" -ms.assetid: f78ec137-df0e-48c9-a7a0-5f6a1055f011 ---- -# Dynamic Programming in the .NET Framework - -This section of the documentation provides information about dynamic programming in the .NET Framework. - -## In This Section - - [Reflection](reflection.md) - Describes how to use reflection to work with objects at run time. - - [Emitting Dynamic Methods and Assemblies](emitting-dynamic-methods-and-assemblies.md) - Describes how to create methods and assemblies at run time by using Reflection.Emit. - - [Dynamic Language Runtime Overview](dynamic-language-runtime-overview.md) - Describes the features of the dynamic language runtime. - - [Dynamic Source Code Generation and Compilation](dynamic-source-code-generation-and-compilation.md) - Describes how to generate and compile dynamic source code. - -## Related Sections - - [Development Guide](../development-guide.md) diff --git a/docs/framework/reflection-and-codedom/media/dlr-archoverview.png b/docs/framework/reflection-and-codedom/media/dlr-archoverview.png deleted file mode 100644 index 8249478d42492..0000000000000 Binary files a/docs/framework/reflection-and-codedom/media/dlr-archoverview.png and /dev/null differ diff --git a/docs/framework/reflection-and-codedom/reflection-and-generic-types.md b/docs/framework/reflection-and-codedom/reflection-and-generic-types.md deleted file mode 100644 index 43e01e2cc200b..0000000000000 --- a/docs/framework/reflection-and-codedom/reflection-and-generic-types.md +++ /dev/null @@ -1,139 +0,0 @@ ---- -title: "Reflection and Generic Types" -description: Get started with reflection and generic types in .NET. Unlike an ordinary type, a generic type is associated with a set of type parameters or type arguments. -ms.date: "03/30/2017" -dev_langs: - - "csharp" - - "vb" - - "cpp" -helpviewer_keywords: - - "generics [.NET Framework], reflection emit" - - "reflection emit, generic types" - - "reflection, generic types" - - "type arguments" - - "generics [.NET Framework], reflection" - - "viewing type information" - - "type information, viewing" - - "types, generic" - - "type parameters" -ms.assetid: f7180fc5-dd41-42d4-8a8e-1b34288e06de ---- -# Reflection and Generic Types - -From the point of view of reflection, the difference between a generic type and an ordinary type is that a generic type has associated with it a set of type parameters (if it is a generic type definition) or type arguments (if it is a constructed type). A generic method differs from an ordinary method in the same way. - - There are two keys to understanding how reflection handles generic types and methods: - -- The type parameters of generic type definitions and generic method definitions are represented by instances of the class. - - > [!NOTE] - > Many properties and methods of have different behavior when a object represents a generic type parameter. These differences are documented in the property and method topics. For example, see and . In addition, some members are valid only when a object represents a generic type parameter. For example, see . - -- If an instance of represents a generic type, then it includes an array of types that represent the type parameters (for generic type definitions) or the type arguments (for constructed types). The same is true of an instance of the class that represents a generic method. - - Reflection provides methods of and that allow you to access the array of type parameters, and to determine whether an instance of represents a type parameter or an actual type. - - For example code demonstrating the methods discussed here, see [How to: Examine and Instantiate Generic Types with Reflection](how-to-examine-and-instantiate-generic-types-with-reflection.md). - - The following discussion assumes familiarity with the terminology of generics, such as the difference between type parameters and arguments and open or closed constructed types. For more information, see [Generics](../../standard/generics/index.md). - -## Is This a Generic Type or Method? - - When you use reflection to examine an unknown type, represented by an instance of , use the property to determine whether the unknown type is generic. It returns `true` if the type is generic. Similarly, when you examine an unknown method, represented by an instance of the class, use the property to determine whether the method is generic. - -### Is This a Generic Type or Method Definition? - - Use the property to determine whether a object represents a generic type definition, and use the method to determine whether a represents a generic method definition. - - Generic type and method definitions are the templates from which instantiable types are created. Generic types in the .NET Framework class library, such as , are generic type definitions. - -### Is the Type or Method Open or Closed? - - A generic type or method is closed if instantiable types have been substituted for all its type parameters, including all the type parameters of all enclosing types. You can only create an instance of a generic type if it is closed. The property returns `true` if a type is open. For methods, the method performs the same function. - -## Generating Closed Generic Types - - Once you have a generic type or method definition, use the method to create a closed generic type or the method to create a for a closed generic method. - -### Getting the Generic Type or Method Definition - - If you have an open generic type or method that is not a generic type or method definition, you cannot create instances of it and you cannot supply the type parameters that are missing. You must have a generic type or method definition. Use the method to obtain the generic type definition or the method to obtain the generic method definition. - - For example, if you have a object representing `Dictionary` (`Dictionary(Of Integer, String)` in Visual Basic) and you want to create the type `Dictionary`, you can use the method to get a representing `Dictionary` and then use the method to produce a representing `Dictionary`. - - For an example of an open generic type that is not a generic type, see "Type Parameter or Type Argument" later in this topic. - -## Examining Type Arguments and Type Parameters - - Use the method to obtain an array of objects that represent the type parameters or type arguments of a generic type, and use the method to do the same for a generic method. - - Once you know that a object represents a type parameter, there are many additional questions reflection can answer. You can determine the type parameter's source, its position, and its constraints. - -### Type Parameter or Type Argument - - To determine whether a particular element of the array is a type parameter or a type argument, use the property. The property is `true` if the element is a type parameter. - - A generic type can be open without being a generic type definition, in which case it has a mixture of type arguments and type parameters. For example, in the following code, class `D` derives from a type created by substituting the first type parameter of `D` for the second type parameter of `B`. - -```csharp -class B {} -class D : B {} -``` - -```vb -Class B(Of T, U) -End Class -Class D(Of V, W) - Inherits B(Of Integer, V) -End Class -``` - -```cpp -generic ref class B {}; -generic ref class D : B {}; -``` - - If you obtain a object representing `D` and use the property to obtain its base type, the resulting `type B` is open, but it is not a generic type definition. - -### Source of a Generic Parameter - - A generic type parameter might come from the type you are examining, from an enclosing type, or from a generic method. You can determine the source of the generic type parameter as follows: - -- First, use the property to determine whether the type parameter comes from a generic method. If the property value is not a null reference (`Nothing` in Visual Basic), then the source is a generic method. - -- If the source is not a generic method, use the property to determine the generic type the generic type parameter belongs to. - - If the type parameter belongs to a generic method, the property returns the type that declared the generic method, which is irrelevant. - -### Position of a Generic Parameter - - In rare situations, it is necessary to determine the position of a type parameter in the type parameter list of its declaring class. For example, suppose you have a object representing the `B` type from the preceding example. The method gives you a list of type arguments, and when you examine `V` you can use the and properties to discover where it comes from. You can then use the property to determine its position in the type parameter list where it was defined. In this example, `V` is at position 0 (zero) in the type parameter list where it was defined. - -### Base Type and Interface Constraints - - Use the method to obtain the base type constraint and interface constraints of a type parameter. The order of the elements of the array is not significant. An element represents an interface constraint if it is an interface type. - -### Generic Parameter Attributes - - The property gets a value that indicates the variance (covariance or contravariance) and the special constraints of a type parameter. - -#### Covariance and Contravariance - - To determine whether a type parameter is covariant or contravariant, apply the mask to the value that is returned by the property. If the result is , the type parameter is invariant. See [Covariance and Contravariance](../../standard/generics/covariance-and-contravariance.md). - -#### Special Constraints - - To determine the special constraints of a type parameter, apply the mask to the value that is returned by the property. If the result is , there are no special constraints. A type parameter can be constrained to be a reference type, to be a non-nullable value type, and to have a parameterless constructor. - -## Invariants - - For a table of the invariant conditions for common terms in reflection for generic types, see . For additional terms relating to generic methods, see . - -## Related Topics - -|Title|Description| -|-----------|-----------------| -|[How to: Examine and Instantiate Generic Types with Reflection](how-to-examine-and-instantiate-generic-types-with-reflection.md)|Shows how to use the properties and methods of and to examine generic types.| -|[Generics](../../standard/generics/index.md)|Describes the generics feature and how it is supported in the .NET Framework.| -|[How to: Define a Generic Type with Reflection Emit](how-to-define-a-generic-type-with-reflection-emit.md)|Shows how to use reflection emit to generate generic types in dynamic assemblies.| -|[Viewing Type Information](viewing-type-information.md)|Describes the class and provides code examples that illustrate how to use with various reflection classes to obtain information about constructors, methods, fields, properties, and events.| diff --git a/docs/framework/reflection-and-codedom/reflection-for-windows-store-apps.md b/docs/framework/reflection-and-codedom/reflection-for-windows-store-apps.md index f393593baf7b3..0518c048c459d 100644 --- a/docs/framework/reflection-and-codedom/reflection-for-windows-store-apps.md +++ b/docs/framework/reflection-and-codedom/reflection-for-windows-store-apps.md @@ -2,43 +2,43 @@ title: "Reflection in the .NET Framework for Windows Store Apps" description: Use reflection in .NET for Windows Store apps. There's a set of reflection types and members to use in Windows Store apps, which are available to the full .NET. ms.date: "03/30/2017" -dev_langs: +dev_langs: - "csharp" - "vb" -helpviewer_keywords: +helpviewer_keywords: - "reflection, Windows Store apps" - ".NET for Windows Store apps, TypeInfo class" ms.assetid: 0d07090c-9b47-4ecc-81d1-29d539603c9b --- # Reflection in the .NET Framework for Windows Store Apps -Starting with .NET Framework 4.5, the .NET Framework includes a set of reflection types and members for use in Windows 8.x Store apps. These types and members are available in the full .NET Framework as well as in the .NET for Windows Store apps. This document explains the major differences between these and their counterparts in the .NET Framework 4 and earlier versions. - - If you are creating a Windows 8.x Store app, you must use the reflection types and members in the .NET for Windows 8.x Store apps. These types and members are also available, but not required, for use in desktop apps, so you can use the same code for both types of apps. - -## TypeInfo and Assembly Loading - - In the .NET for Windows 8.x Store apps, the class contains some of the functionality of the .NET Framework 4 class. A object represents a reference to a type definition, whereas a object represents the type definition itself. This enables you to manipulate objects without necessarily requiring the runtime to load the assembly they reference. Getting the associated object forces the assembly to load. - - contains many of the members available on , and many of the reflection properties in the .NET for Windows 8.x Store apps return collections of objects. To get a object from a object, use the method. - -## Query Methods - - In the .NET for Windows 8.x Store apps, you use the reflection properties that return collections instead of methods that return arrays. Reflection contexts can implement lazy traversal of these collections for large assemblies or types. - - The reflection properties return only the declared methods on a particular object instead of traversing the inheritance tree. Moreover, they do not use parameters for filtering. Instead, filtering takes place in user code, by using LINQ queries on the returned collections. For reflection objects that originate with the runtime (for example, as the result of `typeof(Object)`), traversing the inheritance tree is best accomplished by using the helper methods of the class. Consumers of objects from customized reflection contexts cannot use these methods, and must traverse the inheritance tree themselves. - -## Restrictions - - In a Windows 8.x Store app, access to some .NET Framework types and members is restricted. For example, you cannot call .NET Framework methods that are not included in .NET for Windows 8.x Store apps, by using a object. In addition, certain types and members that are not considered safe within the context of a Windows 8.x Store app are blocked, as are and members. This restriction affects only .NET Framework types and members; you can call your code or third-party code as you normally would. - -## Example - - This example uses the reflection types and members in the .NET for Windows 8.x Store apps to retrieve the methods and properties of the type, including inherited methods and properties. To run this code, paste it into the code file for a Windows 8.x Store page that contains a control named `textblock1` in a project named Reflection. If you paste this code inside a project with a different name, just make sure you change the namespace name to match your project. - +Starting with .NET Framework 4.5, the .NET Framework includes a set of reflection types and members for use in Windows 8.x Store apps. These types and members are available in the full .NET Framework as well as in the .NET for Windows Store apps. This document explains the major differences between these and their counterparts in the .NET Framework 4 and earlier versions. + + If you are creating a Windows 8.x Store app, you must use the reflection types and members in the .NET for Windows 8.x Store apps. These types and members are also available, but not required, for use in desktop apps, so you can use the same code for both types of apps. + +## TypeInfo and Assembly Loading + + In the .NET for Windows 8.x Store apps, the class contains some of the functionality of the .NET Framework 4 class. A object represents a reference to a type definition, whereas a object represents the type definition itself. This enables you to manipulate objects without necessarily requiring the runtime to load the assembly they reference. Getting the associated object forces the assembly to load. + + contains many of the members available on , and many of the reflection properties in the .NET for Windows 8.x Store apps return collections of objects. To get a object from a object, use the method. + +## Query Methods + + In the .NET for Windows 8.x Store apps, you use the reflection properties that return collections instead of methods that return arrays. Reflection contexts can implement lazy traversal of these collections for large assemblies or types. + + The reflection properties return only the declared methods on a particular object instead of traversing the inheritance tree. Moreover, they do not use parameters for filtering. Instead, filtering takes place in user code, by using LINQ queries on the returned collections. For reflection objects that originate with the runtime (for example, as the result of `typeof(Object)`), traversing the inheritance tree is best accomplished by using the helper methods of the class. Consumers of objects from customized reflection contexts cannot use these methods, and must traverse the inheritance tree themselves. + +## Restrictions + + In a Windows 8.x Store app, access to some .NET Framework types and members is restricted. For example, you cannot call .NET Framework methods that are not included in .NET for Windows 8.x Store apps, by using a object. In addition, certain types and members that are not considered safe within the context of a Windows 8.x Store app are blocked, as are and members. This restriction affects only .NET Framework types and members; you can call your code or third-party code as you normally would. + +## Example + + This example uses the reflection types and members in the .NET for Windows 8.x Store apps to retrieve the methods and properties of the type, including inherited methods and properties. To run this code, paste it into the code file for a Windows 8.x Store page that contains a control named `textblock1` in a project named Reflection. If you paste this code inside a project with a different name, just make sure you change the namespace name to match your project. + [!code-csharp[System.ReflectionWinStoreApp#1](../../../samples/snippets/csharp/VS_Snippets_CLR_System/system.reflectionwinstoreapp/cs/mainpage.xaml.cs#1)] - [!code-vb[System.ReflectionWinStoreApp#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR_System/system.reflectionwinstoreapp/vb/mainpage.xaml.vb#1)] - + [!code-vb[System.ReflectionWinStoreApp#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR_System/system.reflectionwinstoreapp/vb/mainpage.xaml.vb#1)] + ## See also -- [Reflection](reflection.md) +- [Reflection](../../fundamentals/reflection/reflection.md) diff --git a/docs/framework/reflection-and-codedom/security-considerations-for-reflection.md b/docs/framework/reflection-and-codedom/security-considerations-for-reflection.md index 0a351d5d9035e..72b19719b3a6e 100644 --- a/docs/framework/reflection-and-codedom/security-considerations-for-reflection.md +++ b/docs/framework/reflection-and-codedom/security-considerations-for-reflection.md @@ -1,6 +1,6 @@ --- title: "Security Considerations for Reflection" -description: Learn about security considerations for reflection in .NET. Getting information about types and members is allowed, but accessing members has restrictions. +description: Learn about security considerations for reflection in .NET Framework. Getting information about types and members is allowed, but accessing members has restrictions. ms.date: "03/30/2017" helpviewer_keywords: - "permissions [.NET Framework], reflection" @@ -17,7 +17,6 @@ ms.assetid: 42d9dc2a-8fcc-4ff3-b002-4ff260ef3dc5 Reflection provides the ability to obtain information about types and members, and to access members (that is, to call methods and constructors, to get and set property values, to add and remove event handlers, and so on). The use of reflection to obtain information about types and members is not restricted. All code can use reflection to perform the following tasks: - Enumerate types and members, and examine their metadata. - - Enumerate and examine assemblies and modules. Using reflection to access members, by contrast, is subject to restrictions. Beginning with the .NET Framework 4, only trusted code can use reflection to access security-critical members. Furthermore, only trusted code can use reflection to access nonpublic members that would not be directly accessible to compiled code. Finally, code that uses reflection to access a safe-critical member must have whatever permissions the safe-critical member demands, just as with compiled code. @@ -110,6 +109,6 @@ Avoid writing public members that take param - - [Code Access Security](/previous-versions/dotnet/framework/code-access-security/code-access-security) - [Security Issues in Reflection Emit](security-issues-in-reflection-emit.md) -- [Viewing Type Information](viewing-type-information.md) +- [Viewing Type Information](../../fundamentals/reflection/viewing-type-information.md) - [Applying Attributes](../../standard/attributes/applying-attributes.md) -- [Accessing Custom Attributes](accessing-custom-attributes.md) +- [Accessing Custom Attributes](../../fundamentals/reflection/accessing-custom-attributes.md) diff --git a/docs/framework/reflection-and-codedom/security-issues-in-reflection-emit.md b/docs/framework/reflection-and-codedom/security-issues-in-reflection-emit.md index f14bff192e0b3..9e7b4a13e724d 100644 --- a/docs/framework/reflection-and-codedom/security-issues-in-reflection-emit.md +++ b/docs/framework/reflection-and-codedom/security-issues-in-reflection-emit.md @@ -17,18 +17,14 @@ ms.assetid: 0f8bf8fa-b993-478f-87ab-1a1a7976d298 .NET Framework provides three ways to emit Microsoft intermediate language (MSIL), each with its own security issues: -- [Dynamic assemblies](#Dynamic_Assemblies) - -- [Anonymously hosted dynamic methods](#Anonymously_Hosted_Dynamic_Methods) - -- [Dynamic methods associated with existing assemblies](#Dynamic_Methods_Associated_with_Existing_Assemblies) +- [Dynamic Assemblies](#dynamic-assemblies) +- [Anonymously Hosted Dynamic Methods](#anonymously-hosted-dynamic-methods) +- [Dynamic Methods Associated with Existing Assemblies](#dynamic-methods-associated-with-existing-assemblies) Regardless of the way you generate dynamic code, executing the generated code requires all the permissions that are required by the types and methods the generated code uses. > [!NOTE] -> The permissions that are required for reflecting on code and emitting code have changed with succeeding releases of .NET Framework. See [Version Information](#Version_Information), later in this article. - - +> The permissions that are required for reflecting on code and emitting code have changed with succeeding releases of .NET Framework. See [Version Information](#version-information), later in this article. ## Dynamic Assemblies @@ -56,8 +52,6 @@ ms.assetid: 0f8bf8fa-b993-478f-87ab-1a1a7976d298 - Debug symbols are not generated. (`Internet` and `LocalIntranet` permission sets do not include the necessary permissions.) - - ## Anonymously Hosted Dynamic Methods Anonymously hosted dynamic methods are created by using the two constructors that do not specify an associated type or module, and . These constructors place the dynamic methods in a system-provided, fully trusted, security-transparent assembly. No permissions are required to use these constructors or to emit code for the dynamic methods. @@ -92,8 +86,6 @@ ms.assetid: 0f8bf8fa-b993-478f-87ab-1a1a7976d298 > [!NOTE] > Dynamic methods do not support debug symbols. - - ## Dynamic Methods Associated with Existing Assemblies To associate a dynamic method with a type or module in an existing assembly, use any of the constructors that specify the associated type or module. The permissions that are required to call these constructors vary, because associating a dynamic method with an existing type or module gives the dynamic method access to nonpublic types and members: @@ -124,7 +116,7 @@ ms.assetid: 0f8bf8fa-b993-478f-87ab-1a1a7976d298 ### Generating Dynamic Methods from Partially Trusted Code > [!NOTE] -> The recommended way to generate dynamic methods from partially trusted code is to use [anonymously hosted dynamic methods](#Anonymously_Hosted_Dynamic_Methods). +> The recommended way to generate dynamic methods from partially trusted code is to use [Anonymously Hosted Dynamic Methods](#anonymously-hosted-dynamic-methods). Consider the conditions in which an assembly with Internet permissions can generate a dynamic method and execute it: @@ -139,8 +131,6 @@ ms.assetid: 0f8bf8fa-b993-478f-87ab-1a1a7976d298 > [!NOTE] > Dynamic methods do not support debug symbols. - - ## Version Information Starting with .NET Framework 4, machine-wide security policy is eliminated and security transparency becomes the default enforcement mechanism. @@ -161,4 +151,4 @@ ms.assetid: 0f8bf8fa-b993-478f-87ab-1a1a7976d298 ## See also - [Security Considerations for Reflection](security-considerations-for-reflection.md) -- [Emitting Dynamic Methods and Assemblies](emitting-dynamic-methods-and-assemblies.md) +- [Emitting Dynamic Methods and Assemblies](../../fundamentals/reflection/emitting-dynamic-methods-and-assemblies.md) diff --git a/docs/framework/reflection-and-codedom/toc.yml b/docs/framework/reflection-and-codedom/toc.yml index 1fcc655ec2845..575545332b6b7 100644 --- a/docs/framework/reflection-and-codedom/toc.yml +++ b/docs/framework/reflection-and-codedom/toc.yml @@ -1,46 +1,22 @@ items: -- name: Dynamic programming - href: index.md - name: Reflection - href: reflection.md items: - - name: Viewing Type Information - href: viewing-type-information.md - - name: Reflection and Generic Types - href: reflection-and-generic-types.md - - name: "How to: Examine and Instantiate Generic Types with Reflection" - href: how-to-examine-and-instantiate-generic-types-with-reflection.md + - name: Overview + href: ../../fundamentals/reflection/reflection.md?toc=/dotnet/framework/reflection-and-codedom/toc.json&bc=/dotnet/breadcrumb/toc.json - name: Security Considerations for Reflection href: security-considerations-for-reflection.md - - name: Dynamically Loading and Using Types - href: dynamically-loading-and-using-types.md - name: "How to: Load Assemblies into the Reflection-Only Context" href: how-to-load-assemblies-into-the-reflection-only-context.md - - name: "How to: Get type and member information by using reflection" - href: get-type-member-information.md - - name: Accessing Custom Attributes - href: accessing-custom-attributes.md - - name: Specifying Fully Qualified Type Names - href: specifying-fully-qualified-type-names.md - - name: "How to: Hook Up a Delegate Using Reflection" - href: how-to-hook-up-a-delegate-using-reflection.md - - name: Reflection in the .NET Framework for Windows Store Apps + - name: Reflection in .NET Framework for Windows Store Apps href: reflection-for-windows-store-apps.md - name: Emit dynamic methods and assemblies - href: emitting-dynamic-methods-and-assemblies.md items: + - name: Overview + href: ../../fundamentals/reflection/emitting-dynamic-methods-and-assemblies.md?toc=/dotnet/framework/reflection-and-codedom/toc.json&bc=/dotnet/breadcrumb/toc.json - name: Security Issues in Reflection Emit href: security-issues-in-reflection-emit.md - name: "Walkthrough: Emitting Code in Partial Trust Scenarios" href: walkthrough-emitting-code-in-partial-trust-scenarios.md - - name: "How to: Define and Execute Dynamic Methods" - href: how-to-define-and-execute-dynamic-methods.md - - name: "How to: Define a Generic Type with Reflection Emit" - href: how-to-define-a-generic-type-with-reflection-emit.md - - name: "How to: Define a Generic Method with Reflection Emit" - href: how-to-define-a-generic-method-with-reflection-emit.md - - name: Collectible assemblies for dynamic type generation - href: collectible-assemblies.md - name: Dynamic language runtime overview href: dynamic-language-runtime-overview.md - name: Dynamic source code generation and compilation diff --git a/docs/framework/reflection-and-codedom/using-the-codedom.md b/docs/framework/reflection-and-codedom/using-the-codedom.md index 1f92b9180c19c..cdbc556995f2c 100644 --- a/docs/framework/reflection-and-codedom/using-the-codedom.md +++ b/docs/framework/reflection-and-codedom/using-the-codedom.md @@ -2,11 +2,11 @@ title: "Using the CodeDOM" description: Use the Code Document Object Model (CodeDOM), which provides types representing many common types of source code elements, to assemble an object graph. ms.date: "03/30/2017" -dev_langs: +dev_langs: - "csharp" - "vb" - "cpp" -helpviewer_keywords: +helpviewer_keywords: - "code compilers" - "Code Document Object Model" - "Code Document Object Model, graphs" @@ -22,114 +22,113 @@ helpviewer_keywords: - "CodeDOM, graphs" ms.assetid: 0444ddf3-c3f6-44ed-a999-f710d9c3e0cf --- -# Using the CodeDOM - -The CodeDOM provides types that represent many common types of source code elements. You can design a program that builds a source code model using CodeDOM elements to assemble an object graph. This object graph can be rendered as source code using a CodeDOM code generator for a supported programming language. The CodeDOM can also be used to compile source code into a binary assembly. - - Some common uses for the CodeDOM include: - -- Templated code generation: generating code for ASP.NET, XML Web services client proxies, code wizards, designers, or other code-emitting mechanisms. - -- Dynamic compilation: supporting code compilation in single or multiple languages. - -## Building a CodeDOM Graph - - The namespace provides classes for representing the logical structure of source code, independent of language syntax. - -### The Structure of a CodeDOM Graph - - The structure of a CodeDOM graph is like a tree of containers. The top-most, or root, container of each compilable CodeDOM graph is a . Every element of your source code model must be linked into the graph through a property of a in the graph. - -### Building a Source Code Model for a Sample Hello World Program - - The following walkthrough provides an example of how to build a CodeDOM object graph that represents the code for a simple Hello World application. For the complete source code for this code example, see the topic. - -#### Creating a compile unit - - The CodeDOM defines an object called a , which can reference a CodeDOM object graph that models the source code to compile. A **CodeCompileUnit** has properties for storing references to attributes, namespaces, and assemblies. - - The CodeDom providers that derive from the class contain methods that process the object graph referenced by a **CodeCompileUnit**. - - To create an object graph for a simple application, you must assemble the source code model and reference it from a **CodeCompileUnit**. - - You can create a new compile unit with the syntax demonstrated in this example: - - [!code-cpp[CodeDomExample#12](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#12)] - [!code-csharp[CodeDomExample#12](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#12)] - [!code-vb[CodeDomExample#12](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#12)] - - A can contain a section of source code that is already in the target language, but cannot be rendered to another language. - -#### Defining a namespace - - To define a namespace, create a and assign a name for it using the appropriate constructor or by setting its **Name** property. - - [!code-cpp[CodeDomExample#13](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#13)] - [!code-csharp[CodeDomExample#13](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#13)] - [!code-vb[CodeDomExample#13](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#13)] - -#### Importing a namespace - - To add a namespace import directive to the namespace, add a that indicates the namespace to import to the **CodeNamespace.Imports** collection. - - The following code adds an import for the **System** namespace to the **Imports** collection of a **CodeNamespace** named `samples`: - - [!code-cpp[CodeDomExample#14](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#14)] - [!code-csharp[CodeDomExample#14](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#14)] - [!code-vb[CodeDomExample#14](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#14)] - -#### Linking code elements into the object graph - - All code elements that form a CodeDOM graph must be linked to the that is the root element of the tree by a series of references between elements directly referenced from the properties of the root object of the graph. Set an object to a property of a container object to establish a reference from the container object. - - The following statement adds the `samples` **CodeNamespace** to the **Namespaces** collection property of the root **CodeCompileUnit**. - - [!code-cpp[CodeDomExample#15](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#15)] - [!code-csharp[CodeDomExample#15](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#15)] - [!code-vb[CodeDomExample#15](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#15)] - -#### Defining a type - - To declare a class, structure, interface, or enumeration using the CodeDOM, create a new , and assign it a name. The following example demonstrates this using a constructor overload to set the **Name** property: - - [!code-cpp[CodeDomExample#16](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#16)] - [!code-csharp[CodeDomExample#16](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#16)] - [!code-vb[CodeDomExample#16](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#16)] - - To add a type to a namespace, add a that represents the type to add to the namespace to the **Types** collection of a **CodeNamespace**. - - The following example demonstrates how to add a class named `class1` to a **CodeNamespace** named `samples`: - - [!code-cpp[CodeDomExample#17](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#17)] - [!code-csharp[CodeDomExample#17](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#17)] - [!code-vb[CodeDomExample#17](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#17)] - -#### Adding class members to a class - - The namespace provides a variety of elements that can be used to represent class members. Each class member can be added to the **Members** collection of a . - -#### Defining a code entry point method for an executable - - If you are building code for an executable program, it is necessary to indicate the entry point of a program by creating a to represent the method at which program execution should begin. - - The following example demonstrates how to define an entry point method that contains a that calls **System.Console.WriteLine** to print "Hello World!": - - [!code-cpp[CodeDomExample#18](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#18)] - [!code-csharp[CodeDomExample#18](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#18)] - [!code-vb[CodeDomExample#18](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#18)] - - The following statement adds the entry point method named `Start` to the **Members** collection of `class1`: - - [!code-cpp[CodeDomExample#19](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#19)] - [!code-csharp[CodeDomExample#19](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#19)] - [!code-vb[CodeDomExample#19](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#19)] - - Now the named `compileUnit` contains the CodeDOM graph for a simple Hello World program. For information on generating and compiling code from a CodeDOM graph, see [Generating Source Code and Compiling a Program from a CodeDOM Graph](generating-and-compiling-source-code-from-a-codedom-graph.md). - -### More information on building a CodeDOM graph - - The CodeDOM supports the many common types of code elements found in programming languages that support the common language runtime. The CodeDOM was not designed to provide elements to represent all possible programming language features. Code that cannot be represented easily with CodeDOM elements can be encapsulated in a , a , a , or a . However, snippets cannot be translated to other languages automatically by the CodeDOM. - - For documentation for the each of the CodeDOM types, see the reference documentation for the namespace. - - For a quick chart to locate the CodeDOM element that represents a specific type of code element, see the [CodeDOM Quick Reference](/previous-versions/dotnet/netframework-4.0/f1dfsbhc(v=vs.100)). +# Use the CodeDOM + +The CodeDOM provides types that represent many common types of source code elements. You can design a program that builds a source code model using CodeDOM elements to assemble an object graph. This object graph can be rendered as source code using a CodeDOM code generator for a supported programming language. The CodeDOM can also be used to compile source code into a binary assembly. + +Some common uses for the CodeDOM include: + +- Templated code generation: generating code for ASP.NET, XML Web services client proxies, code wizards, designers, or other code-emitting mechanisms. +- Dynamic compilation: supporting code compilation in single or multiple languages. + +## Build a CodeDOM graph + +The namespace provides classes for representing the logical structure of source code, independent of language syntax. + +### The structure of a CodeDOM graph + +The structure of a CodeDOM graph is like a tree of containers. The top-most, or root, container of each compilable CodeDOM graph is a . Every element of your source code model must be linked into the graph through a property of a in the graph. + +### Build a source code model for a sample Hello World program + +The following walkthrough provides an example of how to build a CodeDOM object graph that represents the code for a simple Hello World application. For the complete source code for this code example, see the article. + +#### Create a compile unit + +The CodeDOM defines an object called a , which can reference a CodeDOM object graph that models the source code to compile. A **CodeCompileUnit** has properties for storing references to attributes, namespaces, and assemblies. + +The CodeDom providers that derive from the class contain methods that process the object graph referenced by a **CodeCompileUnit**. + +To create an object graph for a simple application, you must assemble the source code model and reference it from a **CodeCompileUnit**. + +You can create a new compile unit with the syntax demonstrated in this example: + +[!code-cpp[CodeDomExample#12](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#12)] +[!code-csharp[CodeDomExample#12](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#12)] +[!code-vb[CodeDomExample#12](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#12)] + +A can contain a section of source code that's already in the target language, but cannot be rendered to another language. + +#### Define a namespace + +To define a namespace, create a and assign a name for it using the appropriate constructor or by setting its **Name** property. + +[!code-cpp[CodeDomExample#13](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#13)] +[!code-csharp[CodeDomExample#13](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#13)] +[!code-vb[CodeDomExample#13](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#13)] + +#### Import a namespace + +To add a namespace import directive to the namespace, add a that indicates the namespace to import to the **CodeNamespace.Imports** collection. + +The following code adds an import for the **System** namespace to the **Imports** collection of a **CodeNamespace** named `samples`: + +[!code-cpp[CodeDomExample#14](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#14)] +[!code-csharp[CodeDomExample#14](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#14)] +[!code-vb[CodeDomExample#14](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#14)] + +#### Link code elements into the object graph + +All code elements that form a CodeDOM graph must be linked to the that is the root element of the tree by a series of references between elements directly referenced from the properties of the root object of the graph. Set an object to a property of a container object to establish a reference from the container object. + +The following statement adds the `samples` **CodeNamespace** to the **Namespaces** collection property of the root **CodeCompileUnit**. + +[!code-cpp[CodeDomExample#15](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#15)] +[!code-csharp[CodeDomExample#15](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#15)] +[!code-vb[CodeDomExample#15](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#15)] + +#### Define a type + +To declare a class, structure, interface, or enumeration using the CodeDOM, create a new , and assign it a name. The following example demonstrates this using a constructor overload to set the **Name** property: + +[!code-cpp[CodeDomExample#16](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#16)] +[!code-csharp[CodeDomExample#16](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#16)] +[!code-vb[CodeDomExample#16](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#16)] + +To add a type to a namespace, add a that represents the type to add to the namespace to the **Types** collection of a **CodeNamespace**. + +The following example demonstrates how to add a class named `class1` to a **CodeNamespace** named `samples`: + +[!code-cpp[CodeDomExample#17](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#17)] +[!code-csharp[CodeDomExample#17](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#17)] +[!code-vb[CodeDomExample#17](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#17)] + +#### Add class members to a class + +The namespace provides a variety of elements that can be used to represent class members. Each class member can be added to the **Members** collection of a . + +#### Define a code entry point method for an executable + +If you are building code for an executable program, it is necessary to indicate the entry point of a program by creating a to represent the method at which program execution should begin. + +The following example demonstrates how to define an entry point method that contains a that calls **System.Console.WriteLine** to print "Hello World!": + +[!code-cpp[CodeDomExample#18](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#18)] +[!code-csharp[CodeDomExample#18](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#18)] +[!code-vb[CodeDomExample#18](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#18)] + +The following statement adds the entry point method named `Start` to the **Members** collection of `class1`: + +[!code-cpp[CodeDomExample#19](../../../samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source2.cpp#19)] +[!code-csharp[CodeDomExample#19](../../../samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source2.cs#19)] +[!code-vb[CodeDomExample#19](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source2.vb#19)] + +Now the named `compileUnit` contains the CodeDOM graph for a simple Hello World program. For information on generating and compiling code from a CodeDOM graph, see [Generating Source Code and Compiling a Program from a CodeDOM Graph](generating-and-compiling-source-code-from-a-codedom-graph.md). + +### More information on building a CodeDOM graph + +The CodeDOM supports the many common types of code elements found in programming languages that support the common language runtime. The CodeDOM was not designed to provide elements to represent all possible programming language features. Code that cannot be represented easily with CodeDOM elements can be encapsulated in a , a , a , or a . However, snippets cannot be translated to other languages automatically by the CodeDOM. + +For documentation for the each of the CodeDOM types, see the reference documentation for the namespace. + +For a quick chart to locate the CodeDOM element that represents a specific type of code element, see the [CodeDOM Quick Reference](/previous-versions/dotnet/netframework-4.0/f1dfsbhc(v=vs.100)). diff --git a/docs/framework/reflection-and-codedom/viewing-type-information.md b/docs/framework/reflection-and-codedom/viewing-type-information.md deleted file mode 100644 index 67976d473fd52..0000000000000 --- a/docs/framework/reflection-and-codedom/viewing-type-information.md +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: "Viewing Type Information" -description: View type information using System.Type, which is central to reflection in .NET. Review ConstructorInfo, MemberInfo, MethodInfo, FieldInfo, and PropertyInfo. -ms.date: "03/30/2017" -dev_langs: - - "csharp" - - "vb" - - "cpp" -helpviewer_keywords: - - "types, viewing type information" - - "Type object" - - "viewing type information" - - "reflection, viewing type information" -ms.assetid: 7e7303a9-4064-4738-b4e7-b75974ed70d2 ---- -# Viewing Type Information - -The class is central to reflection. The common language runtime creates the **Type** for a loaded type when reflection requests it. You can use a **Type** object's methods, fields, properties, and nested classes to find out everything about that type. - - Use or to obtain **Type** objects from assemblies that have not been loaded, passing in the name of the type or types you want. Use to get the **Type** objects from an assembly that is already loaded. Use and to obtain module **Type** objects. - -> [!NOTE] -> If you want to examine and manipulate generic types and methods, please see the additional information provided in [Reflection and Generic Types](reflection-and-generic-types.md) and [How to: Examine and Instantiate Generic Types with Reflection](how-to-examine-and-instantiate-generic-types-with-reflection.md). - - The following example shows the syntax necessary to get the object and module for an assembly. - - [!code-cpp[Conceptual.Types.ViewInfo#6](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source5.cpp#6)] - [!code-csharp[Conceptual.Types.ViewInfo#6](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source5.cs#6)] - [!code-vb[Conceptual.Types.ViewInfo#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source5.vb#6)] - - The following example demonstrates getting **Type** objects from a loaded assembly. - - [!code-cpp[Conceptual.Types.ViewInfo#7](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source5.cpp#7)] - [!code-csharp[Conceptual.Types.ViewInfo#7](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source5.cs#7)] - [!code-vb[Conceptual.Types.ViewInfo#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source5.vb#7)] - - Once you obtain a **Type**, there are many ways you can discover information about the members of that type. For example, you can find out about all the type's members by calling the method, which obtains an array of objects describing each of the members of the current type. - - You can also use methods on the **Type** class to retrieve information about one or more constructors, methods, events, fields, or properties that you specify by name. For example, encapsulates a specific constructor of the current class. - - If you have a **Type**, you can use the property to obtain an object that encapsulates the module containing that type. Use the property to locate an object that encapsulates the assembly containing the module. You can obtain the assembly that encapsulates the type directly by using the property. - -## System.Type and ConstructorInfo - - The following example shows how to list the constructors for a class, in this case, the class. - - [!code-cpp[Conceptual.Types.ViewInfo#1](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source1.cpp#1)] - [!code-csharp[Conceptual.Types.ViewInfo#1](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source1.cs#1)] - [!code-vb[Conceptual.Types.ViewInfo#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source1.vb#1)] - -## MemberInfo, MethodInfo, FieldInfo, and PropertyInfo - - Obtain information about the type's methods, properties, events, and fields using , , , or objects. - - The following example uses **MemberInfo** to list the number of members in the **System.IO.File** class and uses the property to determine the visibility of the class. - - [!code-cpp[Conceptual.Types.ViewInfo#2](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source2.cpp#2)] - [!code-csharp[Conceptual.Types.ViewInfo#2](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source2.cs#2)] - [!code-vb[Conceptual.Types.ViewInfo#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source2.vb#2)] - - The following example investigates the type of the specified member. It performs reflection on a member of the **MemberInfo** class, and lists its type. - - [!code-cpp[Conceptual.Types.ViewInfo#3](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source3.cpp#3)] - [!code-csharp[Conceptual.Types.ViewInfo#3](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source3.cs#3)] - [!code-vb[Conceptual.Types.ViewInfo#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source3.vb#3)] - - The following example uses all the Reflection **\*Info** classes along with to list all the members (constructors, fields, properties, events, and methods) of the specified class, dividing the members into static and instance categories. - - [!code-cpp[Conceptual.Types.ViewInfo#4](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source4.cpp#4)] - [!code-csharp[Conceptual.Types.ViewInfo#4](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source4.cs#4)] - [!code-vb[Conceptual.Types.ViewInfo#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source4.vb#4)] - -## See also - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- [Reflection and Generic Types](reflection-and-generic-types.md) diff --git a/docs/framework/unmanaged-api/debugging/debugging-enumerations.md b/docs/framework/unmanaged-api/debugging/debugging-enumerations.md index e2fbf6ca8778b..90c52217f6589 100644 --- a/docs/framework/unmanaged-api/debugging/debugging-enumerations.md +++ b/docs/framework/unmanaged-api/debugging/debugging-enumerations.md @@ -1,12 +1,11 @@ --- -description: "Learn more about: Debugging Enumerations" title: "Debugging Enumerations" +description: "Learn more about: Debugging Enumerations" ms.date: "03/30/2017" helpviewer_keywords: - "debugging enumerations [.NET Framework]" - "unmanaged enumerations [.NET Framework], debugging" - "enumerations [.NET Framework debugging]" -ms.assetid: 3af9f584-f1b4-4154-aeaa-8fce7c9f8b50 --- # Debugging Enumerations @@ -26,7 +25,7 @@ This section describes the unmanaged enumerations that the debugging API uses. [CorDebugBlockingReason Enumeration](cordebugblockingreason-enumeration.md)\ Specifies the reasons why a thread may become blocked on a given object. - CorDebugChainReason + [CorDebugChainReason Enumeration](cordebugchainreason-enumeration.md)\ Indicates the reason or reasons for the initiation of a call chain. [CorDebugCodeInvokeKind Enumeration](cordebugcodeinvokekind-enumeration.md)\ @@ -35,7 +34,7 @@ This section describes the unmanaged enumerations that the debugging API uses. [CorDebugCodeInvokePurpose Enumeration](cordebugcodeinvokepurpose-enumeration.md)\ Describes why an exported function calls managed code. - CorDebugCreateProcessFlags + [CorDebugCreateProcessFlags Enumeration](cordebugcreateprocessflags-enumeration.md)\ Provides additional debugging options that can be used in a call to the [ICorDebug::CreateProcess](icordebug-createprocess-method.md) method. [CorDebugDebugEventKind Enumeration](cordebugdebugeventkind-enumeration.md)\ @@ -44,13 +43,13 @@ This section describes the unmanaged enumerations that the debugging API uses. [CorDebugDecodeEventFlagsWindows Enumeration](cordebugdecodeeventflagswindows-enumeration.md)\ Provides additional information about debug events on the Windows platform. - CorDebugExceptionCallbackType + [CorDebugExceptionCallbackType Enumeration](cordebugexceptioncallbacktype-enumeration.md)\ Indicates the type of callback that is made from an [ICorDebugManagedCallback2::Exception](icordebugmanagedcallback2-exception-method.md) event. [CorDebugExceptionFlags Enumeration](cordebugexceptionflags-enumeration.md)\ Provides additional information about an exception. - CorDebugExceptionUnwindCallbackType + [CorDebugExceptionUnwindCallbackType Enumeration](cordebugexceptionunwindcallbacktype-enumeration.md)\ Indicates the event that is being signaled by the callback during the unwind phase. [CorDebugGCType Enumeration](cordebuggctype-enumeration.md)\ @@ -59,19 +58,19 @@ This section describes the unmanaged enumerations that the debugging API uses. [CorDebugGenerationTypes Enumeration](cordebuggenerationtypes-enumeration.md)\ Specifies the generation of a region of memory on the managed heap. - CorDebugHandleType + [CorDebugHandleType Enumeration](cordebughandletype-enumeration.md)\ Indicates the handle type. [CorDebugIlToNativeMappingTypes Enumeration](cordebugiltonativemappingtypes-enumeration.md)\ Indicates whether a particular range of native instructions corresponds to a special code region. - CorDebugIntercept + [CorDebugIntercept Enumeration](cordebugintercept-enumeration.md)\ Indicates the types of code that can be stepped into. [CorDebugInterfaceVersion Enumeration](cordebuginterfaceversion-enumeration.md)\ Specifies either a version of the .NET Framework, or the version of the .NET Framework in which an interface was introduced. - CorDebugInternalFrameType + [CorDebugInternalFrameType Enumeration](cordebuginternalframetype-enumeration.md)\ Identifies the type of stack frame. [CorDebugJITCompilerFlags Enumeration](cordebugjitcompilerflags-enumeration.md)\ @@ -80,7 +79,7 @@ This section describes the unmanaged enumerations that the debugging API uses. [CorDebugJITCompilerFlagsDeprecated Enumeration](cordebugjitcompilerflagsdeprecated-enumeration.md)\ Obsolete. Use the `CORDEBUG_JIT_DEFAULT` member of the [CorDebugJITCompilerFlags](cordebugjitcompilerflags-enumeration.md) enumeration instead. - CorDebugMappingResult + [CorDebugMappingResult Enumeration](cordebugmappingresult-enumeration.md)\ Provides the details of how the value of the instruction pointer (IP) was obtained. [CorDebugMDAFlags Enumeration](cordebugmdaflags-enumeration.md)\ @@ -95,7 +94,7 @@ This section describes the unmanaged enumerations that the debugging API uses. [CorDebugRecordFormat Enumeration](cordebugrecordformat-enumeration.md)\ Describes the format of the data in a byte array that contains information about a native exception debug event. - CorDebugRegister + [CorDebugRegister Enumeration](cordebugregister-enumeration.md)\ Specifies the registers associated with a given processor architecture. [CorDebugSetContextFlag Enumeration](cordebugsetcontextflag-enumeration.md)\ @@ -104,16 +103,16 @@ This section describes the unmanaged enumerations that the debugging API uses. [CorDebugStateChange Enumeration](cordebugstatechange-enumeration.md)\ Describes the amount of cached data that must be discarded based on changes to the process. - CorDebugStepReason + [CorDebugStepReason Enumeration](cordebugstepreason-enumeration.md)\ Indicates the outcome of an individual step. - CorDebugThreadState + [CorDebugThreadState Enumeration](cordebugthreadstate-enumeration.md)\ Specifies the state of a thread for debugging. - \>CorDebugUnmappedStop + [CorDebugUnmappedStop Enumeration](cordebugunmappedstop-enumeration.md)\ Specifies the type of unmapped code that can trigger a halt in code execution by the stepper. - CorDebugUserState + [CorDebugUserState Enumeration](cordebuguserstate-enumeration.md)\ Indicates the user state of a thread. [CorGCReferenceType Enumeration](corgcreferencetype-enumeration.md)\ @@ -139,10 +138,10 @@ This section describes the unmanaged enumerations that the debugging API uses. ## Related Sections - [Debugging Coclasses](debugging-coclasses.md)\ + [Debugging Coclasses](debugging-coclasses.md) - [Debugging Interfaces](debugging-interfaces.md)\ + [Debugging Interfaces](debugging-interfaces.md) - [Debugging Global Static Functions](debugging-global-static-functions.md)\ + [Debugging Global Static Functions](debugging-global-static-functions.md) - [Debugging Structures](debugging-structures.md)\ + [Debugging Structures](debugging-structures.md) diff --git a/docs/fundamentals/diagnostics/runtime-method-events.md b/docs/fundamentals/diagnostics/runtime-method-events.md index 52ea402d8aa14..4ffda848b241b 100644 --- a/docs/fundamentals/diagnostics/runtime-method-events.md +++ b/docs/fundamentals/diagnostics/runtime-method-events.md @@ -234,8 +234,8 @@ The following table shows the event information: |`MethodNameSpace`|`win:UnicodeString`|Full namespace name associated with the method.| |`MethodName`|`win:UnicodeString`|Full class name associated with the method.| |`MethodSignature`|`win:UnicodeString`|Signature of the method (comma-separated list of type names).| -|`ReJITID`|`win:UInt64`|ReJIT ID of the method.| |`ClrInstanceID`|`win:UInt16`|Unique ID for the instance of CoreCLR.| +|`ReJITID`|`win:UInt64`|ReJIT ID of the method.| ## MethodJittingStarted_V1 event @@ -374,7 +374,7 @@ The following table shows the keyword and level: |`MethodID`|`win:UInt64`|Unique identifier of a method.| |`ReJITID`|`win:UInt64`|The ReJIT ID of the method.| |`MethodExtent`|`win:UInt8`|The extent for the jitted method.| -|`CountOfMapEntries`|`win:UInt8`|Number of map entries| +|`CountOfMapEntries`|`win:UInt16`|Number of map entries| |`ILOffsets`|`win:UInt32`|The IL offset.| |`NativeOffsets`|`win:UInt32`|The native code offset.| |`ClrInstanceID`|`win:UInt16`|Unique ID for the instance of CoreCLR.| diff --git a/docs/fundamentals/reflection/accessing-custom-attributes.md b/docs/fundamentals/reflection/accessing-custom-attributes.md new file mode 100644 index 0000000000000..4db97c19a6490 --- /dev/null +++ b/docs/fundamentals/reflection/accessing-custom-attributes.md @@ -0,0 +1,72 @@ +--- +title: "Accessing Custom Attributes" +description: Access custom attributes in .NET. After attributes have been associated with program elements, you can use reflection to query their existence and values. +ms.date: 03/27/2024 +dev_langs: + - "csharp" + - "vb" + - "cpp" +helpviewer_keywords: + - "custom attributes, accessibility" + - "attributes [.NET], accessing" + - "reflection, custom attributes" +ms.assetid: 1d8e3398-00d8-47d5-a084-214f9859d3d7 +--- +# Access custom attributes + +After attributes have been associated with program elements, reflection can be used to query their existence and values. .NET provides the , which you can use to examine code that can't be loaded for execution. + +## + +Code loaded into the context cannot be executed. This means that instances of custom attributes cannot be created, because that would require executing their constructors. To load and examine custom attributes in the context, use the class. You can obtain instances of this class by using the appropriate overload of the static method. For more information, see [How to: Inspect assembly contents using MetadataLoadContext](../../standard/assembly/inspect-contents-using-metadataloadcontext.md). + +## The execution context + +The main reflection methods to query attributes in the execution context are and . + +The accessibility of a custom attribute is checked with respect to the assembly in which it's attached. This is equivalent to checking whether a method on a type in the assembly in which the custom attribute is attached can call the constructor of the custom attribute. + +Methods such as check the visibility and accessibility of the type argument. Only code in the assembly that contains the user-defined type can retrieve a custom attribute of that type using `GetCustomAttributes`. + +The following C# example is a typical custom attribute design pattern. It illustrates the runtime custom attribute reflection model. + +```csharp +System.DLL +public class DescriptionAttribute : Attribute +{ +} + +System.Web.DLL +internal class MyDescriptionAttribute : DescriptionAttribute +{ +} + +public class LocalizationExtenderProvider +{ + [MyDescriptionAttribute(...)] + public CultureInfo GetLanguage(...) + { + } +} +``` + +If the runtime is attempting to retrieve the custom attributes for the public custom attribute type attached to the `GetLanguage` method, it performs the following actions: + +1. The runtime checks that the type argument `DescriptionAttribute` to `Type.GetCustomAttributes(Type type)` is public, and therefore is visible and accessible. +2. The runtime checks that the user-defined type `MyDescriptionAttribute` that's derived from `DescriptionAttribute` is visible and accessible within the System.Web.dll assembly, where it's attached to the method `GetLanguage()`. +3. The runtime checks that the constructor of `MyDescriptionAttribute` is visible and accessible within the System.Web.dll assembly. +4. The runtime calls the constructor of `MyDescriptionAttribute` with the custom attribute parameters and returns the new object to the caller. + +The custom attribute reflection model could leak instances of user-defined types outside the assembly in which the type is defined. This is no different from the members in the runtime system library that return instances of user-defined types, such as returning an array of `RuntimeMethodInfo` objects. To prevent a client from discovering information about a user-defined custom attribute type, define the type's members to be nonpublic. + +The following example demonstrates the basic way of using reflection to get access to custom attributes. + +[!code-cpp[CustomAttributeData#2](../../../samples/snippets/cpp/VS_Snippets_CLR/CustomAttributeData/CPP/source2.cpp#2)] +[!code-csharp[CustomAttributeData#2](../../../samples/snippets/csharp/VS_Snippets_CLR/CustomAttributeData/CS/source2.cs#2)] +[!code-vb[CustomAttributeData#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/CustomAttributeData/VB/source2.vb#2)] + +## See also + +- +- +- [View Type Information](viewing-type-information.md) diff --git a/docs/framework/reflection-and-codedom/collectible-assemblies.md b/docs/fundamentals/reflection/collectible-assemblies.md similarity index 81% rename from docs/framework/reflection-and-codedom/collectible-assemblies.md rename to docs/fundamentals/reflection/collectible-assemblies.md index 5f6c4d0c1c966..c474db7d25f30 100644 --- a/docs/framework/reflection-and-codedom/collectible-assemblies.md +++ b/docs/fundamentals/reflection/collectible-assemblies.md @@ -2,7 +2,7 @@ title: Collectible assemblies for dynamic type generation description: Get started with collectible assemblies for dynamic type generation in .NET. Read about collectible assembly lifetimes and restrictions. ms.date: "08/29/2017" -helpviewer_keywords: +helpviewer_keywords: - "reflection, dynamic assembly" - "assemblies, collectible" - "collectible assemblies, retrieving" @@ -11,66 +11,65 @@ helpviewer_keywords: *Collectible assemblies* are dynamic assemblies that can be unloaded without unloading the application domain in which they were created. All managed and unmanaged memory used by a collectible assembly and the types it contains can be reclaimed. Information such as the assembly name is removed from internal tables. -To enable unloading, use the flag when you create a dynamic assembly. The assembly is transient (that is, it cannot be saved) and is subject to limitations described in the [Restrictions on Collectible Assemblies](#restrictions-on-collectible-assemblies) section. The common language runtime (CLR) unloads a collectible assembly automatically when you release all objects associated with the assembly. In all other respects, collectible assemblies are created and used in the same way as other dynamic assemblies. +To enable unloading, use the flag when you create a dynamic assembly. The assembly is transient (that is, it cannot be saved) and is subject to limitations described in the [Restrictions on collectible assemblies](#restrictions-on-collectible-assemblies) section. The common language runtime (CLR) unloads a collectible assembly automatically when you release all objects associated with the assembly. In all other respects, collectible assemblies are created and used in the same way as other dynamic assemblies. ## Lifetime of collectible assemblies The lifetime of a collectible assembly is controlled by the existence of references to the types it contains and the objects that are created from those types. The common language runtime does not unload an assembly as long as one or more of the following exist (`T` is any type that is defined in the assembly): - An instance of `T`. - - An instance of an array of `T`. - - An instance of a generic type that has `T` as one of its type arguments. This includes generic collections of `T`, even if that collection is empty. - - An instance of or that represents `T`. > [!IMPORTANT] > You must release all objects that represent parts of the assembly. The that defines `T` keeps a reference to the , and the object keeps a reference to the , so references to these objects must be released. Even the existence of a or an used in the construction of `T` prevents unloading. - A static reference to `T` by another dynamically defined type `T1` that is still reachable by executing code. For example, `T1` might derive from `T`, or `T` might be the type of a parameter in a method of `T1`. - -- A **ByRef** to a static field that belongs to `T`. - +- A `ByRef` to a static field that belongs to `T`. - A , , or that refers to `T` or to a component of `T`. - - An instance of any reflection object that could be used indirectly or directly to access the object that represents `T`. For example, the object for `T` can be obtained from an array type whose element type is `T`, or from a generic type that has `T` as a type argument. - - A method `M` on the call stack of any thread, where `M` is a method of `T` or a module-level method that is defined in the assembly. - -- A delegate to a static method that is defined in a module of the assembly. +- A delegate to a static method that's defined in a module of the assembly. If only one item from this list exists for only one type or one method in the assembly, the runtime cannot unload the assembly. > [!NOTE] > The runtime does not actually unload the assembly until finalizers have run for all items in the list. -For purposes of tracking lifetime, a constructed generic type such as `List` (in C#) or `List(Of Integer)` (in Visual Basic) that is created and used in the generation of a collectible assembly is considered to have been defined either in the assembly that contains the generic type definition or in an assembly that contains the definition of one of its type arguments. The exact assembly that is used is an implementation detail and subject to change. +For purposes of tracking lifetime, a constructed generic type such as `List` (in C#) or `List(Of Integer)` (in Visual Basic) that's created and used in the generation of a collectible assembly is considered to have been defined either in the assembly that contains the generic type definition or in an assembly that contains the definition of one of its type arguments. The exact assembly that's used is an implementation detail and subject to change. ## Restrictions on collectible assemblies The following restrictions apply to collectible assemblies: - **Static references** + Types in an ordinary dynamic assembly cannot have static references to types that are defined in a collectible assembly. For example, if you define an ordinary type that inherits from a type in a collectible assembly, a exception is thrown. A type in a collectible assembly can have static references to a type in another collectible assembly, but this extends the lifetime of the referenced assembly to the lifetime of the referencing assembly. - **COM interop** + No COM interfaces can be defined within a collectible assembly, and no instances of types within a collectible assembly can be converted into COM objects. A type in a collectible assembly cannot serve as a COM callable wrapper (CCW) or runtime callable wrapper (RCW). However, types in collectible assemblies can use objects that implement COM interfaces. - **Platform invoke** - Methods that have the attribute will not compile when they are declared in a collectible assembly. The instruction cannot be used in the implementation of a type in a collectible assembly, and such types cannot be marshalled to unmanaged code. However, you can call into native code by using an entry point that is declared in a non-collectible assembly. + + Methods that have the attribute will not compile when they're declared in a collectible assembly. The instruction cannot be used in the implementation of a type in a collectible assembly, and such types cannot be marshalled to unmanaged code. However, you can call into native code by using an entry point that's declared in a non-collectible assembly. - **Marshaling** + Objects (in particular, delegates) that are defined in collectible assemblies cannot be marshalled. This is a restriction on all transient emitted types. - **Assembly loading** - Reflection emit is the only mechanism that is supported for loading collectible assemblies. Assemblies that are loaded by using any other form of assembly loading cannot be unloaded. + + Reflection emit is the only mechanism that's supported for loading collectible assemblies. Assemblies that are loaded by using any other form of assembly loading cannot be unloaded. - **Context-bound objects** + Context-static variables are not supported. Types in a collectible assembly cannot extend . However, code in collectible assemblies can use context-bound objects that are defined elsewhere. - **Thread-static data** - Thread-static variables are not supported. + + Thread-static variables aren't supported. ## See also diff --git a/docs/fundamentals/reflection/dynamically-loading-and-using-types.md b/docs/fundamentals/reflection/dynamically-loading-and-using-types.md new file mode 100644 index 0000000000000..c6dcb8d173c4c --- /dev/null +++ b/docs/fundamentals/reflection/dynamically-loading-and-using-types.md @@ -0,0 +1,102 @@ +--- +title: "Dynamically Loading and Using Types" +description: Dynamically load and use types in .NET. Use reflection, which provides infrastructure used by language compilers to implement implicit late binding. +ms.date: "03/30/2017" +dev_langs: + - "csharp" + - "vb" + - "cpp" +helpviewer_keywords: + - "late binding, about late binding" + - "early binding" + - "dynamically loading and using types" + - "implicit late binding" + - "reflection, dynamically using types" +ms.assetid: db985bec-5942-40ec-b13a-771ae98623dc +--- +# Dynamically load and use types + +Reflection provides infrastructure used by language compilers to implement implicit late binding. Binding is the process of locating the declaration (that is, the implementation) that corresponds to a uniquely specified type. When this process occurs at run time rather than at compile time, it's called late binding. Visual Basic allows you to use implicit late binding in your code; the Visual Basic compiler calls a helper method that uses reflection to obtain the object type. The arguments passed to the helper method cause the appropriate method to be invoked at run time. These arguments are the instance (an object) on which to invoke the method, the name of the invoked method (a string), and the arguments passed to the invoked method (an array of objects). + +In the following example, the Visual Basic compiler uses reflection implicitly to call a method on an object whose type is not known at compile time. A `HelloWorld` class has a `PrintHello` method that prints out "Hello World" concatenated with some text that's passed to the `PrintHello` method. The `PrintHello` method called in this example is actually a ; the Visual Basic code allows the `PrintHello` method to be invoked as if the type of the object (`helloObj`) were known at compile time (early binding) rather than at run time (late binding). + +```vb +Module Hello + Sub Main() + ' Sets up the variable. + Dim helloObj As Object + ' Creates the object. + helloObj = new HelloWorld() + ' Invokes the print method as if it was early bound + ' even though it is really late bound. + helloObj.PrintHello("Visual Basic Late Bound") + End Sub +End Module +``` + +## Custom binding + +In addition to being used implicitly by compilers for late binding, reflection can be used explicitly in code to accomplish late binding. + +The [common language runtime](../../standard/clr.md) supports multiple programming languages, and the binding rules of these languages differ. In the early-bound case, code generators can completely control this binding. However, in late binding through reflection, binding must be controlled by customized binding. The class provides custom control of member selection and invocation. + +Using custom binding, you can load an assembly at run time, obtain information about types in that assembly, specify the type that you want, and then invoke methods or access fields or properties on that type. This technique is useful if you don't know an object's type at compile time, such as when the object type is dependent on user input. + +The following example demonstrates a simple custom binder that provides no argument type conversion. Code for `Simple_Type.dll` precedes the main example. Be sure to build `Simple_Type.dll` and then include a reference to it in the project at build time. + +[!code-cpp[Conceptual.Types.Dynamic#1](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.dynamic/cpp/source1.cpp#1)] +[!code-csharp[Conceptual.Types.Dynamic#1](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.dynamic/cs/source1.cs#1)] +[!code-vb[Conceptual.Types.Dynamic#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.dynamic/vb/source1.vb#1)] + +### InvokeMember and CreateInstance + +Use to invoke a member of a type. The `CreateInstance` methods of various classes, such as and , are specialized forms of `InvokeMember` that create new instances of the specified type. The `Binder` class is used for overload resolution and argument coercion in these methods. + +The following example shows the three possible combinations of argument coercion (type conversion) and member selection. In Case 1, no argument coercion or member selection is needed. In Case 2, only member selection is needed. In Case 3, only argument coercion is needed. + +[!code-cpp[Conceptual.Types.Dynamic#2](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.dynamic/cpp/source2.cpp#2)] +[!code-csharp[Conceptual.Types.Dynamic#2](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.dynamic/cs/source2.cs#2)] +[!code-vb[Conceptual.Types.Dynamic#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.dynamic/vb/source2.vb#2)] + +Overload resolution is needed when more than one member with the same name is available. The and methods are used to resolve binding to a single member. `Binder.BindToMethod` also provides property resolution through the `get` and `set` property accessors. + +`BindToMethod` returns the to invoke, or a null reference (`Nothing` in Visual Basic) if no such invocation is possible. The `MethodBase` return value need not be one of those contained in the *match* parameter, although that is the usual case. + +When ByRef arguments are present, the caller might want to get them back. Therefore, `Binder` allows a client to map the array of arguments back to its original form if `BindToMethod` has manipulated the argument array. To do this, the caller must be guaranteed that the order of the arguments is unchanged. When arguments are passed by name, `Binder` reorders the argument array, and that's what the caller sees. For more information, see . + +The set of available members are those members defined in the type or any base type. If is specified, members of any accessibility are returned in the set. If `BindingFlags.NonPublic` is not specified, the binder must enforce accessibility rules. When specifying the `Public` or `NonPublic` binding flag, you must also specify the `Instance` or `Static` binding flag, or no members will be returned. + +If there is only one member of the given name, no callback is necessary, and binding is done on that method. Case 1 of the code example illustrates this point: Only one `PrintBob` method is available, and therefore no callback is needed. + +If there is more than one member in the available set, all these methods are passed to `BindToMethod`, which selects the appropriate method and returns it. In Case 2 of the code example, there are two methods named `PrintValue`. The appropriate method is selected by the call to `BindToMethod`. + + performs argument coercion (type conversion), which converts the actual arguments to the type of the formal arguments of the selected method. `ChangeType` is called for every argument even if the types match exactly. + +In Case 3 of the code example, an actual argument of type `String` with a value of "5.5" is passed to a method with a formal argument of type `Double`. For the invocation to succeed, the string value "5.5" must be converted to a double value. `ChangeType` performs this conversion. + +`ChangeType` performs only lossless or [widening coercions](../../standard/base-types/type-conversion.md), as shown in the following table. + +| Source type | Target type | +| ----------------- | ----------------------------------------------------------------- | +| Any type | Its base type | +| Any type | Interface it implements | +| Char | UInt16, UInt32, Int32, UInt64, Int64, Single, Double | +| Byte | Char, UInt16, Int16, UInt32, Int32, UInt64, Int64, Single, Double | +| SByte | Int16, Int32, Int64, Single, Double | +| UInt16 | UInt32, Int32, UInt64, Int64, Single, Double | +| Int16 | Int32, Int64, Single, Double | +| UInt32 | UInt64, Int64, Single, Double | +| Int32 | Int64, Single, Double | +| UInt64 | Single, Double | +| Int64 | Single, Double | +| Single | Double | +| Nonreference type | Reference type | + +The class has `Get` methods that use parameters of type `Binder` to resolve references to a particular member. , , and search for a particular member of the current type by providing signature information for that member. and are called back on to select the given signature information of the appropriate methods. + +## See also + +- +- +- [View Type Information](viewing-type-information.md) +- [Type Conversion in .NET](../../standard/base-types/type-conversion.md) diff --git a/docs/fundamentals/reflection/emitting-dynamic-methods-and-assemblies.md b/docs/fundamentals/reflection/emitting-dynamic-methods-and-assemblies.md new file mode 100644 index 0000000000000..21a308bce4d5a --- /dev/null +++ b/docs/fundamentals/reflection/emitting-dynamic-methods-and-assemblies.md @@ -0,0 +1,41 @@ +--- +title: "Emitting Dynamic Methods and Assemblies" +description: Emit dynamic methods and assemblies using the System.Reflection.Emit namespace, which allows a compiler or tool to emit metadata and CIL code at run time. +ms.date: 03/27/2024 +helpviewer_keywords: + - "reflection emit" + - "dynamic assemblies" + - "metadata, emit interfaces" + - "reflection emit, overview" + - "assemblies [.NET], emitting dynamic assemblies" +--- +# Emit dynamic methods and assemblies + +This section describes a set of managed types in the namespace that allow a compiler or tool to emit metadata and common intermediate language (CIL) at run time and optionally generate a portable executable (PE) file on disk. Script engines and compilers are the primary users of this namespace. In this section, the functionality provided by the namespace is referred to as *reflection emit*. + +Reflection emit provides the following capabilities: + +- Define lightweight global methods at run time, using the class, and execute them using delegates. +- Define assemblies at run time and then run them and/or save them to disk. +- Define assemblies at run time, run them, and then unload them and allow garbage collection to reclaim their resources. +- Define modules in new assemblies at run time and then run and/or save them to disk. +- Define types in modules at run time, create instances of these types, and invoke their methods. +- Define symbolic information for defined modules that can be used by tools such as debuggers and code profilers. + +In addition to the managed types in the namespace, there are unmanaged metadata interfaces that are described in the [Metadata Interfaces](../../framework/unmanaged-api/metadata/metadata-interfaces.md) reference documentation. Managed reflection emit provides stronger semantic error checking and a higher level of abstraction of the metadata than the unmanaged metadata interfaces. + +Another useful resource for working with metadata and CIL is the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics" and "Partition III: CIL Instruction Set". The documentation is available online at the [Ecma Web site](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/). + +## Reference + +\ +Catalogs the CIL instruction codes you can use to build method bodies. + +\ +Contains managed classes used to emit dynamic methods, assemblies, and types. + +\ +Describes the class, which represents types in managed reflection and reflection emit, and which is key to the use of these technologies. + +\ +Contains managed classes used to explore metadata and managed code. diff --git a/docs/framework/reflection-and-codedom/get-type-member-information.md b/docs/fundamentals/reflection/get-type-member-information.md similarity index 84% rename from docs/framework/reflection-and-codedom/get-type-member-information.md rename to docs/fundamentals/reflection/get-type-member-information.md index b64fa5835edb0..2fd0e4f4cafee 100644 --- a/docs/framework/reflection-and-codedom/get-type-member-information.md +++ b/docs/fundamentals/reflection/get-type-member-information.md @@ -5,7 +5,7 @@ ms.date: "09/03/2019" ms.topic: how-to helpviewer_keywords: - "reflection, obtaining member information" - - "types [.NET Framework], obtaining member information from" + - "types [.NET], obtaining member information from" ms.assetid: 348ae651-ccda-4f13-8eda-19e8337e9438 dev_langs: - "cpp" @@ -26,6 +26,4 @@ The following example obtains type and member information by using reflection: ## See also -- [Program with application domains](../app-domains/application-domains.md#programming-with-application-domains) - [Reflection](reflection.md) -- [Use application domains](../app-domains/use.md) diff --git a/docs/fundamentals/reflection/how-to-define-a-generic-method-with-reflection-emit.md b/docs/fundamentals/reflection/how-to-define-a-generic-method-with-reflection-emit.md new file mode 100644 index 0000000000000..8b566236ab4de --- /dev/null +++ b/docs/fundamentals/reflection/how-to-define-a-generic-method-with-reflection-emit.md @@ -0,0 +1,161 @@ +--- +title: "How to: Define a Generic Method with Reflection Emit" +description: Define a generic method with reflection emit. One example creates a generic method with two type parameters. A second example shows how to emit the method body. +ms.date: 03/27/2024 +dev_langs: + - "csharp" + - "vb" +helpviewer_keywords: + - "generics [.NET], reflection emit" + - "reflection emit, generic methods" + - "generics [.NET], dynamic types" +ms.assetid: 93892fa4-90b3-4ec4-b147-4bec9880de2b +--- +# How to: Define a generic method with reflection emit + +The first procedure shows how to create a simple generic method with two type parameters, and how to apply class constraints, interface constraints, and special constraints to the type parameters. + +The second procedure shows how to emit the method body, and how to use the type parameters of the generic method to create instances of generic types and to call their methods. + +The third procedure shows how to invoke the generic method. + +> [!IMPORTANT] +> A method is not generic just because it belongs to a generic type and uses the type parameters of that type. A method is generic only if it has its own type parameter list. A generic method can appear on a nongeneric type, as in this example. For an example of a nongeneric method on a generic type, see [How to: Define a Generic Type with Reflection Emit](how-to-define-a-generic-type-with-reflection-emit.md). + +## Define a generic method + +1. Before beginning, it is useful to look at how the generic method appears when written using a high-level language. The following code is included in the example code for this article, along with code to call the generic method. The method has two type parameters, `TInput` and `TOutput`, the second of which must be a reference type (`class`), must have a parameterless constructor (`new`), and must implement `ICollection`. This interface constraint ensures that the method can be used to add elements to the `TOutput` collection that the method creates. The method has one formal parameter, `input`, which is an array of `TInput`. The method creates a collection of type `TOutput` and copies the elements of `input` to the collection. + + [!code-csharp[GenericMethodHowTo#20](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#20)] + [!code-vb[GenericMethodHowTo#20](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#20)] + +1. Define a dynamic assembly and a dynamic module to contain the type the generic method belongs to. In this case, the assembly has only one module, named `DemoMethodBuilder1`, and the module name is the same as the assembly name plus an extension. In this example, the assembly is saved to disk and also executed, so is specified. You can use the [Ildasm.exe (IL Disassembler)](../../framework/tools/ildasm-exe-il-disassembler.md) to examine DemoMethodBuilder1.dll and to compare it to the common intermediate language (CIL) for the method shown in step 1. + + [!code-csharp[GenericMethodHowTo#2](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#2)] + [!code-vb[GenericMethodHowTo#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#2)] + +1. Define the type the generic method belongs to. The type does not have to be generic. A generic method can belong to either a generic or nongeneric type. In this example, the type is a class, is not generic, and is named `DemoType`. + + [!code-csharp[GenericMethodHowTo#3](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#3)] + [!code-vb[GenericMethodHowTo#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#3)] + +1. Define the generic method. If the types of a generic method's formal parameters are specified by generic type parameters of the generic method, use the method overload to define the method. The generic type parameters of the method are not yet defined, so you cannot specify the types of the method's formal parameters in the call to . In this example, the method is named `Factory`. The method is public and `static` (`Shared` in Visual Basic). + + [!code-csharp[GenericMethodHowTo#4](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#4)] + [!code-vb[GenericMethodHowTo#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#4)] + +1. Define the generic type parameters of `DemoMethod` by passing an array of strings containing the names of the parameters to the method. This makes the method a generic method. The following code makes `Factory` a generic method with type parameters `TInput` and `TOutput`. To make the code easier to read, variables with these names are created to hold the objects representing the two type parameters. + + [!code-csharp[GenericMethodHowTo#5](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#5)] + [!code-vb[GenericMethodHowTo#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#5)] + +1. Optionally add special constraints to the type parameters. Special constraints are added using the method. In this example, `TOutput` is constrained to be a reference type and to have a parameterless constructor. + + [!code-csharp[GenericMethodHowTo#6](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#6)] + [!code-vb[GenericMethodHowTo#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#6)] + +1. Optionally add class and interface constraints to the type parameters. In this example, type parameter `TOutput` is constrained to types that implement the `ICollection(Of TInput)` (`ICollection` in C#) interface. This ensures that the method can be used to add elements. + + [!code-csharp[GenericMethodHowTo#7](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#7)] + [!code-vb[GenericMethodHowTo#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#7)] + +1. Define the formal parameters of the method, using the method. In this example, the `Factory` method has one parameter, an array of `TInput`. This type is created by calling the method on the that represents `TInput`. The argument of is an array of objects. + + [!code-csharp[GenericMethodHowTo#8](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#8)] + [!code-vb[GenericMethodHowTo#8](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#8)] + +1. Define the return type for the method, using the method. In this example, an instance of `TOutput` is returned. + + [!code-csharp[GenericMethodHowTo#9](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#9)] + [!code-vb[GenericMethodHowTo#9](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#9)] + +1. Emit the method body, using . For details, see the accompanying procedure for emitting the method body. + + > [!IMPORTANT] + > When you emit calls to methods of generic types, and the type arguments of those types are type parameters of the generic method, you must use the `static`, , and method overloads of the class to obtain constructed forms of the methods. The accompanying procedure for emitting the method body demonstrates this. + +1. Complete the type that contains the method and save the assembly. The accompanying procedure for invoking the generic method shows two ways to invoke the completed method. + + [!code-csharp[GenericMethodHowTo#14](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#14)] + [!code-vb[GenericMethodHowTo#14](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#14)] + +## Emit the method body + +1. Get a code generator and declare local variables and labels. The method is used to declare local variables. The `Factory` method has four local variables: `retVal` to hold the new `TOutput` that is returned by the method, `ic` to hold the `TOutput` when it is cast to `ICollection`, `input` to hold the input array of `TInput` objects, and `index` to iterate through the array. The method also has two labels, one to enter the loop (`enterLoop`) and one for the top of the loop (`loopAgain`), defined using the method. + + The first thing the method does is to load its argument using opcode and to store it in the local variable `input` using opcode. + + [!code-csharp[GenericMethodHowTo#10](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#10)] + [!code-vb[GenericMethodHowTo#10](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#10)] + +2. Emit code to create an instance of `TOutput`, using the generic method overload of the method. Using this overload requires the specified type to have a parameterless constructor, which is the reason for adding that constraint to `TOutput`. Create the constructed generic method by passing `TOutput` to . After emitting code to call the method, emit code to store it in the local variable `retVal` using + + [!code-csharp[GenericMethodHowTo#11](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#11)] + [!code-vb[GenericMethodHowTo#11](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#11)] + +3. Emit code to cast the new `TOutput` object to `ICollection(Of TInput)` and store it in the local variable `ic`. + + [!code-csharp[GenericMethodHowTo#31](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#31)] + [!code-vb[GenericMethodHowTo#31](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#31)] + +4. Get a representing the method. The method is acting on an `ICollection`, so it's necessary to get the `Add` method specific to that constructed type. You cannot use the method to get this directly from `icollOfTInput`, because is not supported on a type that has been constructed with a . Instead, call on `icoll`, which contains the generic type definition for the generic interface. Then use the `static` method to produce the for the constructed type. The following code demonstrates this. + + [!code-csharp[GenericMethodHowTo#12](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#12)] + [!code-vb[GenericMethodHowTo#12](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#12)] + +5. Emit code to initialize the `index` variable, by loading a 32-bit integer 0 and storing it in the variable. Emit code to branch to the label `enterLoop`. This label has not yet been marked, because it is inside the loop. Code for the loop is emitted in the next step. + + [!code-csharp[GenericMethodHowTo#32](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#32)] + [!code-vb[GenericMethodHowTo#32](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#32)] + +6. Emit code for the loop. The first step is to mark the top of the loop, by calling with the `loopAgain` label. Branch statements that use the label will now branch to this point in the code. The next step is to push the `TOutput` object, cast to `ICollection(Of TInput)`, onto the stack. It is not needed immediately, but needs to be in position for calling the `Add` method. Next the input array is pushed onto the stack, then the `index` variable containing the current index into the array. The opcode pops the index and the array off the stack and pushes the indexed array element onto the stack. The stack is now ready for the call to the method, which pops the collection and the new element off the stack and adds the element to the collection. + + The rest of the code in the loop increments the index and tests to see whether the loop is finished: The index and a 32-bit integer 1 are pushed onto the stack and added, leaving the sum on the stack; the sum is stored in `index`. is called to set this point as the entry point for the loop. The index is loaded again. The input array is pushed on the stack, and is emitted to get its length. The index and the length are now on the stack, and is emitted to compare them. If the index is less than the length, branches back to the beginning of the loop. + + [!code-csharp[GenericMethodHowTo#13](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#13)] + [!code-vb[GenericMethodHowTo#13](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#13)] + +7. Emit code to push the `TOutput` object onto the stack and return from the method. The local variables `retVal` and `ic` both contain references to the new `TOutput`; `ic` is used only to access the method. + + [!code-csharp[GenericMethodHowTo#33](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#33)] + [!code-vb[GenericMethodHowTo#33](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#33)] + +## Invoke the generic method + +1. `Factory` is a generic method definition. In order to invoke it, you must assign types to its generic type parameters. Use the method to do this. The following code creates a constructed generic method, specifying for `TInput` and `List(Of String)` (`List` in C#) for `TOutput`, and displays a string representation of the method. + + [!code-csharp[GenericMethodHowTo#21](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#21)] + [!code-vb[GenericMethodHowTo#21](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#21)] + +2. To invoke the method late-bound, use the method. The following code creates an array of , containing as its only element an array of strings, and passes it as the argument list for the generic method. The first parameter of is a null reference because the method is `static`. The return value is cast to `List(Of String)`, and its first element is displayed. + + [!code-csharp[GenericMethodHowTo#22](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#22)] + [!code-vb[GenericMethodHowTo#22](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#22)] + +3. To invoke the method using a delegate, you must have a delegate that matches the signature of the constructed generic method. An easy way to do this is to create a generic delegate. The following code creates an instance of the generic delegate `D` defined in the example code, using the method overload, and invokes the delegate. Delegates perform better than late-bound calls. + + [!code-csharp[GenericMethodHowTo#23](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#23)] + [!code-vb[GenericMethodHowTo#23](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#23)] + +4. The emitted method can also be called from a program that refers to the saved assembly. + +## Example + +The following code example creates a nongeneric type, `DemoType`, with a generic method, `Factory`. This method has two generic type parameters, `TInput` to specify an input type and `TOutput` to specify an output type. The `TOutput` type parameter is constrained to implement `ICollection` (`ICollection(Of TInput)` in Visual Basic), to be a reference type, and to have a parameterless constructor. + +The method has one formal parameter, which is an array of `TInput`. The method returns an instance of `TOutput` that contains all the elements of the input array. `TOutput` can be any generic collection type that implements the generic interface. + +When the code is executed, the dynamic assembly is saved as DemoGenericMethod1.dll, and can be examined using the [Ildasm.exe (IL Disassembler)](../../framework/tools/ildasm-exe-il-disassembler.md). + +> [!NOTE] +> A good way to learn how to emit code is to write a program that performs the task you're trying to emit, and use the disassembler to examine the CIL produced by the compiler. + +The code example includes source code that's equivalent to the emitted method. The emitted method is invoked late-bound and also by using a generic delegate declared in the code example. + +[!code-csharp[GenericMethodHowTo#1](../../../samples/snippets/csharp/VS_Snippets_CLR/GenericMethodHowTo/CS/source.cs#1)] +[!code-vb[GenericMethodHowTo#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/GenericMethodHowTo/VB/source.vb#1)] + +## See also + +- +- [How to: Define a Generic Type with Reflection Emit](how-to-define-a-generic-type-with-reflection-emit.md) diff --git a/docs/fundamentals/reflection/how-to-define-a-generic-type-with-reflection-emit.md b/docs/fundamentals/reflection/how-to-define-a-generic-type-with-reflection-emit.md new file mode 100644 index 0000000000000..3b41e829dbe32 --- /dev/null +++ b/docs/fundamentals/reflection/how-to-define-a-generic-type-with-reflection-emit.md @@ -0,0 +1,129 @@ +--- +title: "How to: Define a Generic Type with Reflection Emit" +description: See how to define a generic type with reflection emit. Create a generic type with two type parameters, apply class constraints, interface constraints, and more. +ms.date: 03/27/2024 +dev_langs: + - "csharp" + - "vb" + - "cpp" +helpviewer_keywords: + - "generics [.NET], reflection emit" + - "generics [.NET], dynamic types" + - "reflection emit, generic types" +ms.assetid: 07d5f01a-7b5b-40ea-9b15-f21561098fe4 +--- +# How to: Define a generic type with reflection emit + +This article shows how to create a simple generic type with two type parameters, how to apply class constraints, interface constraints, and special constraints to the type parameters, and how to create members that use the type parameters of the class as parameter types and return types. + +> [!IMPORTANT] +> A method is not generic just because it belongs to a generic type and uses the type parameters of that type. A method is generic only if it has its own type parameter list. Most methods on generic types are not generic, as in this example. For an example of emitting a generic method, see [How to: Define a Generic Method with Reflection Emit](how-to-define-a-generic-method-with-reflection-emit.md). + +## Define a generic type + +1. Define a dynamic assembly named `GenericEmitExample1`. In this example, the assembly is executed and saved to disk, so is specified. + + [!code-cpp[EmitGenericType#2](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#2)] + [!code-csharp[EmitGenericType#2](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#2)] + [!code-vb[EmitGenericType#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#2)] + +1. Define a dynamic module. An assembly is made up of executable modules. For a single-module assembly, the module name is the same as the assembly name, and the file name is the module name plus an extension. + + [!code-cpp[EmitGenericType#3](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#3)] + [!code-csharp[EmitGenericType#3](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#3)] + [!code-vb[EmitGenericType#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#3)] + +1. Define a class. In this example, the class is named `Sample`. + + [!code-cpp[EmitGenericType#4](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#4)] + [!code-csharp[EmitGenericType#4](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#4)] + [!code-vb[EmitGenericType#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#4)] + +1. Define the generic type parameters of `Sample` by passing an array of strings containing the names of the parameters to the method. This makes the class a generic type. The return value is an array of objects representing the type parameters, which can be used in your emitted code. + + In the following code, `Sample` becomes a generic type with type parameters `TFirst` and `TSecond`. To make the code easier to read, each is placed in a variable with the same name as the type parameter. + + [!code-cpp[EmitGenericType#5](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#5)] + [!code-csharp[EmitGenericType#5](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#5)] + [!code-vb[EmitGenericType#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#5)] + +1. Add special constraints to the type parameters. In this example, type parameter `TFirst` is constrained to types that have parameterless constructors, and to reference types. + + [!code-cpp[EmitGenericType#6](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#6)] + [!code-csharp[EmitGenericType#6](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#6)] + [!code-vb[EmitGenericType#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#6)] + +1. Optionally add class and interface constraints to the type parameters. In this example, type parameter `TFirst` is constrained to types that derive from the base class represented by the object contained in the variable `baseType`, and that implement the interfaces whose types are contained in the variables `interfaceA` and `interfaceB`. See the code example for the declaration and assignment of these variables. + + [!code-cpp[EmitGenericType#7](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#7)] + [!code-csharp[EmitGenericType#7](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#7)] + [!code-vb[EmitGenericType#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#7)] + +1. Define a field. In this example, the type of the field is specified by type parameter `TFirst`. derives from , so you can use generic type parameters anywhere a type can be used. + + [!code-cpp[EmitGenericType#21](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#21)] + [!code-csharp[EmitGenericType#21](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#21)] + [!code-vb[EmitGenericType#21](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#21)] + +1. Define a method that uses the type parameters of the generic type. Note that such methods are not generic unless they have their own type parameter lists. The following code defines a `static` method (`Shared` in Visual Basic) that takes an array of `TFirst` and returns a `List` (`List(Of TFirst)` in Visual Basic) containing all the elements of the array. To define this method, it is necessary to create the type `List` by calling on the generic type definition, `List`. (The `T` is omitted when you use the `typeof` operator (`GetType` in Visual Basic) to get the generic type definition.) The parameter type is created by using the method. + + [!code-cpp[EmitGenericType#22](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#22)] + [!code-csharp[EmitGenericType#22](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#22)] + [!code-vb[EmitGenericType#22](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#22)] + +1. Emit the method body. The method body consists of three opcodes that load the input array onto the stack, call the `List` constructor that takes `IEnumerable` (which does all the work of putting the input elements into the list), and return (leaving the new object on the stack). The difficult part of emitting this code is getting the constructor. + + The method is not supported on a , so it is not possible to get the constructor of `List` directly. First, it is necessary to get the constructor of the generic type definition `List` and then to call a method that converts it to the corresponding constructor of `List`. + + The constructor used for this code example takes an `IEnumerable`. Note, however, that this is not the generic type definition of the generic interface; instead, the type parameter `T` from `List` must be substituted for the type parameter `T` of `IEnumerable`. (This seems confusing only because both types have type parameters named `T`. That is why this code example uses the names `TFirst` and `TSecond`.) To get the type of the constructor argument, start with the generic type definition `IEnumerable` and call with the first generic type parameter of `List`. The constructor argument list must be passed as an array, with just one argument in this case. + + > [!NOTE] + > The generic type definition is expressed as `IEnumerable<>` when you use the `typeof` operator in C#, or `IEnumerable(Of )` when you use the `GetType` operator in Visual Basic. + + Now it is possible to get the constructor of `List` by calling on the generic type definition. To convert this constructor to the corresponding constructor of `List`, pass `List` and the constructor from `List` to the static method. + + [!code-cpp[EmitGenericType#23](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#23)] + [!code-csharp[EmitGenericType#23](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#23)] + [!code-vb[EmitGenericType#23](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#23)] + +1. Create the type and save the file. + + [!code-cpp[EmitGenericType#8](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#8)] + [!code-csharp[EmitGenericType#8](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#8)] + [!code-vb[EmitGenericType#8](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#8)] + +1. Invoke the method. `ExampleMethod` is not generic, but the type it belongs to is generic, so to get a that can be invoked, it's necessary to create a constructed type from the type definition for `Sample`. The constructed type uses the `Example` class, which satisfies the constraints on `TFirst` because it is a reference type and has a default parameterless constructor, and the `ExampleDerived` class which satisfies the constraints on `TSecond`. (The code for `ExampleDerived` can be found in the example code section.) These two types are passed to to create the constructed type. The is then obtained using the method. + + [!code-cpp[EmitGenericType#9](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#9)] + [!code-csharp[EmitGenericType#9](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#9)] + [!code-vb[EmitGenericType#9](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#9)] + +1. The following code creates an array of `Example` objects, places that array in an array of type representing the arguments of the method to be invoked, and passes them to the method. The first argument of the method is a null reference because the method is `static`. + + [!code-cpp[EmitGenericType#10](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#10)] + [!code-csharp[EmitGenericType#10](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#10)] + [!code-vb[EmitGenericType#10](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#10)] + +## Example + +The following code example defines a class named `Sample`, along with a base class and two interfaces. The program defines two generic type parameters for `Sample`, turning it into a generic type. Type parameters are the only thing that makes a type generic. The program shows this by displaying a test message before and after the definition of the type parameters. + +The type parameter `TSecond` is used to demonstrate class and interface constraints, using the base class and interfaces, and the type parameter `TFirst` is used to demonstrate special constraints. + +The code example defines a field and a method using the class's type parameters for the field type and for the parameter and return type of the method. + +After the `Sample` class has been created, the method is invoked. + +The program includes a method that lists information about a generic type, and a method that lists the special constraints on a type parameter. These methods are used to display information about the finished `Sample` class. + +The program saves the finished module to disk as `GenericEmitExample1.dll`, so you can open it with the [Ildasm.exe (IL Disassembler)](../../framework/tools/ildasm-exe-il-disassembler.md) and examine the CIL for the `Sample` class. + +[!code-cpp[EmitGenericType#1](../../../samples/snippets/cpp/VS_Snippets_CLR/EmitGenericType/CPP/source.cpp#1)] +[!code-csharp[EmitGenericType#1](../../../samples/snippets/csharp/VS_Snippets_CLR/EmitGenericType/CS/source.cs#1)] +[!code-vb[EmitGenericType#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/EmitGenericType/VB/source.vb#1)] + +## See also + +- +- [Using Reflection Emit](/previous-versions/dotnet/netframework-4.0/3y322t50(v=vs.100)) +- [Reflection Emit Dynamic Assembly Scenarios](/previous-versions/dotnet/netframework-4.0/tt9483fk(v=vs.100)) diff --git a/docs/fundamentals/reflection/how-to-define-and-execute-dynamic-methods.md b/docs/fundamentals/reflection/how-to-define-and-execute-dynamic-methods.md new file mode 100644 index 0000000000000..7025750fcf7a7 --- /dev/null +++ b/docs/fundamentals/reflection/how-to-define-and-execute-dynamic-methods.md @@ -0,0 +1,110 @@ +--- +title: "How to: Define and Execute Dynamic Methods" +description: See how to define and execute dynamic methods in .NET. View examples of a simple dynamic method and a dynamic method bound to an instance of a class. +ms.date: "03/30/2017" +dev_langs: + - "csharp" + - "vb" + - "cpp" +helpviewer_keywords: + - "reflection emit, dynamic methods" + - "dynamic methods" +ms.assetid: 07d08a99-62c5-4254-bce2-2a75e55a18ab +--- +# How to: Define and execute dynamic methods + +The following procedures show how to define and execute a simple dynamic method and a dynamic method bound to an instance of a class. For more information on dynamic methods, see the class. + +1. Declare a delegate type to execute the method. Consider using a generic delegate to minimize the number of delegate types you need to declare. The following code declares two delegate types that could be used for the `SquareIt` method, and one of them is generic. + + [!code-cpp[DynamicMethodHowTo#2](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#2)] + [!code-csharp[DynamicMethodHowTo#2](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#2)] + [!code-vb[DynamicMethodHowTo#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#2)] + +1. Create an array that specifies the parameter types for the dynamic method. In this example, the only parameter is an `int` (`Integer` in Visual Basic), so the array has only one element. + + [!code-cpp[DynamicMethodHowTo#3](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#3)] + [!code-csharp[DynamicMethodHowTo#3](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#3)] + [!code-vb[DynamicMethodHowTo#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#3)] + +1. Create a . In this example the method is named `SquareIt`. + + > [!NOTE] + > It is not necessary to give dynamic methods names, and they cannot be invoked by name. Multiple dynamic methods can have the same name. However, the name appears in call stacks and can be useful for debugging. + + The type of the return value is specified as `long`. The method is associated with the module that contains the `Example` class, which contains the example code. Any loaded module could be specified. The dynamic method acts like a module-level `static` method (`Shared` in Visual Basic). + + [!code-cpp[DynamicMethodHowTo#4](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#4)] + [!code-csharp[DynamicMethodHowTo#4](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#4)] + [!code-vb[DynamicMethodHowTo#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#4)] + +1. Emit the method body. In this example, an object is used to emit the common intermediate language (CIL). Alternatively, a object can be used in conjunction with unmanaged code generators to emit the method body for a . + + The CIL in this example loads the argument, which is an `int`, onto the stack, converts it to a `long`, duplicates the `long`, and multiplies the two numbers. This leaves the squared result on the stack, and all the method has to do is return. + + [!code-cpp[DynamicMethodHowTo#5](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#5)] + [!code-csharp[DynamicMethodHowTo#5](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#5)] + [!code-vb[DynamicMethodHowTo#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#5)] + +1. Create an instance of the delegate (declared in step 1) that represents the dynamic method by calling the method. Creating the delegate completes the method, and any further attempts to change the method — for example, adding more CIL — are ignored. The following code creates the delegate and invokes it, using a generic delegate. + + [!code-cpp[DynamicMethodHowTo#6](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#6)] + [!code-csharp[DynamicMethodHowTo#6](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#6)] + [!code-vb[DynamicMethodHowTo#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#6)] + +1. Declare a delegate type to execute the method. Consider using a generic delegate to minimize the number of delegate types you need to declare. The following code declares a generic delegate type that can be used to execute any method with one parameter and a return value, or a method with two parameters and a return value if the delegate is bound to an object. + + [!code-cpp[DynamicMethodHowTo#12](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#12)] + [!code-csharp[DynamicMethodHowTo#12](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#12)] + [!code-vb[DynamicMethodHowTo#12](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#12)] + +1. Create an array that specifies the parameter types for the dynamic method. If the delegate representing the method is to be bound to an object, the first parameter must match the type the delegate is bound to. In this example, there are two parameters, of type `Example` and type `int` (`Integer` in Visual Basic). + + [!code-cpp[DynamicMethodHowTo#13](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#13)] + [!code-csharp[DynamicMethodHowTo#13](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#13)] + [!code-vb[DynamicMethodHowTo#13](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#13)] + +1. Create a . In this example the method has no name. The type of the return value is specified as `int` (`Integer` in Visual Basic). The method has access to the private and protected members of the `Example` class. + + [!code-cpp[DynamicMethodHowTo#14](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#14)] + [!code-csharp[DynamicMethodHowTo#14](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#14)] + [!code-vb[DynamicMethodHowTo#14](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#14)] + +1. Emit the method body. In this example, an object is used to emit the common intermediate language (CIL). Alternatively, a object can be used in conjunction with unmanaged code generators to emit the method body for a . + + The CIL in this example loads the first argument, which is an instance of the `Example` class, and uses it to load the value of a private instance field of type `int`. The second argument is loaded, and the two numbers are multiplied. If the result is larger than `int`, the value is truncated and the most significant bits are discarded. The method returns, with the return value on the stack. + + [!code-cpp[DynamicMethodHowTo#15](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#15)] + [!code-csharp[DynamicMethodHowTo#15](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#15)] + [!code-vb[DynamicMethodHowTo#15](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#15)] + +1. Create an instance of the delegate (declared in step 1) that represents the dynamic method by calling the method overload. Creating the delegate completes the method, and any further attempts to change the method—for example, adding more CIL—are ignored. + + > [!NOTE] + > You can call the method multiple times to create delegates bound to other instances of the target type. + + The following code binds the method to a new instance of the `Example` class whose private test field is set to 42. That is, each time the delegate is invoked the instance of `Example` is passed to the first parameter of the method. + + The delegate `OneParameter` is used because the first parameter of the method always receives the instance of `Example`. When the delegate is invoked, only the second parameter is required. + + [!code-cpp[DynamicMethodHowTo#16](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#16)] + [!code-csharp[DynamicMethodHowTo#16](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#16)] + [!code-vb[DynamicMethodHowTo#16](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#16)] + +## Example + +The following code example demonstrates a simple dynamic method and a dynamic method bound to an instance of a class. + +The simple dynamic method takes one argument, a 32-bit integer, and returns the 64-bit square of that integer. A generic delegate is used to invoke the method. + +The second dynamic method has two parameters, of type `Example` and type `int` (`Integer` in Visual Basic). When the dynamic method has been created, it is bound to an instance of `Example`, using a generic delegate that has one argument of type `int`. The delegate does not have an argument of type `Example` because the first parameter of the method always receives the bound instance of `Example`. When the delegate is invoked, only the `int` argument is supplied. This dynamic method accesses a private field of the `Example` class and returns the product of the private field and the `int` argument. + +The code example defines delegates that can be used to execute the methods. + +[!code-cpp[DynamicMethodHowTo#1](../../../samples/snippets/cpp/VS_Snippets_CLR/DynamicMethodHowTo/cpp/source.cpp#1)] +[!code-csharp[DynamicMethodHowTo#1](../../../samples/snippets/csharp/VS_Snippets_CLR/DynamicMethodHowTo/cs/source.cs#1)] +[!code-vb[DynamicMethodHowTo#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/DynamicMethodHowTo/vb/source.vb#1)] + +## See also + +- diff --git a/docs/fundamentals/reflection/how-to-examine-and-instantiate-generic-types-with-reflection.md b/docs/fundamentals/reflection/how-to-examine-and-instantiate-generic-types-with-reflection.md new file mode 100644 index 0000000000000..6ca8b10616319 --- /dev/null +++ b/docs/fundamentals/reflection/how-to-examine-and-instantiate-generic-types-with-reflection.md @@ -0,0 +1,118 @@ +--- +title: "How to: Examine and Instantiate Generic Types with Reflection" +description: See how to examine and instantiate generic types with reflection. Use the IsGenericType, IsGenericParameter, and GenericParameterPosition properties. +ms.date: "03/30/2017" +dev_langs: + - "csharp" + - "vb" + - "cpp" +helpviewer_keywords: + - "reflection, generic types" + - "generics [.NET], reflection" +ms.assetid: f93b03b0-1778-43fc-bc6d-35983d210e74 +--- +# How to: Examine and instantiate generic types with reflection + +Information about generic types is obtained in the same way as information about other types: by examining a object that represents the generic type. The principle difference is that a generic type has a list of objects representing its generic type parameters. The first procedure in this section examines generic types. + +You can create a object that represents a constructed type by binding type arguments to the type parameters of a generic type definition. The second procedure demonstrates this. + +## To examine a generic type and its type parameters + +1. Get an instance of that represents the generic type. In the following code, the type is obtained using the C# `typeof` operator (`GetType` in Visual Basic, `typeid` in Visual C++). See the class topic for other ways to get a object. Note that in the rest of this procedure, the type is contained in a method parameter named `t`. + + [!code-cpp[HowToGeneric#2](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#2)] + [!code-csharp[HowToGeneric#2](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#2)] + [!code-vb[HowToGeneric#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#2)] + +2. Use the property to determine whether the type is generic, and use the property to determine whether the type is a generic type definition. + + [!code-cpp[HowToGeneric#3](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#3)] + [!code-csharp[HowToGeneric#3](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#3)] + [!code-vb[HowToGeneric#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#3)] + +3. Get an array that contains the generic type arguments, using the method. + + [!code-cpp[HowToGeneric#4](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#4)] + [!code-csharp[HowToGeneric#4](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#4)] + [!code-vb[HowToGeneric#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#4)] + +4. For each type argument, determine whether it is a type parameter (for example, in a generic type definition) or a type that has been specified for a type parameter (for example, in a constructed type), using the property. + + [!code-cpp[HowToGeneric#5](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#5)] + [!code-csharp[HowToGeneric#5](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#5)] + [!code-vb[HowToGeneric#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#5)] + +5. In the type system, a generic type parameter is represented by an instance of , just as ordinary types are. The following code displays the name and parameter position of a object that represents a generic type parameter. The parameter position is trivial information here; it is of more interest when you are examining a type parameter that has been used as a type argument of another generic type. + + [!code-cpp[HowToGeneric#6](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#6)] + [!code-csharp[HowToGeneric#6](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#6)] + [!code-vb[HowToGeneric#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#6)] + +6. Determine the base type constraint and the interface constraints of a generic type parameter by using the method to obtain all the constraints in a single array. Constraints are not guaranteed to be in any particular order. + + [!code-cpp[HowToGeneric#7](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#7)] + [!code-csharp[HowToGeneric#7](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#7)] + [!code-vb[HowToGeneric#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#7)] + +7. Use the property to discover the special constraints on a type parameter, such as requiring that it be a reference type. The property also includes values that represent variance, which you can mask off as shown in the following code. + + [!code-cpp[HowToGeneric#8](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#8)] + [!code-csharp[HowToGeneric#8](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#8)] + [!code-vb[HowToGeneric#8](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#8)] + +8. The special constraint attributes are flags, and the same flag () that represents no special constraints also represents no covariance or contravariance. Thus, to test for either of these conditions you must use the appropriate mask. In this case, use to isolate the special constraint flags. + + [!code-cpp[HowToGeneric#9](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#9)] + [!code-csharp[HowToGeneric#9](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#9)] + [!code-vb[HowToGeneric#9](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#9)] + +## Construct an instance of a generic type + +A generic type is like a template. You cannot create instances of it unless you specify real types for its generic type parameters. To do this at run time, using reflection, requires the method. + +1. Get a object that represents the generic type. The following code gets the generic type in two different ways: by using the method overload with a string describing the type, and by calling the method on the constructed type `Dictionary\` (`Dictionary(Of String, Example)` in Visual Basic). The method requires a generic type definition. + + [!code-cpp[HowToGeneric#10](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#10)] + [!code-csharp[HowToGeneric#10](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#10)] + [!code-vb[HowToGeneric#10](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#10)] + +2. Construct an array of type arguments to substitute for the type parameters. The array must contain the correct number of objects, in the same order as they appear in the type parameter list. In this case, the key (first type parameter) is of type , and the values in the dictionary are instances of a class named `Example`. + + [!code-cpp[HowToGeneric#11](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#11)] + [!code-csharp[HowToGeneric#11](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#11)] + [!code-vb[HowToGeneric#11](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#11)] + +3. Call the method to bind the type arguments to the type parameters and construct the type. + + [!code-cpp[HowToGeneric#12](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#12)] + [!code-csharp[HowToGeneric#12](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#12)] + [!code-vb[HowToGeneric#12](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#12)] + +4. Use the method overload to create an object of the constructed type. The following code stores two instances of the `Example` class in the resulting `Dictionary` object. + + [!code-cpp[HowToGeneric#13](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#13)] + [!code-csharp[HowToGeneric#13](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#13)] + [!code-vb[HowToGeneric#13](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#13)] + +## Example + +The following code example defines a `DisplayGenericType` method to examine the generic type definitions and constructed types used in the code and display their information. The `DisplayGenericType` method shows how to use the , , and properties and the method. + +The example also defines a `DisplayGenericParameter` method to examine a generic type parameter and display its constraints. + +The code example defines a set of test types, including a generic type that illustrates type parameter constraints, and shows how to display information about these types. + +The example constructs a type from the class by creating an array of type arguments and calling the method. The program compares the object constructed using with a object obtained using `typeof` (`GetType` in Visual Basic), demonstrating that they are the same. Similarly, the program uses the method to obtain the generic type definition of the constructed type, and compares it to the object representing the class. + +[!code-cpp[HowToGeneric#1](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/ur.cpp#1)] +[!code-csharp[HowToGeneric#1](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/ur.cs#1)] +[!code-vb[HowToGeneric#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/ur.vb#1)] + +## See also + +- +- +- [Reflection and Generic Types](reflection-and-generic-types.md) +- [Viewing Type Information](viewing-type-information.md) +- [Generics](../../standard/generics/index.md) diff --git a/docs/fundamentals/reflection/how-to-hook-up-a-delegate-using-reflection.md b/docs/fundamentals/reflection/how-to-hook-up-a-delegate-using-reflection.md new file mode 100644 index 0000000000000..b796fddb8e5b0 --- /dev/null +++ b/docs/fundamentals/reflection/how-to-hook-up-a-delegate-using-reflection.md @@ -0,0 +1,109 @@ +--- +title: "How to: Hook Up a Delegate Using Reflection" +description: See how to hook up a delegate using reflection in .NET. Connect an existing method to an event by getting the necessary types through reflection. +ms.date: "03/30/2017" +dev_langs: + - "csharp" + - "vb" + - "cpp" +helpviewer_keywords: + - "events [.NET], adding event handlers with reflection" + - "reflection, adding event-handler delegates" + - "delegates [.NET], adding event handlers with reflection" +ms.assetid: 076ee62d-a964-449e-a447-c31b33518b81 +--- +# How to: Hook up a delegate using reflection + +When you use reflection to load and run assemblies, you can't use language features like the C# `+=` operator or the Visual Basic [AddHandler statement](../../visual-basic/language-reference/statements/addhandler-statement.md) to hook up events. The following procedures show how to hook up an existing method to an event by getting all the necessary types through reflection, and how to create a dynamic method using reflection emit and hook it up to an event. + +> [!NOTE] +> For another way to hook up an event-handling delegate, see the code example for the method of the class. + +## To hook up a delegate using reflection + +1. Load an assembly that contains a type that raises events. Assemblies are usually loaded with the method. To keep this example simple, a derived form in the current assembly is used, so the method is used to load the current assembly. + + [!code-cpp[HookUpDelegate#3](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#3)] + [!code-csharp[HookUpDelegate#3](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#3)] + [!code-vb[HookUpDelegate#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#3)] + +2. Get a object representing the type, and create an instance of the type. The method is used in the following code because the form has a parameterless constructor. There are several other overloads of the method that you can use if the type you are creating does not have a parameterless constructor. The new instance is stored as type to maintain the fiction that nothing is known about the assembly. (Reflection allows you to get the types in an assembly without knowing their names in advance.) + + [!code-cpp[HookUpDelegate#4](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#4)] + [!code-csharp[HookUpDelegate#4](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#4)] + [!code-vb[HookUpDelegate#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#4)] + +3. Get an object representing the event, and use the property to get the type of delegate used to handle the event. In the following code, an for the event is obtained. + + [!code-cpp[HookUpDelegate#5](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#5)] + [!code-csharp[HookUpDelegate#5](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#5)] + [!code-vb[HookUpDelegate#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#5)] + +4. Get a object representing the method that handles the event. The complete program code in the Example section later in this article contains a method that matches the signature of the delegate, which handles the event, but you can also generate dynamic methods at run time. For details, see the accompanying procedure, for generating an event handler at run time by using a dynamic method. + + [!code-cpp[HookUpDelegate#6](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#6)] + [!code-csharp[HookUpDelegate#6](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#6)] + [!code-vb[HookUpDelegate#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#6)] + +5. Create an instance of the delegate, using the method. This method is static (`Shared` in Visual Basic), so the delegate type must be supplied. Using the overloads of that take a is recommended. + + [!code-cpp[HookUpDelegate#7](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#7)] + [!code-csharp[HookUpDelegate#7](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#7)] + [!code-vb[HookUpDelegate#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#7)] + +6. Get the `add` accessor method and invoke it to hook up the event. All events have an `add` accessor and a `remove` accessor, which are hidden by the syntax of high-level languages. For example, C# uses the `+=` operator to hook up events, and Visual Basic uses the [AddHandler statement](../../visual-basic/language-reference/statements/addhandler-statement.md). The following code gets the `add` accessor of the event and invokes it late-bound, passing in the delegate instance. The arguments must be passed as an array. + + [!code-cpp[HookUpDelegate#8](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#8)] + [!code-csharp[HookUpDelegate#8](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#8)] + [!code-vb[HookUpDelegate#8](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#8)] + +7. Test the event. The following code shows the form defined in the code example. Clicking the form invokes the event handler. + + [!code-cpp[HookUpDelegate#12](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#12)] + [!code-csharp[HookUpDelegate#12](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#12)] + [!code-vb[HookUpDelegate#12](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#12)] + +## Generate an event handler at run time by using a dynamic method + +1. Event-handler methods can be generated at run time, using lightweight dynamic methods and reflection emit. To construct an event handler, you need the return type and parameter types of the delegate. These can be obtained by examining the delegate's `Invoke` method. The following code uses the `GetDelegateReturnType` and `GetDelegateParameterTypes` methods to obtain this information. The code for these methods can be found in the Example section later in this article. + + It is not necessary to name a , so the empty string can be used. In the following code, the last argument associates the dynamic method with the current type, giving the delegate access to all the public and private members of the `Example` class. + + [!code-cpp[HookUpDelegate#9](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#9)] + [!code-csharp[HookUpDelegate#9](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#9)] + [!code-vb[HookUpDelegate#9](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#9)] + +2. Generate a method body. This method loads a string, calls the overload of the method that takes a string, pops the return value off the stack (because the handler has no return type), and returns. To learn more about emitting dynamic methods, see [How to: Define and Execute Dynamic Methods](how-to-define-and-execute-dynamic-methods.md). + + [!code-cpp[HookUpDelegate#10](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#10)] + [!code-csharp[HookUpDelegate#10](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#10)] + [!code-vb[HookUpDelegate#10](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#10)] + +3. Complete the dynamic method by calling its method. Use the `add` accessor to add the delegate to the invocation list for the event. + + [!code-cpp[HookUpDelegate#11](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#11)] + [!code-csharp[HookUpDelegate#11](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#11)] + [!code-vb[HookUpDelegate#11](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#11)] + +4. Test the event. The following code loads the form defined in the code example. Clicking the form invokes both the predefined event handler and the emitted event handler. + + [!code-cpp[HookUpDelegate#12](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#12)] + [!code-csharp[HookUpDelegate#12](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#12)] + [!code-vb[HookUpDelegate#12](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#12)] + +## Example + +The following code example shows how to hook up an existing method to an event using reflection, and also how to use the class to emit a method at run time and hook it up to an event. + +[!code-cpp[HookUpDelegate#1](../../../samples/snippets/cpp/VS_Snippets_CLR/HookUpDelegate/cpp/source.cpp#1)] +[!code-csharp[HookUpDelegate#1](../../../samples/snippets/csharp/VS_Snippets_CLR/HookUpDelegate/cs/source.cs#1)] +[!code-vb[HookUpDelegate#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HookUpDelegate/vb/source.vb#1)] + +## See also + +- +- +- +- +- [How to: Define and Execute Dynamic Methods](how-to-define-and-execute-dynamic-methods.md) +- [Reflection](reflection.md) diff --git a/docs/fundamentals/reflection/reflection-and-generic-types.md b/docs/fundamentals/reflection/reflection-and-generic-types.md new file mode 100644 index 0000000000000..c7f30a2223851 --- /dev/null +++ b/docs/fundamentals/reflection/reflection-and-generic-types.md @@ -0,0 +1,129 @@ +--- +title: "Reflection and Generic Types" +description: Get started with reflection and generic types in .NET. Unlike an ordinary type, a generic type is associated with a set of type parameters or type arguments. +ms.date: "03/30/2017" +dev_langs: + - "csharp" + - "vb" + - "cpp" +helpviewer_keywords: + - "generics [.NET], reflection emit" + - "reflection emit, generic types" + - "reflection, generic types" + - "type arguments" + - "generics [.NET], reflection" + - "viewing type information" + - "type information, viewing" + - "types, generic" + - "type parameters" +ms.assetid: f7180fc5-dd41-42d4-8a8e-1b34288e06de +--- +# Reflection and generic types + +From the point of view of reflection, the difference between a generic type and an ordinary type is that a generic type has associated with it a set of type parameters (if it's a generic type definition) or type arguments (if it's a constructed type). A generic method differs from an ordinary method in the same way. + +There are two keys to understanding how reflection handles generic types and methods: + +- The type parameters of generic type definitions and generic method definitions are represented by instances of the class. + + > [!NOTE] + > Many properties and methods of have different behavior when a object represents a generic type parameter. These differences are documented in the property and method articles. For example, see and . In addition, some members are valid only when a object represents a generic type parameter. For example, see . + +- If an instance of represents a generic type, then it includes an array of types that represent the type parameters (for generic type definitions) or the type arguments (for constructed types). The same is true of an instance of the class that represents a generic method. + +Reflection provides methods of and that allow you to access the array of type parameters, and to determine whether an instance of represents a type parameter or an actual type. + +For example code demonstrating the methods discussed here, see [How to: Examine and Instantiate Generic Types with Reflection](how-to-examine-and-instantiate-generic-types-with-reflection.md). + +The following discussion assumes familiarity with the terminology of generics, such as the difference between type parameters and arguments and open or closed constructed types. For more information, see [Generics](../../standard/generics/index.md). + +## Is this a generic type or method? + +When you use reflection to examine an unknown type, represented by an instance of , use the property to determine whether the unknown type is generic. It returns `true` if the type is generic. Similarly, when you examine an unknown method, represented by an instance of the class, use the property to determine whether the method is generic. + +## Is this a generic type or method definition? + +Use the property to determine whether a object represents a generic type definition, and use the method to determine whether a represents a generic method definition. + +Generic type and method definitions are the templates from which instantiable types are created. Generic types in the .NET libraries, such as , are generic type definitions. + +## Is the type or method open or closed? + +A generic type or method is closed if instantiable types have been substituted for all its type parameters, including all the type parameters of all enclosing types. You can only create an instance of a generic type if it's closed. The property returns `true` if a type is open. For methods, the method performs the same function. + +## Generate closed generic types + +Once you have a generic type or method definition, use the method to create a closed generic type or the method to create a for a closed generic method. + +### Get the generic type or method definition + +If you have an open generic type or method that's not a generic type or method definition, you cannot create instances of it and you cannot supply the type parameters that are missing. You must have a generic type or method definition. Use the method to obtain the generic type definition or the method to obtain the generic method definition. + +For example, if you have a object representing `Dictionary` and you want to create the type `Dictionary`, you can use the method to get a representing `Dictionary` and then use the method to produce a representing `Dictionary`. + +For an example of an open generic type that is not a generic type, see [Type parameter or type argument](#type-parameter-or-type-argument). + +## Examine type arguments and type parameters + +Use the method to obtain an array of objects that represent the type parameters or type arguments of a generic type, and use the method to do the same for a generic method. + +Once you know that a object represents a type parameter, there are many additional questions reflection can answer. You can determine the type parameter's source, its position, and its constraints. + +### Type parameter or type argument + +To determine whether a particular element of the array is a type parameter or a type argument, use the property. The property is `true` if the element is a type parameter. + +A generic type can be open without being a generic type definition, in which case it has a mixture of type arguments and type parameters. For example, in the following code, class `D` derives from a type created by substituting the first type parameter of `D` for the second type parameter of `B`. + +```csharp +class B {} +class D : B {} +``` + +```vb +Class B(Of T, U) +End Class +Class D(Of V, W) + Inherits B(Of Integer, V) +End Class +``` + +```cpp +generic ref class B {}; +generic ref class D : B {}; +``` + +If you obtain a object representing `D` and use the property to obtain its base type, the resulting `type B` is open, but it's not a generic type definition. + +### Source of a generic parameter + +A generic type parameter might come from the type you are examining, from an enclosing type, or from a generic method. You can determine the source of the generic type parameter as follows: + +- First, use the property to determine whether the type parameter comes from a generic method. If the property value is not a null reference, then the source is a generic method. +- If the source is not a generic method, use the property to determine the generic type the generic type parameter belongs to. + +If the type parameter belongs to a generic method, the property returns the type that declared the generic method, which is irrelevant. + +### Position of a generic parameter + +In rare situations, it's necessary to determine the position of a type parameter in the type parameter list of its declaring class. For example, suppose you have a object representing the `B` type from the preceding example. The method gives you a list of type arguments, and when you examine `V` you can use the and properties to discover where it comes from. You can then use the property to determine its position in the type parameter list where it was defined. In this example, `V` is at position 0 (zero) in the type parameter list where it was defined. + +### Base type and interface constraints + +Use the method to obtain the base type constraint and interface constraints of a type parameter. The order of the elements of the array is not significant. An element represents an interface constraint if it's an interface type. + +### Generic parameter attributes + +The property gets a value that indicates the variance (covariance or contravariance) and the special constraints of a type parameter. + +#### Covariance and contravariance + +To determine whether a type parameter is covariant or contravariant, apply the mask to the value that is returned by the property. If the result is , the type parameter is invariant. For more information, see [Covariance and Contravariance](../../standard/generics/covariance-and-contravariance.md). + +#### Special constraints + +To determine the special constraints of a type parameter, apply the mask to the value that is returned by the property. If the result is , there are no special constraints. A type parameter can be constrained to be a reference type, to be a non-nullable value type, and to have a parameterless constructor. + +## Invariants + +For a table of the invariant conditions for common terms in reflection for generic types, see . For additional terms relating to generic methods, see . diff --git a/docs/framework/reflection-and-codedom/reflection.md b/docs/fundamentals/reflection/reflection.md similarity index 52% rename from docs/framework/reflection-and-codedom/reflection.md rename to docs/fundamentals/reflection/reflection.md index ad44b0e21edd9..5310af8a21176 100644 --- a/docs/framework/reflection-and-codedom/reflection.md +++ b/docs/fundamentals/reflection/reflection.md @@ -1,7 +1,8 @@ --- title: "Reflection in .NET" +titleSuffix: "" description: Review reflection in .NET. Get information about loaded assemblies and the types defined within them, such as classes, interfaces, structures, and enumerations. -ms.date: 07/09/2021 +ms.date: 03/27/2024 helpviewer_keywords: - "assemblies [.NET], reflection" - "EventInfo class, reflection" @@ -26,25 +27,23 @@ ms.assetid: d1a58e7f-fb39-4d50-bf84-e3b8f9bf9775 # Reflection in .NET -The classes in the namespace, together with , enable you to obtain information about loaded [assemblies](../../standard/assembly/index.md) and the types defined within them, such as [classes](../../standard/base-types/common-type-system.md#classes), [interfaces](../../standard/base-types/common-type-system.md#interfaces), and value types (that is, [structures](../../standard/base-types/common-type-system.md#structures) and [enumerations](../../standard/base-types/common-type-system.md#enumerations)). You can also use reflection to create type instances at run time, and to invoke and access them. For topics about specific aspects of reflection, see [Related Topics](#related_topics) at the end of this overview. +The classes in the namespace, together with , enable you to obtain information about loaded [assemblies](../../standard/assembly/index.md) and the types defined within them, such as [classes](../../standard/base-types/common-type-system.md#classes), [interfaces](../../standard/base-types/common-type-system.md#interfaces), and value types (that is, [structures](../../standard/base-types/common-type-system.md#structures) and [enumerations](../../standard/base-types/common-type-system.md#enumerations)). You can also use reflection to create type instances at run time, and to invoke and access them. -The [common language runtime](../../standard/clr.md) loader manages [application domains](../app-domains/application-domains.md), which constitute defined boundaries around objects that have the same application scope. This management includes loading each assembly into the appropriate application domain and controlling the memory layout of the type hierarchy within each assembly. - -[Assemblies](../app-domains/index.md) contain modules, modules contain types, and types contain members. Reflection provides objects that encapsulate assemblies, modules, and types. You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object. You can then invoke the type's methods or access its fields and properties. Typical uses of reflection include the following: +[Assemblies](../../standard/assembly/index.md) contain modules, modules contain types, and types contain members. Reflection provides objects that encapsulate assemblies, modules, and types. You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object. You can then invoke the type's methods or access its fields and properties. Typical uses of reflection include the following: - Use to define and load assemblies, load modules that are listed in the assembly manifest, and locate a type from this assembly and create an instance of it. - Use to discover information such as the assembly that contains the module and the classes in the module. You can also get all global methods or other specific, non-global methods defined on the module. - Use to discover information such as the name, parameters, access modifiers (such as `public` or `private`), and implementation details (such as `abstract` or `virtual`) of a constructor. Use the or method of a to invoke a specific constructor. -- Use to discover information such as the name, return type, parameters, access modifiers (such as `public` or `private`), and implementation details (such as `abstract` or `virtual`) of a method. Use the or method of a to invoke a specific method. -- Use to discover information such as the name, access modifiers (such as `public` or `private`) and implementation details (such as `static`) of a field, and to get or set field values. +- Use to discover information such as the name, return type, parameters, access modifiers, and implementation details (such as `abstract` or `virtual`) of a method. Use the or method of a to invoke a specific method. +- Use to discover information such as the name, access modifiers, and implementation details (such as `static`) of a field, and to get or set field values. - Use to discover information such as the name, event-handler data type, custom attributes, declaring type, and reflected type of an event, and to add or remove event handlers. - Use to discover information such as the name, data type, declaring type, reflected type, and read-only or writable status of a property, and to get or set property values. - - Use to discover information such as a parameter's name, data type, whether a parameter is an input or output parameter, and the position of the parameter in a method signature. -- Use to discover information about custom attributes when you are working in the reflection-only context of an application domain. allows you to examine attributes without creating instances of them. +- Use to discover information about custom attributes when you are working in the or reflection-only context (.NET Framework). allows you to examine attributes without creating instances of them. + The classes of the namespace provide a specialized form of reflection that enables you to build types at run time. -Reflection can also be used to create applications called type browsers, which enable users to select types and then view the information about those types. +Reflection can also be used to create *type browsers*, which enable users to select types and then view the information about those types. There are other uses for reflection. Compilers for languages such as JScript use reflection to construct symbol tables. The classes in the namespace use reflection to access data and to determine which fields to persist. The classes in the namespace use reflection indirectly through serialization. @@ -56,23 +55,6 @@ For example, when you use the C# `typeof` operator (`GetType` in Visual Basic) t These runtime classes are `internal` (`Friend` in Visual Basic). They are not documented separately from their base classes, because their behavior is described by the base class documentation. - - -## Related topics - -| Title | Description | -|--|--| -| [Viewing type information](viewing-type-information.md) | Describes the class and provides code examples that illustrate how to use with several reflection classes to obtain information about constructors, methods, fields, properties, and events. | -| [Reflection and generic types](reflection-and-generic-types.md) | Explains how reflection handles the type parameters and type arguments of generic types and generic methods. | -| [Security considerations for reflection](security-considerations-for-reflection.md) | Describes the rules that determine to what degree reflection can be used to discover type information and access types. | -| [Dynamically loading and using types](dynamically-loading-and-using-types.md) | Describes the reflection custom-binding interface that supports late binding. | -| [How to: Load assemblies into the reflection-only context](how-to-load-assemblies-into-the-reflection-only-context.md) | Describes the reflection-only load context. Shows how to load an assembly, how to test the context, and how to examine attributes applied to an assembly in the reflection-only context. | -| [How to: Inspect assembly contents using MetadataLoadContext](../../standard/assembly/inspect-contents-using-metadataloadcontext.md) | Load and inspect assemblies using the . | -| [Accessing custom attributes](accessing-custom-attributes.md) | Demonstrates using reflection to query attribute existence and values. | -| [Specifying fully qualified type names](specifying-fully-qualified-type-names.md) | Describes the format of fully qualified type names in terms of the Backus-Naur form (BNF), and the syntax required for specifying special characters, assembly names, pointers, references, and arrays. | -| [How to: Hook up a delegate using reflection](how-to-hook-up-a-delegate-using-reflection.md) | Explains how to create a delegate for a method and hook the delegate up to an event. Explains how to create an event-handling method at run time using . | -| [Emitting dynamic methods and assemblies](emitting-dynamic-methods-and-assemblies.md) | Explains how to generate dynamic assemblies and dynamic methods. | - ## Reference - diff --git a/docs/framework/reflection-and-codedom/specifying-fully-qualified-type-names.md b/docs/fundamentals/reflection/specifying-fully-qualified-type-names.md similarity index 75% rename from docs/framework/reflection-and-codedom/specifying-fully-qualified-type-names.md rename to docs/fundamentals/reflection/specifying-fully-qualified-type-names.md index e546213cb03e8..c3c94ad164987 100644 --- a/docs/framework/reflection-and-codedom/specifying-fully-qualified-type-names.md +++ b/docs/fundamentals/reflection/specifying-fully-qualified-type-names.md @@ -3,12 +3,12 @@ title: Specify fully qualified type name description: For valid input to reflection operations, use fully qualified type names, which have assembly name specifications, namespace specifications, and type names. ms.date: 02/21/2019 helpviewer_keywords: - - "names [.NET Framework], fully qualified type names" + - "names [.NET], fully qualified type names" - "reflection, fully qualified type names" - - "names [.NET Framework], assemblies" + - "names [.NET], assemblies" - "tokens" - "BNF" - - "assemblies [.NET Framework], names" + - "assemblies [.NET], names" - "languages, grammar" - "fully qualified type names" - "type names" @@ -23,7 +23,7 @@ You must specify type names to have valid input to various reflection operations ## Grammar for type names - The grammar defines the syntax of formal languages. The following table lists lexical rules that describe how to recognize a valid input. Terminals (those elements that are not further reducible) are shown in all uppercase letters. Nonterminals (those elements that are further reducible) are shown in mixed-case or singly quoted strings, but the single quote (') is not a part of the syntax itself. The pipe character (|) denotes rules that have subrules. +The grammar defines the syntax of formal languages. The following table lists lexical rules that describe how to recognize a valid input. Terminals (those elements that are not further reducible) are shown in all uppercase letters. Nonterminals (those elements that are further reducible) are shown in mixed-case or singly quoted strings, but the single quote (') is not a part of the syntax itself. The pipe character (|) denotes rules that have subrules. ```antlr @@ -114,18 +114,18 @@ In a type name, IDENTIFIER is any valid name determined by the rules of a langua Use the backslash (\\) as an escape character to separate the following tokens when used as part of IDENTIFIER. -|Token|Meaning| -|-----------|-------------| -|`\,`|Assembly separator.| -|`\+`|Nested type separator.| -|`\&`|Reference type.| -|`\*`|Pointer type.| -|`\[`|Array dimension delimiter.| -|`\]`|Array dimension delimiter.| -|`\.`|Use the backslash before a period only if the period is used in an array specification. Periods in NamespaceSpec do not take the backslash.| -|`\\`|Backslash when needed as a string literal.| +| Token | Meaning | +|-------|----------------------------| +| `\,` | Assembly separator. | +| `\+` | Nested type separator. | +| `\&` | Reference type. | +| `\*` | Pointer type. | +| `\[` | Array dimension delimiter. | +| `\]` | Array dimension delimiter. | +| `\.` | Use the backslash before a period only if the period is used in an array specification. Periods in NamespaceSpec do not take the backslash. | +| `\\` | Backslash when needed as a string literal. | -Note that in all TypeSpec components except AssemblyNameSpec, spaces are relevant. In the AssemblyNameSpec, spaces before the ',' separator are relevant, but spaces after the ',' separator are ignored. +In all TypeSpec components except AssemblyNameSpec, spaces are relevant. In the AssemblyNameSpec, spaces before the ',' separator are relevant, but spaces after the ',' separator are ignored. Reflection classes, such as , return the mangled name so that the returned name can be used in a call to , as in `MyType.GetType(myType.FullName)`. @@ -143,7 +143,7 @@ The minimum information required in an assembly name specification is the textua |**PublicKey**|Full public key|String value of full public key in hexadecimal format. Specify a null reference (**Nothing** in Visual Basic) to explicitly indicate a private assembly.| |**PublicKeyToken**|Public key token (8-byte hash of the full public key)|String value of public key token in hexadecimal format. Specify a null reference (**Nothing** in Visual Basic) to explicitly indicate a private assembly.| |**Culture**|Assembly culture|Culture of the assembly in RFC-1766 format, or "neutral" for language-independent (nonsatellite) assemblies.| -|**Custom**|Custom binary large object (BLOB). This is currently used only in assemblies generated by the [Native Image Generator (Ngen)](../tools/ngen-exe-native-image-generator.md).|Custom string used by the Native Image Generator tool to notify the assembly cache that the assembly being installed is a native image, and is therefore to be installed in the native image cache. Also called a zap string.| +|**Custom**|Custom binary large object (BLOB). This is currently used only in assemblies generated by the [Native Image Generator (Ngen)](../../framework/tools/ngen-exe-native-image-generator.md).|Custom string used by the Native Image Generator tool to notify the assembly cache that the assembly being installed is a native image, and is therefore to be installed in the native image cache. Also called a zap string.| The following example shows an **AssemblyName** for a simply named assembly with default culture. @@ -183,7 +183,7 @@ com.microsoft.crypto, Culture=en, PublicKeyToken=a5d015c7d5a0b012, ## Specify generic types -SimpleTypeSpec\`NUMBER represents an open generic type with from 1 to *n* generic type parameters. For example, to get reference to the open generic type List\ or the closed generic type List\, use ``Type.GetType("System.Collections.Generic.List`1")`` To get a reference to the generic type Dictionary\, use ``Type.GetType("System.Collections.Generic.Dictionary`2")``. +SimpleTypeSpec\`NUMBER represents an open generic type with from 1 to *n* generic type parameters. For example, to get reference to the open generic type `List` or the closed generic type `List`, use ``Type.GetType("System.Collections.Generic.List`1")`` To get a reference to the generic type `Dictionary`, use ``Type.GetType("System.Collections.Generic.Dictionary`2")``. ## Specify pointers @@ -191,7 +191,7 @@ SimpleTypeSpec* represents an unmanaged pointer. For example, to get a pointer t ## Specify references -SimpleTypeSpec & represents a managed pointer or reference. For example, to get a reference to type MyType, use `Type.GetType("MyType &")`. Note that unlike pointers, references are limited to one level. +SimpleTypeSpec & represents a managed pointer or reference. For example, to get a reference to type MyType, use `Type.GetType("MyType &")`. Unlike pointers, references are limited to one level. ## Specify arrays @@ -200,15 +200,13 @@ In the BNF Grammar, ReflectionEmitDimension only applies to incomplete type defi Arrays are accessed in reflection by specifying the rank of the array: - `Type.GetType("MyArray[]")` gets a single-dimension array with 0 lower bound. - - `Type.GetType("MyArray[*]")` gets a single-dimension array with unknown lower bound. - `Type.GetType("MyArray[][]")` gets a two-dimensional array's array. - - `Type.GetType("MyArray[*,*]")` and `Type.GetType("MyArray[,]")` gets a rectangular two-dimensional array with unknown lower bounds. -Note that from a runtime point of view, `MyArray[] != MyArray[*]`, but for multidimensional arrays, the two notations are equivalent. That is, `Type.GetType("MyArray [,]") == Type.GetType("MyArray[*,*]")` evaluates to **true**. +From a runtime point of view, `MyArray[] != MyArray[*]`, but for multidimensional arrays, the two notations are equivalent. That is, `Type.GetType("MyArray [,]") == Type.GetType("MyArray[*,*]")` evaluates to **true**. -For **ModuleBuilder.GetType**, `MyArray[0..5]` indicates a single-dimension array with size 6, lower bound 0. `MyArray[4…]` indicates a single-dimension array of unknown size and lower bound 4. +For `ModuleBuilder.GetType`, `MyArray[0..5]` indicates a single-dimension array with size 6, lower bound 0. `MyArray[4…]` indicates a single-dimension array of unknown size and lower bound 4. ## See also @@ -218,4 +216,4 @@ For **ModuleBuilder.GetType**, `MyArray[0..5]` indicates a single-dimension arra - - - -- [Viewing Type Information](viewing-type-information.md) +- [View type information](viewing-type-information.md) diff --git a/docs/fundamentals/reflection/viewing-type-information.md b/docs/fundamentals/reflection/viewing-type-information.md new file mode 100644 index 0000000000000..20ea9422180ba --- /dev/null +++ b/docs/fundamentals/reflection/viewing-type-information.md @@ -0,0 +1,71 @@ +--- +title: "Viewing Type Information" +description: View type information using System.Type, which is central to reflection in .NET. Review ConstructorInfo, MemberInfo, MethodInfo, FieldInfo, and PropertyInfo. +ms.date: 03/27/2024 +dev_langs: + - "csharp" + - "vb" + - "cpp" +helpviewer_keywords: + - "types, viewing type information" + - "Type object" + - "viewing type information" + - "reflection, viewing type information" +ms.assetid: 7e7303a9-4064-4738-b4e7-b75974ed70d2 +--- +# View type information + +The class is central to reflection. The common language runtime creates the `Type` for a loaded type when reflection requests it. You can use a `Type` object's methods, fields, properties, and nested classes to find out everything about that type. + +Use or to obtain `Type` objects from assemblies that have not been loaded, passing in the name of the type or types you want. Use to get the `Type` objects from an assembly that is already loaded. Use and to obtain module `Type` objects. + +> [!NOTE] +> If you want to examine and manipulate generic types and methods, please see the additional information provided in [Reflection and Generic Types](reflection-and-generic-types.md) and [How to: Examine and Instantiate Generic Types with Reflection](how-to-examine-and-instantiate-generic-types-with-reflection.md). + +The following example shows the syntax necessary to get the object and module for an assembly. + +[!code-cpp[Conceptual.Types.ViewInfo#6](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source5.cpp#6)] +[!code-csharp[Conceptual.Types.ViewInfo#6](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source5.cs#6)] +[!code-vb[Conceptual.Types.ViewInfo#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source5.vb#6)] + +The following example demonstrates getting `Type` objects from a loaded assembly. + +[!code-cpp[Conceptual.Types.ViewInfo#7](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source5.cpp#7)] +[!code-csharp[Conceptual.Types.ViewInfo#7](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source5.cs#7)] +[!code-vb[Conceptual.Types.ViewInfo#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source5.vb#7)] + +Once you obtain a `Type`, there are many ways you can discover information about the members of that type. For example, you can find out about all the type's members by calling the method, which obtains an array of objects describing each of the members of the current type. + +You can also use methods on the `Type` class to retrieve information about one or more constructors, methods, events, fields, or properties that you specify by name. For example, encapsulates a specific constructor of the current class. + +If you have a `Type`, you can use the property to obtain an object that encapsulates the module containing that type. Use the property to locate an object that encapsulates the assembly containing the module. You can obtain the assembly that encapsulates the type directly by using the property. + +## System.Type and ConstructorInfo + +The following example shows how to list the constructors for a class, in this case, the class. + +[!code-cpp[Conceptual.Types.ViewInfo#1](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source1.cpp#1)] +[!code-csharp[Conceptual.Types.ViewInfo#1](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source1.cs#1)] +[!code-vb[Conceptual.Types.ViewInfo#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source1.vb#1)] + +## MemberInfo, MethodInfo, FieldInfo, and PropertyInfo + +Obtain information about the type's methods, properties, events, and fields using , , , or objects. + +The following example uses `MemberInfo` to list the number of members in the `System.IO.File` class and uses the property to determine the visibility of the class. + +[!code-cpp[Conceptual.Types.ViewInfo#2](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source2.cpp#2)] +[!code-csharp[Conceptual.Types.ViewInfo#2](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source2.cs#2)] +[!code-vb[Conceptual.Types.ViewInfo#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source2.vb#2)] + +The following example investigates the type of the specified member. It performs reflection on a member of the `MemberInfo` class, and lists its type. + +[!code-cpp[Conceptual.Types.ViewInfo#3](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source3.cpp#3)] +[!code-csharp[Conceptual.Types.ViewInfo#3](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source3.cs#3)] +[!code-vb[Conceptual.Types.ViewInfo#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source3.vb#3)] + +The following example uses all the Reflection `*Info` classes along with to list all the members (constructors, fields, properties, events, and methods) of the specified class, dividing the members into static and instance categories. + +[!code-cpp[Conceptual.Types.ViewInfo#4](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source4.cpp#4)] +[!code-csharp[Conceptual.Types.ViewInfo#4](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source4.cs#4)] +[!code-vb[Conceptual.Types.ViewInfo#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source4.vb#4)] diff --git a/docs/fundamentals/runtime-libraries/includes/calendar-era.md b/docs/fundamentals/runtime-libraries/includes/calendar-era.md index 0412dbccbf5d2..cedfe03539359 100644 --- a/docs/fundamentals/runtime-libraries/includes/calendar-era.md +++ b/docs/fundamentals/runtime-libraries/includes/calendar-era.md @@ -1,3 +1,3 @@ > [!IMPORTANT] -> Eras in the Japanese calendars are based on the emperor's reign and are therefore expected to change. For example, May 1, 2019 marked the beginning of the Reiwa era in the and . Such a change of era affects all applications that use these calendars. For more information and to determine whether your applications are affected, see [Handling a new era in the Japanese calendar in .NET](https://devblogs.microsoft.com/dotnet/handling-a-new-era-in-the-japanese-calendar-in-net/). For information on testing your applications on Windows systems to ensure their readiness for the era change, see [Prepare your application for the Japanese era change](/windows/uwp/design/globalizing/japanese-era-change). For features in .NET that support calendars with multiple eras and for best practices when working with calendars that support multiple eras, see [Working with eras](/dotnet/standard/datetime/working-with-calendars#working-with-eras). +> Eras in the Japanese calendars are based on the emperor's reign and are therefore expected to change. For example, May 1, 2019 marked the beginning of the Reiwa era in the and . Such a change of era affects all applications that use these calendars. For more information and to determine whether your applications are affected, see [Handling a new era in the Japanese calendar in .NET](https://devblogs.microsoft.com/dotnet/handling-a-new-era-in-the-japanese-calendar-in-net/). For information on testing your applications on Windows systems to ensure their readiness for the era change, see [Prepare your application for the Japanese era change](/windows/uwp/design/globalizing/japanese-era-change). For features in .NET that support calendars with multiple eras and for best practices when working with calendars that support multiple eras, see [Working with eras](../../../standard/datetime/working-with-calendars.md#work-with-eras). diff --git a/docs/fundamentals/runtime-libraries/includes/interpolated-strings.md b/docs/fundamentals/runtime-libraries/includes/interpolated-strings.md index 9ec660ed5102b..f12aa8b3bebef 100644 --- a/docs/fundamentals/runtime-libraries/includes/interpolated-strings.md +++ b/docs/fundamentals/runtime-libraries/includes/interpolated-strings.md @@ -1,2 +1,2 @@ > [!IMPORTANT] -> Instead of calling the **String.Format** method or using [composite format strings](/dotnet/standard/base-types/composite-formatting), you can use *interpolated strings* if your language supports them. An interpolated string is a string that contains *interpolated expressions*. Each interpolated expression is resolved with the expression's value and included in the result string when the string is assigned. For more information, see [String interpolation (C# Reference)](/dotnet/csharp/language-reference/tokens/interpolated) and [Interpolated Strings (Visual Basic Reference)](/dotnet/visual-basic/programming-guide/language-features/strings/interpolated-strings). +> Instead of calling the **String.Format** method or using [composite format strings](../../../standard/base-types/composite-formatting.md), you can use *interpolated strings* if your language supports them. An interpolated string is a string that contains *interpolated expressions*. Each interpolated expression is resolved with the expression's value and included in the result string when the string is assigned. For more information, see [String interpolation (C# Reference)](../../../csharp/language-reference/tokens/interpolated.md) and [Interpolated Strings (Visual Basic Reference)](../../../visual-basic/programming-guide/language-features/strings/interpolated-strings.md). diff --git a/docs/fundamentals/runtime-libraries/includes/system-drawing-common.md b/docs/fundamentals/runtime-libraries/includes/system-drawing-common.md index 6a519da62c688..20e4d0f623247 100644 --- a/docs/fundamentals/runtime-libraries/includes/system-drawing-common.md +++ b/docs/fundamentals/runtime-libraries/includes/system-drawing-common.md @@ -1,2 +1,2 @@ > [!NOTE] -> In .NET 6 and later versions, the [System.Drawing.Common package](https://www.nuget.org/packages/System.Drawing.Common/), which includes this type, is only supported on Windows operating systems. Use of this type in cross-platform apps causes compile-time warnings and run-time exceptions. For more information, see [System.Drawing.Common only supported on Windows](/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only). +> In .NET 6 and later versions, the [System.Drawing.Common package](https://www.nuget.org/packages/System.Drawing.Common/), which includes this type, is only supported on Windows operating systems. Use of this type in cross-platform apps causes compile-time warnings and run-time exceptions. For more information, see [System.Drawing.Common only supported on Windows](../../../core/compatibility/core-libraries/6.0/system-drawing-common-windows-only.md). diff --git a/docs/fundamentals/runtime-libraries/system-reflection-emit-assemblybuilder.md b/docs/fundamentals/runtime-libraries/system-reflection-emit-assemblybuilder.md index 1988ac250c347..7704fdd026dc3 100644 --- a/docs/fundamentals/runtime-libraries/system-reflection-emit-assemblybuilder.md +++ b/docs/fundamentals/runtime-libraries/system-reflection-emit-assemblybuilder.md @@ -11,7 +11,7 @@ A dynamic assembly is an assembly that is created using the Reflection Emit APIs The way you create an instance differs for each implementation, but further steps for defining a module, type, method, or enum, and for writing IL, are quite similar. -## Runnable dynamic assemblies in .NET Core +## Runnable dynamic assemblies in .NET To get a runnable object, use the method. Dynamic assemblies can be created using one of the following access modes: @@ -49,7 +49,7 @@ public void CreateAndRunAssembly(string assemblyPath) } ``` -## Persistable dynamic assemblies in .NET Core +## Persistable dynamic assemblies in .NET The API wasn't originally ported to .NET (Core) because the implementation depended heavily on Windows-specific native code that also wasn't ported. However, because you could only *run* a generated assembly and not *save* it, it was difficult to debug these in-memory assemblies. Other advantages of saving a dynamic assembly to a file are: diff --git a/docs/fundamentals/toc.yml b/docs/fundamentals/toc.yml index 943d9f00205f0..1021a252f5706 100644 --- a/docs/fundamentals/toc.yml +++ b/docs/fundamentals/toc.yml @@ -1319,8 +1319,8 @@ items: href: runtime-libraries/system-runtime-loader-assemblyloadcontext.md - name: The ProcessStartInfo class items: - - name: UseShellExecute method - href: runtime-libraries/system-diagnostics-processstartinfo-useshellexecute.md + - name: UseShellExecute property + href: runtime-libraries/system-diagnostics-processstartinfo-useshellexecute.md - name: The Environment class items: - name: GetEnvironmentVariable method @@ -1412,20 +1412,57 @@ items: href: ../standard/assembly/embed-types-visual-studio.md - name: Inspect assembly contents using MetadataLoadContext href: ../standard/assembly/inspect-contents-using-metadataloadcontext.md - - name: Metadata and self-describing components + - name: Reflection items: - name: Overview - href: ../standard/metadata-and-self-describing-components.md - - name: Supplemental API remarks + href: reflection/reflection.md + - name: View type information + href: reflection/viewing-type-information.md + - name: Reflection and generic types + href: reflection/reflection-and-generic-types.md + - name: Dynamically load and use types + href: reflection/dynamically-loading-and-using-types.md + - name: Access custom attributes + href: reflection/accessing-custom-attributes.md + - name: Specify fully qualified type names + href: reflection/specifying-fully-qualified-type-names.md + - name: How-tos items: - - name: The AssemblyBuilder class - href: runtime-libraries/system-reflection-emit-assemblybuilder.md - - name: The MethodBuilder class - href: runtime-libraries/system-reflection-emit-methodbuilder.md - - name: The TypeBuilder class - href: runtime-libraries/system-reflection-emit-typebuilder.md - - name: The DynamicMethod class - href: runtime-libraries/system-reflection-emit-dynamicmethod.md + - name: Examine and instantiate generic types with reflection + href: reflection/how-to-examine-and-instantiate-generic-types-with-reflection.md + - name: Get type and member information by using reflection + href: reflection/get-type-member-information.md + - name: Hook up a delegate using reflection + href: reflection/how-to-hook-up-a-delegate-using-reflection.md + - name: Emit dynamic methods and assemblies + items: + - name: Overview + href: reflection/emitting-dynamic-methods-and-assemblies.md + displayName: reflection emit + - name: How-tos + items: + - name: Define and execute dynamic methods + href: reflection/how-to-define-and-execute-dynamic-methods.md + - name: Define a generic type with reflection emit + href: reflection/how-to-define-a-generic-type-with-reflection-emit.md + - name: Define a generic method with reflection emit + href: reflection/how-to-define-a-generic-method-with-reflection-emit.md + - name: Collectible assemblies for dynamic type generation + href: reflection/collectible-assemblies.md + - name: Supplemental API remarks + items: + - name: The AssemblyBuilder class + href: runtime-libraries/system-reflection-emit-assemblybuilder.md + - name: The MethodBuilder class + href: runtime-libraries/system-reflection-emit-methodbuilder.md + - name: The TypeBuilder class + href: runtime-libraries/system-reflection-emit-typebuilder.md + - name: The DynamicMethod class + href: runtime-libraries/system-reflection-emit-dynamicmethod.md + - name: Metadata and self-describing components + items: + - name: Overview + href: ../standard/metadata-and-self-describing-components.md - name: The DebugDirectoryEntryType enum href: runtime-libraries/system-reflection-portableexecutable-debugdirectoryentrytype.md - name: Dependency loading diff --git a/docs/index.yml b/docs/index.yml index e5d939b0bf4b5..4e026b0353c0d 100644 --- a/docs/index.yml +++ b/docs/index.yml @@ -378,7 +378,7 @@ additionalContent: # Card - title: "C# language reference" summary: C# language reference and specification - url: csharp/language-reference/index.md + url: csharp/language-reference/index.yml # Card - title: "F# language reference" summary: F# language reference diff --git a/docs/media/dotnet-bot.svg b/docs/media/dotnet-bot.svg new file mode 100644 index 0000000000000..abfaff26a8534 --- /dev/null +++ b/docs/media/dotnet-bot.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/media/dotnet-bot_jetpack-faceing-right.svg b/docs/media/dotnet-bot_jetpack-faceing-right.svg new file mode 100644 index 0000000000000..261b510e3f36f --- /dev/null +++ b/docs/media/dotnet-bot_jetpack-faceing-right.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/media/dotnet-bot_presenting.svg b/docs/media/dotnet-bot_presenting.svg new file mode 100644 index 0000000000000..58d17e50abc49 --- /dev/null +++ b/docs/media/dotnet-bot_presenting.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/standard/assembly/file-format.md b/docs/standard/assembly/file-format.md index 973601576681d..32e9617eefe61 100644 --- a/docs/standard/assembly/file-format.md +++ b/docs/standard/assembly/file-format.md @@ -28,4 +28,4 @@ Assembly Headers from ECMA 335 II.25.1, Structure of the runtime file format. ## Process the assemblies -It is possible to write tools or APIs to process assemblies. Assembly information enables making programmatic decisions at run time, re-writing assemblies, providing API IntelliSense in an editor and generating documentation. , , and [Mono.Cecil](https://www.mono-project.com/docs/tools+libraries/libraries/Mono.Cecil/) are good examples of tools that are frequently used for this purpose. +It is possible to write tools or APIs to process assemblies. Assembly information enables making programmatic decisions at run time, rewriting assemblies, providing API IntelliSense in an editor, and generating documentation. , , and [Mono.Cecil](https://www.mono-project.com/docs/tools+libraries/libraries/Mono.Cecil/) are good examples of tools that are frequently used for this purpose. diff --git a/docs/standard/assembly/index.md b/docs/standard/assembly/index.md index 5e9a5a1cb791f..c2cfe1b6444a6 100644 --- a/docs/standard/assembly/index.md +++ b/docs/standard/assembly/index.md @@ -101,7 +101,7 @@ In C#, you can use two versions of the same assembly in a single application. Fo |[Assembly versioning](versioning.md)|Overview of the .NET Framework versioning policy.| |[Assembly placement](../../framework/app-domains/assembly-placement.md)|Where to locate assemblies.| |[Assemblies and side-by-side execution](side-by-side-execution.md)|Use multiple versions of the runtime or an assembly simultaneously.| -|[Emit dynamic methods and assemblies](../../framework/reflection-and-codedom/emitting-dynamic-methods-and-assemblies.md)|How to create dynamic assemblies.| +|[Emit dynamic methods and assemblies](../../fundamentals/reflection/emitting-dynamic-methods-and-assemblies.md)|How to create dynamic assemblies.| |[How the runtime locates assemblies](../../framework/deployment/how-the-runtime-locates-assemblies.md)|How the .NET Framework resolves assembly references at run time.| ## Reference diff --git a/docs/standard/assembly/inspect-contents-using-metadataloadcontext.md b/docs/standard/assembly/inspect-contents-using-metadataloadcontext.md index 335e484c9d4b6..29d82d255065c 100644 --- a/docs/standard/assembly/inspect-contents-using-metadataloadcontext.md +++ b/docs/standard/assembly/inspect-contents-using-metadataloadcontext.md @@ -40,3 +40,7 @@ If you need to test types in for eq ## Example For a complete code example, see the [Inspect assembly contents using MetadataLoadContext sample](/samples/dotnet/samples/inspect-assembly-contents-using-metadataloadcontext/). + +## See also + +- [Reflection in .NET](../../fundamentals/reflection/reflection.md) diff --git a/docs/standard/assembly/reference-assemblies.md b/docs/standard/assembly/reference-assemblies.md index bf6306cfefb59..10324b43ae0f8 100644 --- a/docs/standard/assembly/reference-assemblies.md +++ b/docs/standard/assembly/reference-assemblies.md @@ -23,7 +23,7 @@ Reference assemblies for the .NET Framework libraries are distributed with targe When you add references to .NET Framework assemblies in Visual Studio using the **Add reference** dialog, you select an assembly from the list, and Visual Studio automatically finds reference assemblies that correspond to the target framework version selected in your project. The same applies to adding references directly into MSBuild project using the [Reference](/visualstudio/msbuild/common-msbuild-project-items#reference) project item: you only need to specify the assembly name, not the full file path. When you add references to these assemblies in the command line by using the `-reference` compiler option ([in C#](../../csharp/language-reference/compiler-options/inputs.md#references) and in [Visual Basic](../../visual-basic/reference/command-line-compiler/reference.md)) or by using the method in the Roslyn API, you must manually specify reference assembly files for the correct target platform version. .NET Framework reference assembly files are located in the *%ProgramFiles(x86)%\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework* directory. For .NET Core, you can force publish operation to copy reference assemblies for your target platform into the *publish/refs* subdirectory of your output directory by setting the `PreserveCompilationContext` project property to `true`. Then you can pass these reference assembly files to the compiler. Using `DependencyContext` from [Microsoft.Extensions.DependencyModel](https://www.nuget.org/packages/Microsoft.Extensions.DependencyModel/) package can help locate their paths. Because they contain no implementation, reference assemblies can't be loaded for execution. Trying to do so results in a . If you want to examine the contents of a reference assembly, you can load it into the reflection-only context in .NET Framework (using the - method) or into the in .NET Core. + method) or into the in .NET and .NET Framework. ## Generating reference assemblies diff --git a/docs/standard/generics/index.md b/docs/standard/generics/index.md index 673ce10126813..0d55c8d23ded6 100644 --- a/docs/standard/generics/index.md +++ b/docs/standard/generics/index.md @@ -2,11 +2,11 @@ title: "Generics in .NET" description: Learn about generics in .NET. Define & use generics, learn their advantages & drawbacks, understand class library & language support, and more. ms.date: 07/26/2022 -dev_langs: +dev_langs: - "csharp" - "vb" - "cpp" -helpviewer_keywords: +helpviewer_keywords: - "generic methods, type inference" - "generics [.NET], collections" - "generic interfaces [.NET]" @@ -29,127 +29,127 @@ ms.assetid: 2994d786-c5c7-4666-ab23-4c83129fe39c --- # Generics in .NET -Generics let you tailor a method, class, structure, or interface to the precise data type it acts upon. For example, instead of using the class, which allows keys and values to be of any type, you can use the generic class and specify the types allowed for the key and the value. Among the benefits of generics are increased code reusability and type safety. +Generics let you tailor a method, class, structure, or interface to the precise data type it acts upon. For example, instead of using the class, which allows keys and values to be of any type, you can use the generic class and specify the types allowed for the key and the value. Among the benefits of generics are increased code reusability and type safety. ## Define and use generics Generics are classes, structures, interfaces, and methods that have placeholders (type parameters) for one or more of the types that they store or use. A generic collection class might use a type parameter as a placeholder for the type of objects that it stores. The type parameters appear as the types of its fields and the parameter types of its methods. A generic method might use its type parameter as the type of its return value or as the type of one of its formal parameters. -The following code illustrates a simple generic class definition. - +The following code illustrates a simple generic class definition. + [!code-cpp[Conceptual.Generics.Overview#2](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.generics.overview/cpp/source.cpp#2)] [!code-csharp[Conceptual.Generics.Overview#2](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.generics.overview/cs/source.cs#2)] - [!code-vb[Conceptual.Generics.Overview#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.generics.overview/vb/source.vb#2)] - - When you create an instance of a generic class, you specify the actual types to substitute for the type parameters. This establishes a new generic class, referred to as a constructed generic class, with your chosen types substituted everywhere that the type parameters appear. The result is a type-safe class that is tailored to your choice of types, as the following code illustrates. - + [!code-vb[Conceptual.Generics.Overview#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.generics.overview/vb/source.vb#2)] + + When you create an instance of a generic class, you specify the actual types to substitute for the type parameters. This establishes a new generic class, referred to as a constructed generic class, with your chosen types substituted everywhere that the type parameters appear. The result is a type-safe class that is tailored to your choice of types, as the following code illustrates. + [!code-cpp[Conceptual.Generics.Overview#3](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.generics.overview/cpp/source.cpp#3)] [!code-csharp[Conceptual.Generics.Overview#3](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.generics.overview/cs/source.cs#3)] - [!code-vb[Conceptual.Generics.Overview#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.generics.overview/vb/source.vb#3)] - -### Terminology - -The following terms are used to discuss generics in .NET: - -- A *generic type definition* is a class, structure, or interface declaration that functions as a template, with placeholders for the types that it can contain or use. For example, the class can contain two types: keys and values. Because a generic type definition is only a template, you cannot create instances of a class, structure, or interface that is a generic type definition. - -- *Generic type parameters*, or *type parameters*, are the placeholders in a generic type or method definition. The generic type has two type parameters, `TKey` and `TValue`, that represent the types of its keys and values. - -- A *constructed generic type*, or *constructed type*, is the result of specifying types for the generic type parameters of a generic type definition. - -- A *generic type argument* is any type that is substituted for a generic type parameter. - -- The general term *generic type* includes both constructed types and generic type definitions. - -- *Covariance* and *contravariance* of generic type parameters enable you to use constructed generic types whose type arguments are more derived (covariance) or less derived (contravariance) than a target constructed type. Covariance and contravariance are collectively referred to as *variance*. For more information, see [Covariance and contravariance](covariance-and-contravariance.md). - -- *Constraints* are limits placed on generic type parameters. For example, you might limit a type parameter to types that implement the generic interface, to ensure that instances of the type can be ordered. You can also constrain type parameters to types that have a particular base class, that have a parameterless constructor, or that are reference types or value types. Users of the generic type cannot substitute type arguments that do not satisfy the constraints. - + [!code-vb[Conceptual.Generics.Overview#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.generics.overview/vb/source.vb#3)] + +### Terminology + +The following terms are used to discuss generics in .NET: + +- A *generic type definition* is a class, structure, or interface declaration that functions as a template, with placeholders for the types that it can contain or use. For example, the class can contain two types: keys and values. Because a generic type definition is only a template, you cannot create instances of a class, structure, or interface that is a generic type definition. + +- *Generic type parameters*, or *type parameters*, are the placeholders in a generic type or method definition. The generic type has two type parameters, `TKey` and `TValue`, that represent the types of its keys and values. + +- A *constructed generic type*, or *constructed type*, is the result of specifying types for the generic type parameters of a generic type definition. + +- A *generic type argument* is any type that is substituted for a generic type parameter. + +- The general term *generic type* includes both constructed types and generic type definitions. + +- *Covariance* and *contravariance* of generic type parameters enable you to use constructed generic types whose type arguments are more derived (covariance) or less derived (contravariance) than a target constructed type. Covariance and contravariance are collectively referred to as *variance*. For more information, see [Covariance and contravariance](covariance-and-contravariance.md). + +- *Constraints* are limits placed on generic type parameters. For example, you might limit a type parameter to types that implement the generic interface, to ensure that instances of the type can be ordered. You can also constrain type parameters to types that have a particular base class, that have a parameterless constructor, or that are reference types or value types. Users of the generic type cannot substitute type arguments that do not satisfy the constraints. + - A *generic method definition* is a method with two parameter lists: a list of generic type parameters and a list of formal parameters. Type parameters can appear as the return type or as the types of the formal parameters, as the following code shows. [!code-cpp[Conceptual.Generics.Overview#4](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.generics.overview/cpp/source.cpp#4)] [!code-csharp[Conceptual.Generics.Overview#4](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.generics.overview/cs/source.cs#4)] - [!code-vb[Conceptual.Generics.Overview#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.generics.overview/vb/source.vb#4)] + [!code-vb[Conceptual.Generics.Overview#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.generics.overview/vb/source.vb#4)] - Generic methods can appear on generic or nongeneric types. It's important to note that a method is not generic just because it belongs to a generic type, or even because it has formal parameters whose types are the generic parameters of the enclosing type. A method is generic only if it has its own list of type parameters. In the following code, only method `G` is generic. + Generic methods can appear on generic or nongeneric types. It's important to note that a method is not generic just because it belongs to a generic type, or even because it has formal parameters whose types are the generic parameters of the enclosing type. A method is generic only if it has its own list of type parameters. In the following code, only method `G` is generic. [!code-cpp[Conceptual.Generics.Overview#5](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.generics.overview/cpp/source.cpp#5)] [!code-csharp[Conceptual.Generics.Overview#5](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.generics.overview/cs/source.cs#5)] - [!code-vb[Conceptual.Generics.Overview#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.generics.overview/vb/source.vb#5)] - + [!code-vb[Conceptual.Generics.Overview#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.generics.overview/vb/source.vb#5)] + ## Advantages and disadvantages of generics -There are many advantages to using generic collections and delegates: - -- Type safety. Generics shift the burden of type safety from you to the compiler. There is no need to write code to test for the correct data type because it is enforced at compile time. The need for type casting and the possibility of run-time errors are reduced. - -- Less code and code is more easily reused. There is no need to inherit from a base type and override members. For example, the is ready for immediate use. For example, you can create a linked list of strings with the following variable declaration: - +There are many advantages to using generic collections and delegates: + +- Type safety. Generics shift the burden of type safety from you to the compiler. There is no need to write code to test for the correct data type because it is enforced at compile time. The need for type casting and the possibility of run-time errors are reduced. + +- Less code and code is more easily reused. There is no need to inherit from a base type and override members. For example, the is ready for immediate use. For example, you can create a linked list of strings with the following variable declaration: + [!code-cpp[HowToGeneric#24](../../../samples/snippets/cpp/VS_Snippets_CLR/HowToGeneric/cpp/source2.cpp#24)] [!code-csharp[HowToGeneric#24](../../../samples/snippets/csharp/VS_Snippets_CLR/HowToGeneric/CS/source2.cs#24)] - [!code-vb[HowToGeneric#24](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/source2.vb#24)] - -- Better performance. Generic collection types generally perform better for storing and manipulating value types because there is no need to box the value types. - -- Generic delegates enable type-safe callbacks without the need to create multiple delegate classes. For example, the generic delegate allows you to create a method that implements your own search criteria for a particular type and to use your method with methods of the type such as , , and . - -- Generics streamline dynamically generated code. When you use generics with dynamically generated code you do not need to generate the type. This increases the number of scenarios in which you can use lightweight dynamic methods instead of generating entire assemblies. For more information, see [How to: Define and Execute Dynamic Methods](../../framework/reflection-and-codedom/how-to-define-and-execute-dynamic-methods.md) and . - -The following are some limitations of generics: - -- Generic types can be derived from most base classes, such as (and constraints can be used to require that generic type parameters derive from base classes like ). However, .NET does not support context-bound generic types. A generic type can be derived from , but trying to create an instance of that type causes a . - -- Enumerations cannot have generic type parameters. An enumeration can be generic only incidentally (for example, because it is nested in a generic type that is defined using Visual Basic, C#, or C++). For more information, see "Enumerations" in [Common Type System](../base-types/common-type-system.md). - -- Lightweight dynamic methods cannot be generic. - -- In Visual Basic, C#, and C++, a nested type that is enclosed in a generic type cannot be instantiated unless types have been assigned to the type parameters of all enclosing types. Another way of saying this is that in reflection, a nested type that is defined using these languages includes the type parameters of all its enclosing types. This allows the type parameters of enclosing types to be used in the member definitions of a nested type. For more information, see "Nested Types" in . - + [!code-vb[HowToGeneric#24](../../../samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/source2.vb#24)] + +- Better performance. Generic collection types generally perform better for storing and manipulating value types because there is no need to box the value types. + +- Generic delegates enable type-safe callbacks without the need to create multiple delegate classes. For example, the generic delegate allows you to create a method that implements your own search criteria for a particular type and to use your method with methods of the type such as , , and . + +- Generics streamline dynamically generated code. When you use generics with dynamically generated code you do not need to generate the type. This increases the number of scenarios in which you can use lightweight dynamic methods instead of generating entire assemblies. For more information, see [How to: Define and Execute Dynamic Methods](../../fundamentals/reflection/how-to-define-and-execute-dynamic-methods.md) and . + +The following are some limitations of generics: + +- Generic types can be derived from most base classes, such as (and constraints can be used to require that generic type parameters derive from base classes like ). However, .NET does not support context-bound generic types. A generic type can be derived from , but trying to create an instance of that type causes a . + +- Enumerations cannot have generic type parameters. An enumeration can be generic only incidentally (for example, because it is nested in a generic type that is defined using Visual Basic, C#, or C++). For more information, see "Enumerations" in [Common Type System](../base-types/common-type-system.md). + +- Lightweight dynamic methods cannot be generic. + +- In Visual Basic, C#, and C++, a nested type that is enclosed in a generic type cannot be instantiated unless types have been assigned to the type parameters of all enclosing types. Another way of saying this is that in reflection, a nested type that is defined using these languages includes the type parameters of all its enclosing types. This allows the type parameters of enclosing types to be used in the member definitions of a nested type. For more information, see "Nested Types" in . + > [!NOTE] - > A nested type that is defined by emitting code in a dynamic assembly or by using the [Ilasm.exe (IL Assembler)](../../framework/tools/ilasm-exe-il-assembler.md) is not required to include the type parameters of its enclosing types; however, if it does not include them, the type parameters are not in scope in the nested class. - - For more information, see "Nested Types" in . - -## Class library and language support - -.NET provides a number of generic collection classes in the following namespaces: - -- The namespace contains most of the generic collection types provided by .NET, such as the and generic classes. - -- The namespace contains additional generic collection types, such as the generic class, that are useful for exposing object models to users of your classes. - + > A nested type that is defined by emitting code in a dynamic assembly or by using the [Ilasm.exe (IL Assembler)](../../framework/tools/ilasm-exe-il-assembler.md) is not required to include the type parameters of its enclosing types; however, if it does not include them, the type parameters are not in scope in the nested class. + + For more information, see "Nested Types" in . + +## Class library and language support + +.NET provides a number of generic collection classes in the following namespaces: + +- The namespace contains most of the generic collection types provided by .NET, such as the and generic classes. + +- The namespace contains additional generic collection types, such as the generic class, that are useful for exposing object models to users of your classes. + Generic interfaces for implementing sort and equality comparisons are provided in the namespace, along with generic delegate types for event handlers, conversions, and search predicates. The namespace provides generic interfaces for mathematical functionality (available in .NET 7 and later versions). For more information, see [Generic math](math.md). -Support for generics has been added to the namespace for examining generic types and generic methods, to for emitting dynamic assemblies that contain generic types and methods, and to for generating source graphs that include generics. - -The common language runtime provides new opcodes and prefixes to support generic types in Microsoft intermediate language (MSIL), including , , , , and . - +Support for generics has been added to the namespace for examining generic types and generic methods, to for emitting dynamic assemblies that contain generic types and methods, and to for generating source graphs that include generics. + +The common language runtime provides new opcodes and prefixes to support generic types in Microsoft intermediate language (MSIL), including , , , , and . + Visual C++, C#, and Visual Basic all provide full support for defining and using generics. For more information about language support, see [Generic Types in Visual Basic](../../visual-basic/programming-guide/language-features/data-types/generic-types.md), [Introduction to Generics](../../csharp/fundamentals/types/generics.md), and [Overview of Generics in Visual C++](/cpp/windows/overview-of-generics-in-visual-cpp). -## Nested types and generics +## Nested types and generics + + A type that is nested in a generic type can depend on the type parameters of the enclosing generic type. The common language runtime considers nested types to be generic, even if they do not have generic type parameters of their own. When you create an instance of a nested type, you must specify type arguments for all enclosing generic types. - A type that is nested in a generic type can depend on the type parameters of the enclosing generic type. The common language runtime considers nested types to be generic, even if they do not have generic type parameters of their own. When you create an instance of a nested type, you must specify type arguments for all enclosing generic types. +## Related articles -## Related articles - -|Title|Description| -|-----------|-----------------| -|[Generic Collections in .NET](collections.md)|Describes generic collection classes and other generic types in .NET.| +|Title|Description| +|-----------|-----------------| +|[Generic Collections in .NET](collections.md)|Describes generic collection classes and other generic types in .NET.| |[Generic Delegates for Manipulating Arrays and Lists](delegates-for-manipulating-arrays-and-lists.md)|Describes generic delegates for conversions, search predicates, and actions to be taken on elements of an array or collection.| |[Generic math](math.md)|Describes how you can perform mathematical operations generically.| -|[Generic Interfaces](interfaces.md)|Describes generic interfaces that provide common functionality across families of generic types.| -|[Covariance and Contravariance](covariance-and-contravariance.md)|Describes covariance and contravariance in generic type parameters.| -|[Commonly Used Collection Types](../collections/commonly-used-collection-types.md)|Provides summary information about the characteristics and usage scenarios of the collection types in .NET, including generic types.| -|[When to Use Generic Collections](../collections/when-to-use-generic-collections.md)|Describes general rules for determining when to use generic collection types.| -|[How to: Define a Generic Type with Reflection Emit](../../framework/reflection-and-codedom/how-to-define-a-generic-type-with-reflection-emit.md)|Explains how to generate dynamic assemblies that include generic types and methods.| -|[Generic Types in Visual Basic](../../visual-basic/programming-guide/language-features/data-types/generic-types.md)|Describes the generics feature for Visual Basic users, including how-to topics for using and defining generic types.| -|[Introduction to Generics](../../csharp/fundamentals/types/generics.md)|Provides an overview of defining and using generic types for C# users.| -|[Overview of Generics in Visual C++](/cpp/windows/overview-of-generics-in-visual-cpp)|Describes the generics feature for C++ users, including the differences between generics and templates.| - -## Reference - -- -- -- +|[Generic Interfaces](interfaces.md)|Describes generic interfaces that provide common functionality across families of generic types.| +|[Covariance and Contravariance](covariance-and-contravariance.md)|Describes covariance and contravariance in generic type parameters.| +|[Commonly Used Collection Types](../collections/commonly-used-collection-types.md)|Provides summary information about the characteristics and usage scenarios of the collection types in .NET, including generic types.| +|[When to Use Generic Collections](../collections/when-to-use-generic-collections.md)|Describes general rules for determining when to use generic collection types.| +|[How to: Define a Generic Type with Reflection Emit](../../fundamentals/reflection/how-to-define-a-generic-type-with-reflection-emit.md)|Explains how to generate dynamic assemblies that include generic types and methods.| +|[Generic Types in Visual Basic](../../visual-basic/programming-guide/language-features/data-types/generic-types.md)|Describes the generics feature for Visual Basic users, including how-to topics for using and defining generic types.| +|[Introduction to Generics](../../csharp/fundamentals/types/generics.md)|Provides an overview of defining and using generic types for C# users.| +|[Overview of Generics in Visual C++](/cpp/windows/overview-of-generics-in-visual-cpp)|Describes the generics feature for C++ users, including the differences between generics and templates.| + +## Reference + +- +- +- diff --git a/docs/standard/serialization/attributes-that-control-xml-serialization.md b/docs/standard/serialization/attributes-that-control-xml-serialization.md index 96bf1daf0e47c..f4277f00fd0dc 100644 --- a/docs/standard/serialization/attributes-that-control-xml-serialization.md +++ b/docs/standard/serialization/attributes-that-control-xml-serialization.md @@ -33,6 +33,7 @@ You can apply the attributes in the following table to classes and class members ||Public class declarations.|Controls XML serialization of the attribute target as an XML root element. Use the attribute to further specify the namespace and element name.| ||Public properties and fields.|The property or field should be serialized as XML text.| ||Public class declarations.|The name and namespace of the XML type.| +||Public properties and fields.|The property or field will be ignored when the containing class is serialized.| In addition to these attributes, which are all found in the namespace, you can also apply the attribute to a field. The **DefaultValueAttribute** sets the value that will be automatically assigned to the member if no value is specified. diff --git a/docs/visual-basic/language-reference/error-messages/type-of-member-membername-is-not-cls-compliant.md b/docs/visual-basic/language-reference/error-messages/type-of-member-membername-is-not-cls-compliant.md index ef9211950b0b4..61e1845d0d705 100644 --- a/docs/visual-basic/language-reference/error-messages/type-of-member-membername-is-not-cls-compliant.md +++ b/docs/visual-basic/language-reference/error-messages/type-of-member-membername-is-not-cls-compliant.md @@ -39,4 +39,4 @@ The data type specified for this member is not part of the [Language Independenc ## See also -- [Reflection](../../../framework/reflection-and-codedom/reflection.md) +- [Reflection](../../../fundamentals/reflection/reflection.md) diff --git a/docs/visual-basic/language-reference/error-messages/underlying-type-typename-of-enum-is-not-cls-compliant.md b/docs/visual-basic/language-reference/error-messages/underlying-type-typename-of-enum-is-not-cls-compliant.md index 3a5ca42494c43..7d7cd9a793930 100644 --- a/docs/visual-basic/language-reference/error-messages/underlying-type-typename-of-enum-is-not-cls-compliant.md +++ b/docs/visual-basic/language-reference/error-messages/underlying-type-typename-of-enum-is-not-cls-compliant.md @@ -40,4 +40,4 @@ The data type specified for this enumeration is not part of the [Language Indepe ## See also - [Reflection (Visual Basic)](../../programming-guide/concepts/reflection.md) -- [Reflection](../../../framework/reflection-and-codedom/reflection.md) +- [Reflection](../../../fundamentals/reflection/reflection.md) diff --git a/docs/visual-basic/programming-guide/concepts/reflection.md b/docs/visual-basic/programming-guide/concepts/reflection.md index 418dbefbfaaa9..e5300f0d152d5 100644 --- a/docs/visual-basic/programming-guide/concepts/reflection.md +++ b/docs/visual-basic/programming-guide/concepts/reflection.md @@ -43,17 +43,17 @@ System.Console.WriteLine(info) - For building new types at run time. Use classes in . -- For performing late binding, accessing methods on types created at run time. See the topic [Dynamically Loading and Using Types](../../../framework/reflection-and-codedom/dynamically-loading-and-using-types.md). +- For performing late binding, accessing methods on types created at run time. See the topic [Dynamically Loading and Using Types](../../../fundamentals/reflection/dynamically-loading-and-using-types.md). ## Related Sections For more information: -- [Reflection](../../../framework/reflection-and-codedom/reflection.md) +- [Reflection](../../../fundamentals/reflection/reflection.md) -- [Viewing Type Information](../../../framework/reflection-and-codedom/viewing-type-information.md) +- [Viewing Type Information](../../../fundamentals/reflection/viewing-type-information.md) -- [Reflection and Generic Types](../../../framework/reflection-and-codedom/reflection-and-generic-types.md) +- [Reflection and Generic Types](../../../fundamentals/reflection/reflection-and-generic-types.md) -