From f75417b97d3ff5ec21de89be77761bcdcde5ce04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:07:39 +0000 Subject: [PATCH 01/15] Bump Microsoft.SemanticKernel (#42791) Bumps the dotnet group in /docs/ai/tutorials/snippets/llm-eval with 1 update: [Microsoft.SemanticKernel](https://github.com/microsoft/semantic-kernel). Updates `Microsoft.SemanticKernel` from 1.20.0 to 1.21.1 - [Release notes](https://github.com/microsoft/semantic-kernel/releases) - [Commits](https://github.com/microsoft/semantic-kernel/compare/dotnet-1.20.0...dotnet-1.21.1) --- updated-dependencies: - dependency-name: Microsoft.SemanticKernel dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dotnet ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/ai/tutorials/snippets/llm-eval/llm-eval.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ai/tutorials/snippets/llm-eval/llm-eval.csproj b/docs/ai/tutorials/snippets/llm-eval/llm-eval.csproj index ff89596539bc4..2abc76cb042ca 100644 --- a/docs/ai/tutorials/snippets/llm-eval/llm-eval.csproj +++ b/docs/ai/tutorials/snippets/llm-eval/llm-eval.csproj @@ -12,7 +12,7 @@ - + From 9c0438c8c0f402f284cc2ca69e40ce7b9f2a4d62 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:33:31 +0000 Subject: [PATCH 02/15] Bump xunit in /docs/azure/sdk/snippets/unit-testing in the dotnet group (#42796) Bumps the dotnet group in /docs/azure/sdk/snippets/unit-testing with 1 update: [xunit](https://github.com/xunit/xunit). Updates `xunit` from 2.9.1 to 2.9.2 - [Commits](https://github.com/xunit/xunit/compare/v2-2.9.1...v2-2.9.2) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dotnet ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../azure/sdk/snippets/unit-testing/UnitTestingSampleApp.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/azure/sdk/snippets/unit-testing/UnitTestingSampleApp.csproj b/docs/azure/sdk/snippets/unit-testing/UnitTestingSampleApp.csproj index deab1a3bb5401..363be37b3a19d 100644 --- a/docs/azure/sdk/snippets/unit-testing/UnitTestingSampleApp.csproj +++ b/docs/azure/sdk/snippets/unit-testing/UnitTestingSampleApp.csproj @@ -15,7 +15,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From a62e5a70602eb4cf5e521d2586c3434b409f36b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:37:14 +0000 Subject: [PATCH 03/15] Bump xunit (#42797) Bumps the dotnet group in /samples/snippets/core/testing/unit-testing-using-dotnet-test/csharp with 1 update: [xunit](https://github.com/xunit/xunit). Updates `xunit` from 2.9.1 to 2.9.2 - [Commits](https://github.com/xunit/xunit/compare/v2-2.9.1...v2-2.9.2) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dotnet ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../csharp/PrimeService.Tests/PrimeService.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/core/testing/unit-testing-using-dotnet-test/csharp/PrimeService.Tests/PrimeService.Tests.csproj b/samples/snippets/core/testing/unit-testing-using-dotnet-test/csharp/PrimeService.Tests/PrimeService.Tests.csproj index b34efd8243b68..12959286c0d25 100644 --- a/samples/snippets/core/testing/unit-testing-using-dotnet-test/csharp/PrimeService.Tests/PrimeService.Tests.csproj +++ b/samples/snippets/core/testing/unit-testing-using-dotnet-test/csharp/PrimeService.Tests/PrimeService.Tests.csproj @@ -8,7 +8,7 @@ - + From b61f2f649c2c08078f41383fdd680298037c4375 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:44:19 +0000 Subject: [PATCH 04/15] Bump xunit (#42798) Bumps the dotnet group in /docs/fundamentals/networking/telemetry/snippets/metrics with 1 update: [xunit](https://github.com/xunit/xunit). Updates `xunit` from 2.9.1 to 2.9.2 - [Commits](https://github.com/xunit/xunit/compare/v2-2.9.1...v2-2.9.2) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dotnet ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../telemetry/snippets/metrics/HelloBuiltinMetrics.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fundamentals/networking/telemetry/snippets/metrics/HelloBuiltinMetrics.csproj b/docs/fundamentals/networking/telemetry/snippets/metrics/HelloBuiltinMetrics.csproj index 47477bc076097..57b4e791a81d1 100644 --- a/docs/fundamentals/networking/telemetry/snippets/metrics/HelloBuiltinMetrics.csproj +++ b/docs/fundamentals/networking/telemetry/snippets/metrics/HelloBuiltinMetrics.csproj @@ -10,7 +10,7 @@ - + From 99e408941e3f679e8c12b9d7fb088eea8b2e05e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:50:32 +0000 Subject: [PATCH 05/15] Bump xunit (#42799) Bumps the dotnet group in /samples/snippets/core/testing/unit-testing-best-practices/csharp with 1 update: [xunit](https://github.com/xunit/xunit). Updates `xunit` from 2.9.1 to 2.9.2 - [Commits](https://github.com/xunit/xunit/compare/v2-2.9.1...v2-2.9.2) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dotnet ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../csharp/after/unit-testing-best-practices-after.csproj | 2 +- .../csharp/before/unit-testing-best-practices-before.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/snippets/core/testing/unit-testing-best-practices/csharp/after/unit-testing-best-practices-after.csproj b/samples/snippets/core/testing/unit-testing-best-practices/csharp/after/unit-testing-best-practices-after.csproj index 5f2408b91b03a..0fad0182bb852 100644 --- a/samples/snippets/core/testing/unit-testing-best-practices/csharp/after/unit-testing-best-practices-after.csproj +++ b/samples/snippets/core/testing/unit-testing-best-practices/csharp/after/unit-testing-best-practices-after.csproj @@ -9,7 +9,7 @@ - + diff --git a/samples/snippets/core/testing/unit-testing-best-practices/csharp/before/unit-testing-best-practices-before.csproj b/samples/snippets/core/testing/unit-testing-best-practices/csharp/before/unit-testing-best-practices-before.csproj index 5f2408b91b03a..0fad0182bb852 100644 --- a/samples/snippets/core/testing/unit-testing-best-practices/csharp/before/unit-testing-best-practices-before.csproj +++ b/samples/snippets/core/testing/unit-testing-best-practices/csharp/before/unit-testing-best-practices-before.csproj @@ -9,7 +9,7 @@ - + From 996f55b0d6cc74525b95ad1e520a9c58ae1b77d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:51:17 +0000 Subject: [PATCH 06/15] Bump github/codeql-action from 3.26.9 to 3.26.10 (#42800) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.9 to 3.26.10. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/461ef6c76dfe95d5c364de2f431ddbd31a417628...e2b3eafc8d227b0241d48be5f425d47c2d750a13) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/scorecards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 7e34ce18d5c8d..79744abbeca14 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -71,6 +71,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 + uses: github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10 with: sarif_file: results.sarif From 83f88aa52fae17234bfdad94af5f84fab6917801 Mon Sep 17 00:00:00 2001 From: Olabamiji Oyetubo <60369677+bigboybamo@users.noreply.github.com> Date: Wed, 2 Oct 2024 05:52:48 -0700 Subject: [PATCH 07/15] Bigboybamo patch 5 (#42783) * Update access-modifiers.md Added description for file access type modifier * Update cs1526.md --- docs/csharp/misc/cs1526.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/csharp/misc/cs1526.md b/docs/csharp/misc/cs1526.md index 856529a770179..f261a251b0924 100644 --- a/docs/csharp/misc/cs1526.md +++ b/docs/csharp/misc/cs1526.md @@ -20,21 +20,21 @@ A new expression requires (), [], or {} after type ```csharp // CS1526.cs -public class y -{ - public static int i = 0; - public int myi = 0; -} - -public class z -{ - public static void Main() - { - y py = new y; // CS1526 - y[] aoys = new y[10]; // Array of Ys - - for (int i = 0; i < aoys.Length; i++) - aoys[i] = new y(); // an object of type y - } -} +public class y +{ + public static int globalCounter = 0; + public int instanceCounter = 0; +} + +public class z +{ + public static void Main() + { + y yInstance = new y; // CS1526 + y[] yArray = new y[10]; // Array of Ys + + for (int i = 0; i < yArray.Length; i++) + yArray[i] = new y(); // an object of type y + } +} ``` From e5ea9714cf1089b95e124669d88a47f90bdd9265 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 08:56:40 -0400 Subject: [PATCH 08/15] Bump actions/checkout from 4.1.7 to 4.2.0 (#42801) Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/692973e3d937129bcbf40652eb9f2f61becf3332...d632683dd7b4114ad314bca15554477dd762a938) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/clean-repo.yml | 2 +- .github/workflows/dependabot-bot.yml | 2 +- .github/workflows/dependency-review.yml | 2 +- .github/workflows/docs-verifier.yml | 2 +- .github/workflows/markdownlint.yml | 2 +- .github/workflows/scorecards.yml | 2 +- .github/workflows/snippets5000.yml | 2 +- .github/workflows/whats-new.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/clean-repo.yml b/.github/workflows/clean-repo.yml index 044480039d618..b8c7a373cc71a 100644 --- a/.github/workflows/clean-repo.yml +++ b/.github/workflows/clean-repo.yml @@ -21,7 +21,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 # Call clean repo - name: Clean repo diff --git a/.github/workflows/dependabot-bot.yml b/.github/workflows/dependabot-bot.yml index e6dd58246f881..f29046852a669 100644 --- a/.github/workflows/dependabot-bot.yml +++ b/.github/workflows/dependabot-bot.yml @@ -30,7 +30,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 # - name: Setup .NET # uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0 # with: diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index c1209291aab75..5c03af260a6c2 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -22,6 +22,6 @@ jobs: egress-policy: audit - name: 'Checkout Repository' - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: 'Dependency Review' uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4 diff --git a/.github/workflows/docs-verifier.yml b/.github/workflows/docs-verifier.yml index f705c6c60fb97..fc8916d27c4d9 100644 --- a/.github/workflows/docs-verifier.yml +++ b/.github/workflows/docs-verifier.yml @@ -19,7 +19,7 @@ jobs: egress-policy: audit - name: Checkout the repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Validate uses: dotnet/docs-actions/actions/docs-verifier@5e8bcc78465d45a7544bba56509a1a69922b6a5a # main diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index 98f6c1a895a5b..003461b1caf2c 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -26,7 +26,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - uses: DavidAnson/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8 # v16.0.0 with: config: ".markdownlint-cli2.jsonc" diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 79744abbeca14..9de2fea855dff 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -36,7 +36,7 @@ jobs: egress-policy: audit - name: "Checkout code" - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: persist-credentials: false diff --git a/.github/workflows/snippets5000.yml b/.github/workflows/snippets5000.yml index 02b96477509f9..2d6e1680d72b6 100644 --- a/.github/workflows/snippets5000.yml +++ b/.github/workflows/snippets5000.yml @@ -36,7 +36,7 @@ jobs: egress-policy: audit - name: Checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #@v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #@v4.2.0 # Get the latest preview SDK (or sdk not installed by the runner) - name: Setup .NET diff --git a/.github/workflows/whats-new.yml b/.github/workflows/whats-new.yml index 057e6770ba7e2..d59d8cc140587 100644 --- a/.github/workflows/whats-new.yml +++ b/.github/workflows/whats-new.yml @@ -27,7 +27,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: "Print manual run reason" if: ${{ github.event_name == 'workflow_dispatch' }} From 6b16b934be7a86f41f660b0f58b5a6c5b22cd672 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:58:41 +0000 Subject: [PATCH 09/15] Bump Azure.Identity (#42802) Bumps the dotnet group in /docs/azure/sdk/snippets/logging with 1 update: [Azure.Identity](https://github.com/Azure/azure-sdk-for-net). Updates `Azure.Identity` from 1.12.0 to 1.12.1 - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Identity_1.12.0...Azure.Identity_1.12.1) --- updated-dependencies: - dependency-name: Azure.Identity dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dotnet ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/azure/sdk/snippets/logging/LoggingSampleApp.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/azure/sdk/snippets/logging/LoggingSampleApp.csproj b/docs/azure/sdk/snippets/logging/LoggingSampleApp.csproj index bb39ba9cbb4da..a8ec5113750a3 100644 --- a/docs/azure/sdk/snippets/logging/LoggingSampleApp.csproj +++ b/docs/azure/sdk/snippets/logging/LoggingSampleApp.csproj @@ -9,7 +9,7 @@ - + From 7d8d83730f7224d56400da8142b1742ae2fedd83 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:00:24 +0000 Subject: [PATCH 10/15] Bump xunit (#42803) Bumps the dotnet group in /docs/core/testing/snippets/order-unit-tests/csharp/XUnit.TestProject with 1 update: [xunit](https://github.com/xunit/xunit). Updates `xunit` from 2.9.1 to 2.9.2 - [Commits](https://github.com/xunit/xunit/compare/v2-2.9.1...v2-2.9.2) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dotnet ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../csharp/XUnit.TestProject/XUnit.Project.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/testing/snippets/order-unit-tests/csharp/XUnit.TestProject/XUnit.Project.csproj b/docs/core/testing/snippets/order-unit-tests/csharp/XUnit.TestProject/XUnit.Project.csproj index 77be94b040b1b..eb969df041dfe 100644 --- a/docs/core/testing/snippets/order-unit-tests/csharp/XUnit.TestProject/XUnit.Project.csproj +++ b/docs/core/testing/snippets/order-unit-tests/csharp/XUnit.TestProject/XUnit.Project.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From c0f54c6b93dc2074ad98976cf1681dd03df9455a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:04:09 +0000 Subject: [PATCH 11/15] Bump xunit (#42804) Bumps the dotnet group in /docs/core/testing/snippets/order-unit-tests/csharp with 1 update: [xunit](https://github.com/xunit/xunit). Updates `xunit` from 2.9.1 to 2.9.2 - [Commits](https://github.com/xunit/xunit/compare/v2-2.9.1...v2-2.9.2) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dotnet ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> From eecc5da51fd9a94eec5f6bf989632411df731392 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 2 Oct 2024 08:17:28 -0700 Subject: [PATCH 12/15] Fix build suggestions (#42787) --- docs/ai/conceptual/understanding-tokens.md | 2 +- docs/ai/how-to/app-service-db-auth.md | 10 +- docs/ai/how-to/use-redis-for-memory.md | 2 +- docs/ai/semantic-kernel-dotnet-overview.md | 20 +- docs/azure/includes/dotnet-all.md | 14 +- ...unit-testing-platform-extensions-output.md | 2 +- .../security-protocols-version-1-0.md | 70 ++++--- ...rvices-protocols-interoperability-guide.md | 2 +- .../httpclient-migrate-from-httpwebrequest.md | 192 +++++++++--------- 9 files changed, 156 insertions(+), 158 deletions(-) diff --git a/docs/ai/conceptual/understanding-tokens.md b/docs/ai/conceptual/understanding-tokens.md index 5bd95ed09b88c..910d5ccd93206 100644 --- a/docs/ai/conceptual/understanding-tokens.md +++ b/docs/ai/conceptual/understanding-tokens.md @@ -81,7 +81,7 @@ As training continues, the model adds any new tokens in the training text to its The semantic relationships between the tokens can be analyzed by using these token ID sequences. Multi-valued numeric vectors, known as [embeddings](embeddings.md), are used to represent these relationships. An embedding is assigned to each token based on how commonly it's used together with, or in similar contexts to, the other tokens. -After it's trained, a model can calculate an embedding for text that contains multiple tokens. The model tokenizes the text, then calculates an overall embeddings value based on the learned embeddings of the individual tokens. This technique can be used for semantic document searches or adding [memories](/semantic-kernel/memories/) to an AI. +After it's trained, a model can calculate an embedding for text that contains multiple tokens. The model tokenizes the text, then calculates an overall embeddings value based on the learned embeddings of the individual tokens. This technique can be used for semantic document searches or adding [vector stores](/semantic-kernel/concepts/vector-store-connectors/) to an AI. During output generation, the model predicts a vector value for the next token in the sequence. The model then selects the next token from it's vocabulary based on this vector value. In practice, the model calculates multiple vectors by using various elements of the previous tokens' embeddings. The model then evaluates all potential tokens from these vectors and selects the most probable one to continue the sequence. diff --git a/docs/ai/how-to/app-service-db-auth.md b/docs/ai/how-to/app-service-db-auth.md index e516d2b5d812e..0fe3c2996b55a 100644 --- a/docs/ai/how-to/app-service-db-auth.md +++ b/docs/ai/how-to/app-service-db-auth.md @@ -13,7 +13,7 @@ zone_pivot_groups: azure-interface This article demonstrates how to manage the connection between your App Service .NET application and a [vector database solution](../conceptual/vector-databases.md). It covers using Microsoft Entra managed identities for supported services and securely storing connection strings for others. -By adding a vector database to your application, you can enable [semantic memories](/semantic-kernel/memories/) for your AI. The [Semantic Kernel SDK](/semantic-kernel/overview) for .NET enables you to easily implement memory storage and recall using your preferred vector database solution. +By adding a vector database to your application, you can enable [semantic memories or *vector stores*]([vector stores](/semantic-kernel/concepts/vector-store-connectors/)) for your AI. The [Semantic Kernel SDK](/semantic-kernel/overview) for .NET enables you to easily implement memory storage and recall using your preferred vector database solution. ## Prerequisites @@ -22,7 +22,7 @@ By adding a vector database to your application, you can enable [semantic memori * [`Microsoft.SemanticKernel` NuGet package](https://www.nuget.org/packages/Microsoft.SemanticKernel) * [`Microsoft.SemanticKernel.Plugins.Memory` NuGet package](https://www.nuget.org/packages/Microsoft.SemanticKernel.Plugins.Memory) * [Create and deploy a .NET application to App Service](/azure/app-service/quickstart-dotnetcore) -* [Create and deploy a vector database solution](/semantic-kernel/memories/vector-db) +* [Create and deploy a vector database solution](/semantic-kernel/concepts/ai-services/integrations#vector-database-solutions) ## Use Microsoft Entra managed identity for authentication @@ -190,7 +190,7 @@ Before following these steps, retrieve a connection string for your vector datab > [!IMPORTANT] > Before following these steps, ensure you have [created a Key Vault using the Azure CLI](/azure/key-vault/general/quick-create-cli). -1. Grant your user account permissions to your key vault through Role-Based Access Control (RBAC), assign a role using the Azure CLI command [`az role assignment create`](/cli/azure/role/assignment?view=azure-cli-latest#az-role-assignment-create): +1. Grant your user account permissions to your key vault through Role-Based Access Control (RBAC), assign a role using the Azure CLI command [`az role assignment create`](/cli/azure/role/assignment#az-role-assignment-create): ```azurecli az role assignment create \ @@ -199,7 +199,7 @@ Before following these steps, retrieve a connection string for your vector datab --scope "/subscriptions//resourceGroups//providers/Microsoft.KeyVault/vaults/" ``` -1. Add the connection string to Key Vault using the Azure CLI command [`az keyvault secret set`](/cli/azure/keyvault/secret?view=azure-cli-latest#az-keyvault-secret-set): +1. Add the connection string to Key Vault using the Azure CLI command [`az keyvault secret set`](/cli/azure/keyvault/secret#az-keyvault-secret-set): ```azurecli az keyvault secret set \ @@ -271,7 +271,7 @@ Before following these steps, retrieve a connection string for your vector datab :::zone target="docs" pivot="azure-cli" -Add or edit an app setting with the Azure CLI command [`az webapp config connection-string set`](/cli/azure/webapp/config/connection-string?view=azure-cli-latest#az-webapp-config-connection-string-set): +Add or edit an app setting with the Azure CLI command [`az webapp config connection-string set`](/cli/azure/webapp/config/connection-string#az-webapp-config-connection-string-set): ```azurecli az webapp config connection-string set \ diff --git a/docs/ai/how-to/use-redis-for-memory.md b/docs/ai/how-to/use-redis-for-memory.md index f8208cd01da00..fd1956caa838d 100644 --- a/docs/ai/how-to/use-redis-for-memory.md +++ b/docs/ai/how-to/use-redis-for-memory.md @@ -13,7 +13,7 @@ ms.date: 04/17/2024 This article demonstrates how to integrate a Redis database with the RediSearch module into the [Semantic Kernel SDK](/semantic-kernel/overview) and use it for memory storage and retrieval. -[Memories](/semantic-kernel/memories/) represent text information that has been stored alongside a precomputed embedding vector for the whole text. When an LLM is prompted to recall a memory, it uses these precomputed embeddings to efficiently evaluate whether a memory is relevant to the prompt. After the LLM finds a matching memory, it uses the memory's text information as context for the next steps in the prompt completion. +[Vector stores](/semantic-kernel/concepts/vector-store-connectors/) represent text information that has been stored alongside a precomputed embedding vector for the whole text. When an LLM is prompted to recall a memory, it uses these precomputed embeddings to efficiently evaluate whether a memory is relevant to the prompt. After the LLM finds a matching memory, it uses the memory's text information as context for the next steps in the prompt completion. Memory storage that's added to the Semantic Kernel SDK provides a broader context for your requests. It also enables you to store data in the same manner as you store a traditional database, but query it by using natural language. diff --git a/docs/ai/semantic-kernel-dotnet-overview.md b/docs/ai/semantic-kernel-dotnet-overview.md index 0e1cdd6c8e669..b0e25dfc6200a 100644 --- a/docs/ai/semantic-kernel-dotnet-overview.md +++ b/docs/ai/semantic-kernel-dotnet-overview.md @@ -15,7 +15,7 @@ In this article, you explore [Semantic Kernel](/semantic-kernel/overview) core c - How to add semantic kernel to your project - Semantic Kernel core concepts -The sections ahead serve as an introductory overview of Semantic Kernel specifically in the context of .NET. For more comprehensive information and training about Semantic Kernel, see the following resources: +This article serves as an introductory overview of Semantic Kernel specifically in the context of .NET. For more comprehensive information and training about Semantic Kernel, see the following resources: - [Semantic Kernel documentation](/semantic-kernel/overview) - [Semantic Kernel training](/training/paths/develop-ai-agents-azure-open-ai-semantic-kernel-sdk/) @@ -115,7 +115,7 @@ string skPrompt = @"Summarize the provided unstructured text in a sentence that // Register the function kernel.CreateSemanticFunction( - promptTemplate: skPrompt, + promptTemplate: skPrompt, functionName: "SummarizeText", pluginName: "SemanticFunctions" ); @@ -132,9 +132,9 @@ The following code snippet defines and registers a native function: public class NativeFunctions { [SKFunction, Description("Retrieve content from local file")] - public async Task RetrieveLocalFile(string fileName, int maxSize = 5000) + public async Task RetrieveLocalFile(string fileName, int maxSize = 5000) { - string content = await File.ReadAllTextAsync(fileName); + string content = await File.ReadAllTextAsync(fileName); if (content.Length <= maxSize) return content; return content.Substring(0, maxSize); } @@ -159,7 +159,7 @@ Consider the following pseudo-code snippet: // Configure and create the plan string planDefinition = "Read content from a local file and summarize the content."; -SequentialPlanner sequentialPlanner = new SequentialPlanner(kernel); +SequentialPlanner sequentialPlanner = new SequentialPlanner(kernel); string assetsFolder = @"../../assets"; string fileName = Path.Combine(assetsFolder,"docs","06_SemanticKernel", "aci_documentation.txt"); @@ -178,21 +178,21 @@ The preceding code creates an executable, sequential plan to read content from a ### Memory -Semantic Kernel's [Memory](/semantic-kernel/memories) provides abstractions over embedding models, vector databases, and other data to simplify context management for AI applications. Memory is agnostic to the underlying LLM or Vector DB, offering a uniform developer experience. You can configure memory features to store data in a variety of sources or service, including Azure AI Search, Azure Cache for Redis, and more. +Semantic Kernel's [Vector stores](/semantic-kernel/concepts/vector-store-connectors/) provide abstractions over embedding models, vector databases, and other data to simplify context management for AI applications. Vector stores are agnostic to the underlying LLM or Vector database, offering a uniform developer experience. You can configure memory features to store data in a variety of sources or service, including Azure AI Search and Azure Cache for Redis. Consider the following code snippet: ```csharp var facts = new Dictionary(); facts.Add( - "Azure Machine Learning; https://docs.microsoft.com/en-us/azure/machine-learning/", - @"Azure Machine Learning is a cloud service for accelerating and - managing the machine learning project lifecycle. Machine learning professionals, + "Azure Machine Learning; https://learn.microsoft.com/en-us/azure/machine-learning/", + @"Azure Machine Learning is a cloud service for accelerating and + managing the machine learning project lifecycle. Machine learning professionals, data scientists, and engineers can use it in their day-to-day workflows" ); facts.Add( - "Azure SQL Service; https://docs.microsoft.com/en-us/azure/azure-sql/", + "Azure SQL Service; https://learn.microsoft.com/en-us/azure/azure-sql/", @"Azure SQL is a family of managed, secure, and intelligent products that use the SQL Server database engine in the Azure cloud." ); diff --git a/docs/azure/includes/dotnet-all.md b/docs/azure/includes/dotnet-all.md index 9f6287c5686cf..7ab3976fcaa71 100644 --- a/docs/azure/includes/dotnet-all.md +++ b/docs/azure/includes/dotnet-all.md @@ -378,7 +378,7 @@ | Common | NuGet [2.2.1](https://www.nuget.org/packages/Microsoft.Azure.Common/2.2.1) | | | | Common - Dependencies | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Common.Dependencies/1.0.0) | | | | Computer Vision | NuGet [7.0.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.ComputerVision/7.0.1) | | GitHub [7.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Vision.ComputerVision_6.0.0-preview.1/sdk/cognitiveservices/Vision.ComputerVision) | -| Cosmos DB | NuGet [3.42.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.42.0)
NuGet [3.44.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.44.0-preview.1) | [docs](https://learn.microsoft.com/dotnet/api/overview/azure/cosmosdb) | GitHub [3.42.0](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/3.12.0/Microsoft.Azure.Cosmos) | +| Cosmos DB | NuGet [3.42.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.42.0)
NuGet [3.44.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.44.0-preview.1) | [docs](/dotnet/api/overview/azure/cosmosdb) | GitHub [3.42.0](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/3.12.0/Microsoft.Azure.Cosmos) | | Custom Image Search | NuGet [2.1.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.BingCustomImageSearch/2.1.0-preview.1) | | GitHub [2.1.0-preview.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Search.BingCustomImageSearch_2.1.0-preview.1/sdk/cognitiveservices/Search.BingCustomImageSearch) | | Custom Image Search | NuGet [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.CustomImageSearch/2.0.0) | | | | Custom Search | NuGet [2.1.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.BingCustomSearch/2.1.0-preview.1) | | GitHub [2.1.0-preview.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Search.BingCustomSearch_2.1.0-preview.1/sdk/cognitiveservices/Search.BingCustomSearch) | @@ -394,15 +394,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](https://learn.microsoft.com/dotnet/api/microsoft.featuremanagement) | | +| Feature Management | NuGet [3.0.0](https://www.nuget.org/packages/Microsoft.FeatureManagement/3.0.0) | [docs](/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 Plug and Play - Devices Client | NuGet [1.42.3](https://www.nuget.org/packages/Microsoft.Azure.Devices.Client/1.42.3)
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](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) | +| 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) | | 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) | @@ -430,7 +430,7 @@ | News Search | NuGet [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.NewsSearch/2.0.0) | | | | 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) | -| 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) | +| 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) | | 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/) | @@ -441,7 +441,7 @@ | 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.1-alpha.1](https://www.nuget.org/packages/Microsoft.Azure.DataLake.Store/2.0.1-alpha.1) | [docs](https://learn.microsoft.com/dotnet/api/overview/azure/data-lake-store) | GitHub [2.0.1-alpha.1](https://github.com/Azure/azure-data-lake-store-net/tree/1.2.3-alpha) | +| Storage - Files Data Lake | NuGet [2.0.1-alpha.1](https://www.nuget.org/packages/Microsoft.Azure.DataLake.Store/2.0.1-alpha.1) | [docs](/dotnet/api/overview/azure/data-lake-store) | GitHub [2.0.1-alpha.1](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) | | | | 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) | @@ -466,7 +466,7 @@ | Functions extension for Azure SQL and SQL Server | NuGet [3.0.534](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Sql/3.0.534)
NuGet [3.1.169-preview](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Sql/3.1.169-preview) | | | | Functions extension for Cosmos DB | NuGet [4.8.1](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.CosmosDB/4.8.1) | | GitHub [4.8.1](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/cosmos-v3.0.7/src/WebJobs.Extensions.CosmosDB) | | Functions extension for DocumentDB | NuGet [1.3.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DocumentDB/1.3.0) | | GitHub [1.3.0](https://github.com/Azure/azure-webjobs-sdk-extensions) | -| Functions extension for Durable Task Framework | NuGet [2.13.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/2.13.0)
NuGet [3.0.0-rc.2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/3.0.0-rc.2) | [docs](https://learn.microsoft.com/dotnet/api/overview/azure/functions) | GitHub [2.13.0](https://github.com/Azure/azure-functions-durable-extension/tree/v2.2.2/src/WebJobs.Extensions.DurableTask) | +| Functions extension for Durable Task Framework | NuGet [2.13.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/2.13.0)
NuGet [3.0.0-rc.2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/3.0.0-rc.2) | [docs](/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.2](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask/1.2.0-rc.2) | | | | 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/core/testing/unit-testing-platform-extensions-output.md b/docs/core/testing/unit-testing-platform-extensions-output.md index 096113d7761ff..17934b9c383b5 100644 --- a/docs/core/testing/unit-testing-platform-extensions-output.md +++ b/docs/core/testing/unit-testing-platform-extensions-output.md @@ -28,7 +28,7 @@ There are two output modes available: ### ANSI -Internally there are 2 different output formatters that are auto-detecting the terminal capability to handle [ANSI escape codes](https://learn.microsoft.com/windows/console/console-virtual-terminal-sequences). +Internally there are 2 different output formatters that are auto-detecting the terminal capability to handle [ANSI escape codes](/windows/console/console-virtual-terminal-sequences). - The ANSI formatter is used when the terminal is capable of rendering the escape codes. - The non-ANSI formatter is used when the terminal cannot handle the escape codes, or when `--no-ansi` is used, or when output is redirected. diff --git a/docs/framework/wcf/feature-details/security-protocols-version-1-0.md b/docs/framework/wcf/feature-details/security-protocols-version-1-0.md index 121a98e509b39..1e09370877931 100644 --- a/docs/framework/wcf/feature-details/security-protocols-version-1-0.md +++ b/docs/framework/wcf/feature-details/security-protocols-version-1-0.md @@ -24,35 +24,33 @@ The Web Services Security Protocols provide Web services security mechanisms tha |Application Note:

Using WS-Trust for TLS Handshake|To be published| |Application Note:

Using WS-Trust for SPNEGO|To be published| |Application Note:

Web Services Addressing Endpoint References And Identity|To be published| -|WS-SecurityPolicy 1.1

(2005/07)|

as amended by [errata](https://lists.oasis-open.org/archives/ws-sx/200512/msg00017.html) submitted to OASIS WS-SX Technical Committee | +|WS-SecurityPolicy 1.1

(2005/07)|

as amended by errata submitted to OASIS WS-SX Technical Committee | WCF, version 1, provides 17 authentication modes that can be used as the basis for Web services security configuration. Each mode is optimized for a common set of deployment requirements, such as: - Credentials used to authenticate client and service. - - Message or transport security protection mechanisms. - - Message exchange patterns. -|Authentication Mode|Client Authentication|Server Authentication|Mode| -|-------------------------|---------------------------|---------------------------|----------| -|UserNameOverTransport|User name/password|X509|Transport| -|CertificateOverTransport|X509|X509|Transport| -|KerberosOverTransport|Windows|X509|Transport| -|IssuedTokenOverTransport|Federated|X509|Transport| -|SspiNegotiatedOverTransport|Windows Sspi Negotiated|Windows Sspi Negotiated|Transport| -|AnonymousForCertificate|None|X509|Message| -|UserNameForCertificate|User name/password|X509|Message| -|MutualCertificate|X509|X509|Message| -|MutualCertificateDuplex|X509|X509|Message| -|IssuedTokenForCertificate|Federated|X509|Message| -|Kerberos|Windows|Windows|Message| -|IssuedToken|Federated|Federated|Message| -|SspiNegotiated|Windows Sspi Negotiated|Windows Sspi Negotiated|Message| -|AnonymousForSslNegotiated|None|X509, TLS-Nego|Message| -|UserNameForSslNegotiated|User name/password|X509, TLS-Nego|Message| -|MutualSslNegotiated|X509|X509, TLS-Nego|Message| -|IssuedTokenForSslNegotiated|Federated|X509, TLS-Nego|Message| +| Authentication Mode | Client Authentication | Server Authentication | Mode | +|-----------------------------|-------------------------|-------------------------|-----------| +| UserNameOverTransport | User name/password | X509 | Transport | +| CertificateOverTransport | X509 | X509 | Transport | +| KerberosOverTransport | Windows | X509 | Transport | +| IssuedTokenOverTransport | Federated | X509 | Transport | +| SspiNegotiatedOverTransport | Windows Sspi Negotiated | Windows Sspi Negotiated | Transport | +| AnonymousForCertificate | None | X509 | Message | +| UserNameForCertificate | User name/password | X509 | Message | +| MutualCertificate | X509 | X509 | Message | +| MutualCertificateDuplex | X509 | X509 | Message | +| IssuedTokenForCertificate | Federated | X509 | Message | +| Kerberos | Windows | Windows | Message | +| IssuedToken | Federated | Federated | Message | +| SspiNegotiated | Windows Sspi Negotiated | Windows Sspi Negotiated | Message | +| AnonymousForSslNegotiated | None | X509, TLS-Nego | Message | +| UserNameForSslNegotiated | User name/password | X509, TLS-Nego | Message | +| MutualSslNegotiated | X509 | X509, TLS-Nego | Message | +| IssuedTokenForSslNegotiated | Federated | X509, TLS-Nego | Message | Endpoints using such authentication modes can express their security requirements using WS-SecurityPolicy (WS-SP). This document describes the structure of security header and infrastructure messages for each authentication mode and provides examples of policies and messages. @@ -62,20 +60,20 @@ The Web Services Security Protocols provide Web services security mechanisms tha The following prefixes and namespaces are used in this document. -|Prefix|Namespace| -|------------|---------------| -|s|| -|sp|`https://schemas.xmlsoap.org/ws/2005/07/securitypolicy/`| -|a|| -|wsse|TBD – OASIS WSS 1.0 URI| -|wsse11|TBD – OASIS WSS 1.1 URI| -|wsu|TBD – OASIS WSS 1.0 Utility URI| -|ds|TBD – W3C XMLDSig URI| -|wst|TBD – WS-Trust 2005/02 URI| -|wssc|TBD – WS-SecureConversation 2005/02 URI| -|wsaw|TBD - WS-Addressing policy namespace| -|wsp|`https://schemas.xmlsoap.org/ws/2004/09/policy`| -|mssp|`https://schemas.xmlsoap.org/ws/2005/07/securitypolicy`| +| Prefix | Namespace | +|--------|----------------------------------------------------------| +| s | | +| sp | `https://schemas.xmlsoap.org/ws/2005/07/securitypolicy/` | +| a | | +| wsse | TBD – OASIS WSS 1.0 URI | +| wsse11 | TBD – OASIS WSS 1.1 URI | +| wsu | TBD – OASIS WSS 1.0 Utility URI | +| ds | TBD – W3C XMLDSig URI | +| wst | TBD – WS-Trust 2005/02 URI | +| wssc | TBD – WS-SecureConversation 2005/02 URI | +| wsaw | TBD - WS-Addressing policy namespace | +| wsp | `https://schemas.xmlsoap.org/ws/2004/09/policy` | +| mssp | `https://schemas.xmlsoap.org/ws/2005/07/securitypolicy` | ## 1. Token Profiles diff --git a/docs/framework/wcf/feature-details/web-services-protocols-interoperability-guide.md b/docs/framework/wcf/feature-details/web-services-protocols-interoperability-guide.md index 7a83989a0e856..4798841eddeaa 100644 --- a/docs/framework/wcf/feature-details/web-services-protocols-interoperability-guide.md +++ b/docs/framework/wcf/feature-details/web-services-protocols-interoperability-guide.md @@ -61,7 +61,7 @@ Infrastructure protocols interoperability is provided by the WS-* specifications |WSS: SAML 1.1 Token Profile 1.1|[Web Services Security SAML Token Profile 1.1](http://docs.oasis-open.org/wss/v1.1/wss-v1.1-spec-os-SAMLTokenProfile.pdf)| |WS-Secure Conversation|[Web Services Secure Conversation Language](http://specs.xmlsoap.org/ws/2005/02/sc/ws-secureconversation.pdf)| |WS-Trust 1.4|[Web Services Trust Language](https://docs.oasis-open.org/ws-sx/ws-trust/200802)| -|WS-SecurityPolicy 2005/07|[Web Services Secure Conversation Language](http://specs.xmlsoap.org/ws/2005/02/sc/ws-secureconversation.pdf)

As amended by errata submitted to OASIS WS-SX Technical Committee.

[ws-sx message](https://lists.oasis-open.org/archives/ws-sx/200512/msg00017.html)| +|WS-SecurityPolicy 2005/07|[Web Services Secure Conversation Language](http://specs.xmlsoap.org/ws/2005/02/sc/ws-secureconversation.pdf)

As amended by errata submitted to OASIS WS-SX Technical Committee.| |WS-ReliableMessaging 1.1|[Reliable Messaging Protocol version 1.1](reliable-messaging-protocol-version-1-1.md)| supports the specifications in the following table. diff --git a/docs/fundamentals/networking/http/httpclient-migrate-from-httpwebrequest.md b/docs/fundamentals/networking/http/httpclient-migrate-from-httpwebrequest.md index 7fde64ea5ee86..7a4d88185b689 100644 --- a/docs/fundamentals/networking/http/httpclient-migrate-from-httpwebrequest.md +++ b/docs/fundamentals/networking/http/httpclient-migrate-from-httpwebrequest.md @@ -1,10 +1,10 @@ --- title: Migrate from HttpWebRequest -description: Guidance document for migrating from HttpWebRequest to HttpClient. +description: Learn how to migrate from HttpWebRequest to HttpClient. author: liveans ms.author: aaksoy ms.date: 07/25/2024 -helpviewer_keywords: +helpviewer_keywords: - "protocols, HTTP" - "migration, HTTP" - "HTTP" @@ -15,14 +15,14 @@ helpviewer_keywords: - "Internet, HTTP" --- -# HttpWebRequest to HttpClient Migration Guide +# HttpWebRequest to HttpClient migration guide -This document aims to guide developers through the process of migrating from , , and to . The migration is necessary due to the obsolescence of the older APIs and the numerous benefits offered by , including improved performance, better resource management, and a more modern and flexible API design. By following the steps outlined in this document, developers will be able to transition their codebases smoothly and take full advantage of the features provided by . +This article aims to guide developers through the process of migrating from , , and to . The migration is necessary due to the obsolescence of the older APIs and the numerous benefits offered by , including improved performance, better resource management, and a more modern and flexible API design. By following the steps outlined in this document, developers will be able to transition their codebases smoothly and take full advantage of the features provided by . > [!WARNING] -> Migrating from `HttpWebRequest`, `ServicePoint`, and `ServicePointManager` to `HttpClient` is not just a "nice to have" performance improvement. It's crucial to understand that the existing `WebRequest` logic's performance is likely to degrade significantly once you move to .NET Core. This is because `WebRequest` is maintained as a minimal compatibility layer, which means it lacks many optimizations, such as connection reuse in numerous cases. Therefore, transitioning to `HttpClient` is essential to ensure your application's performance and resource management are up to modern standards. +> Migrating from `HttpWebRequest`, `ServicePoint`, and `ServicePointManager` to `HttpClient` is not just a "nice to have" performance improvement. It's crucial to understand that the existing `WebRequest` logic's performance is likely to degrade significantly once you move to .NET (Core). That's because `WebRequest` is maintained as a minimal compatibility layer, which means it lacks many optimizations, such as connection reuse in numerous cases. Therefore, transitioning to `HttpClient` is essential to ensure your application's performance and resource management are up to modern standards. -## Migrating from to +## Migrate from to Let's start with some examples: @@ -66,122 +66,122 @@ HttpClient client = new(); using HttpResponseMessage responseMessage = await client.PostAsync(uri, new StringContent("Hello World!")); ``` -## HttpWebRequest to HttpClient, SocketsHttpHandler Migration Guide +## HttpWebRequest to HttpClient, SocketsHttpHandler migration guide | Old API | New API | Notes | -|---------|----------------------|-------| -| `Accept` | | See: [Example: Set Request Headers](#example-set-common-request-headers). | -| `Address` | | See: [Example: Fetch Redirected URI](#example-fetch-redirected-uri). | -| `AllowAutoRedirect` | | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | -| `AllowReadStreamBuffering` | No direct equivalent API | See: [Usage of Buffering Properties](#usage-of-buffering-properties). | -| `AllowWriteStreamBuffering` | No direct equivalent API | See: [Usage of Buffering Properties](#usage-of-buffering-properties). | -| `AuthenticationLevel` | No direct equivalent API | See: [Example: Enabling Mutual Authentication](#example-enabling-mutual-authentication). | -| `AutomaticDecompression` | | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | -| `CachePolicy` | No direct equivalent API | See: [Example: Apply CachePolicy Headers](#example-apply-cachepolicy-headers). | -| `ClientCertificates` | . | See: [Usage of Certificate Related Properties in HttpClient](#usage-of-certificate-and-tls-related-properties-in-httpclient). | -| `Connection` | | See: [Example: Set Request Headers](#example-set-common-request-headers). | +|------------------------------------------|---------|-------| +| `Accept` | | [Example: Set Request Headers](#example-set-common-request-headers). | +| `Address` | | [Example: Fetch Redirected URI](#example-fetch-redirected-uri). | +| `AllowAutoRedirect` | | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | +| `AllowReadStreamBuffering` | No direct equivalent API | [Usage of Buffering Properties](#usage-of-buffering-properties). | +| `AllowWriteStreamBuffering` | No direct equivalent API | [Usage of Buffering Properties](#usage-of-buffering-properties). | +| `AuthenticationLevel` | No direct equivalent API | [Example: Enabling Mutual Authentication](#example-enable-mutual-authentication). | +| `AutomaticDecompression` | | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | +| `CachePolicy` | No direct equivalent API | [Example: Apply CachePolicy Headers](#example-apply-cachepolicy-headers). | +| `ClientCertificates` | . | [Usage of Certificate Related Properties in HttpClient](#usage-of-certificate-and-tls-related-properties-in-httpclient). | +| `Connection` | | [Example: Set Request Headers](#example-set-common-request-headers). | | `ConnectionGroupName` | No equivalent API | No workaround | -| `ContentLength` | | See: [Example: Set Content Headers](#example-set-content-headers). | -| `ContentType` | | See: [Example: Set Content Headers](#example-set-content-headers). | +| `ContentLength` | | [Example: Set Content Headers](#example-set-content-headers). | +| `ContentType` | | [Example: Set Content Headers](#example-set-content-headers). | | `ContinueDelegate` | No equivalent API | No workaround. | -| `ContinueTimeout` | | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | -| `CookieContainer` | | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | -| `Credentials` | | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | -| `Date` | | See: [Example: Set Request Headers](#example-set-common-request-headers). | -| `DefaultCachePolicy` | No direct equivalent API | See: [Example: Apply CachePolicy Headers](#example-apply-cachepolicy-headers). | -| `DefaultMaximumErrorResponseLength` | No direct equivalent API | See: [Example: Set MaximumErrorResponseLength in HttpClient](#example-set-maximumerrorresponselength-in-httpclient). | +| `ContinueTimeout` | | [Example: Set SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | +| `CookieContainer` | | [Example: Set SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | +| `Credentials` | | [Example: Set SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | +| `Date` | | [Example: Set Request Headers](#example-set-common-request-headers). | +| `DefaultCachePolicy` | No direct equivalent API | [Example: Apply CachePolicy Headers](#example-apply-cachepolicy-headers). | +| `DefaultMaximumErrorResponseLength` | No direct equivalent API | [Example: Set MaximumErrorResponseLength in HttpClient](#example-set-maximumerrorresponselength-in-httpclient). | | `DefaultMaximumResponseHeadersLength` | No equivalent API | can be used instead. | | `DefaultWebProxy` | No equivalent API | can be used instead. | -| `Expect` | | See: [Example: Set Request Headers](#example-set-common-request-headers). | +| `Expect` | | [Example: Set Request Headers](#example-set-common-request-headers). | | `HaveResponse` | No equivalent API | Implied by having an `HttpResponseMessage` instance. | -| `Headers` | | See: [Example: Set Request Headers](#example-set-custom-request-headers). | -| `Host` | | See: [Example: Set Request Headers](#example-set-common-request-headers). | -| `IfModifiedSince` | | See: [Example: Set Request Headers](#example-set-common-request-headers). | -| `ImpersonationLevel` | No direct equivalent API | See: [Example: Change ImpersonationLevel](#example-change-impersonationlevel). | -| `KeepAlive` | No direct equivalent API | See: [Example: Set Request Headers](#example-set-custom-request-headers). | -| `MaximumAutomaticRedirections` | | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | -| `MaximumResponseHeadersLength` | | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | -| `MediaType` | No direct equivalent API | See: [Example: Set Content Headers](#example-set-content-headers). | -| `Method` | | See: [Example: Usage of HttpRequestMessage properties](#example-usage-of-httprequestmessage-properties). | +| `Headers` | | [Example: Set Request Headers](#example-set-custom-request-headers). | +| `Host` | | [Example: Set Request Headers](#example-set-common-request-headers). | +| `IfModifiedSince` | | [Example: Set Request Headers](#example-set-common-request-headers). | +| `ImpersonationLevel` | No direct equivalent API | [Example: Change ImpersonationLevel](#example-change-impersonationlevel). | +| `KeepAlive` | No direct equivalent API | [Example: Set Request Headers](#example-set-custom-request-headers). | +| `MaximumAutomaticRedirections` | | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | +| `MaximumResponseHeadersLength` | | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | +| `MediaType` | No direct equivalent API | [Example: Set Content Headers](#example-set-content-headers). | +| `Method` | | [Example: Usage of HttpRequestMessage properties](#example-usage-of-httprequestmessage-properties). | | `Pipelined` | No equivalent API | `HttpClient` doesn't support pipelining. | | `PreAuthenticate` | | | -| `ProtocolVersion` | `HttpRequestMessage.Version` | See: [Example: Usage of HttpRequestMessage properties](#example-usage-of-httprequestmessage-properties). | -| `Proxy` | | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | -| `ReadWriteTimeout` | No direct equivalent API | See: [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | -| `Referer` | | See: [Example: Set Request Headers](#example-set-common-request-headers). | -| `RequestUri` | | See: [Example: Usage of HttpRequestMessage properties](#example-usage-of-httprequestmessage-properties). | -| `SendChunked` | | See: [Example: Set Request Headers](#example-set-common-request-headers). | -| `ServerCertificateValidationCallback` | . | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | +| `ProtocolVersion` | `HttpRequestMessage.Version` | [Example: Usage of HttpRequestMessage properties](#example-usage-of-httprequestmessage-properties). | +| `Proxy` | | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | +| `ReadWriteTimeout` | No direct equivalent API | [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | +| `Referer` | | [Example: Set Request Headers](#example-set-common-request-headers). | +| `RequestUri` | | [Example: Usage of HttpRequestMessage properties](#example-usage-of-httprequestmessage-properties). | +| `SendChunked` | | [Example: Set Request Headers](#example-set-common-request-headers). | +| `ServerCertificateValidationCallback` | . | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | | `ServicePoint` | No equivalent API | `ServicePoint` is not part of `HttpClient`. | | `SupportsCookieContainer` | No equivalent API | This is always `true` for `HttpClient`. | | `Timeout` | | | -| `TransferEncoding` | | See: [Example: Set Request Headers](#example-set-common-request-headers). | +| `TransferEncoding` | | [Example: Set Request Headers](#example-set-common-request-headers). | | `UnsafeAuthenticatedConnectionSharing` | No equivalent API | No workaround | -| `UseDefaultCredentials` | No direct equivalent API | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | -| `UserAgent` | | See: [Example: Set Request Headers](#example-set-common-request-headers). | +| `UseDefaultCredentials` | No direct equivalent API | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | +| `UserAgent` | | [Example: Set Request Headers](#example-set-common-request-headers). | -## Migrating ServicePoint(Manager) usage +## Migrate ServicePoint(Manager) usage -Developers should be aware that `ServicePointManager` is a static class, meaning that any changes made to its properties will have a global effect on all newly created `ServicePoint` objects within the application. For example, modifying a property like `ConnectionLimit` or `Expect100Continue` will impact every new ServicePoint instance. +You should be aware that `ServicePointManager` is a static class, meaning that any changes made to its properties will have a global effect on all newly created `ServicePoint` objects within the application. For example, when you modify a property like `ConnectionLimit` or `Expect100Continue`, it impacts every new ServicePoint instance. > [!WARNING] > In modern .NET, `HttpClient` does not take into account any configurations set on `ServicePointManager`. -### Properties Mapping +### properties mapping | Old API | New API | Notes | -|---------|----------------------|-------| -| `CheckCertificateRevocationList` | . | See: [Example: Enabling CRL Check with SocketsHttpHandler](#example-check-certificate-revocation-list-with-socketshttphandler). | -| `DefaultConnectionLimit` | | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | -| `DnsRefreshTimeout` | No equivalent API | See: [Example: Enabling Dns Round Robin](#example-enabling-dns-round-robin). | -| `EnableDnsRoundRobin` | No equivalent API | See: [Example: Enabling Dns Round Robin](#example-enabling-dns-round-robin). | -| `EncryptionPolicy` | . | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | -| `Expect100Continue` | | See: [Example: Set Request Headers](#example-set-common-request-headers). | -| `MaxServicePointIdleTime` | | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | +|-----------------------------------------------|---------|-------| +| `CheckCertificateRevocationList` | . | [Example: Enabling CRL Check with SocketsHttpHandler](#example-check-certificate-revocation-list-with-socketshttphandler). | +| `DefaultConnectionLimit` | | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | +| `DnsRefreshTimeout` | No equivalent API | [Example: Enabling Dns Round Robin](#example-enable-dns-round-robin). | +| `EnableDnsRoundRobin` | No equivalent API | [Example: Enabling Dns Round Robin](#example-enable-dns-round-robin). | +| `EncryptionPolicy` | . | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | +| `Expect100Continue` | | [Example: Set Request Headers](#example-set-common-request-headers). | +| `MaxServicePointIdleTime` | | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | | `MaxServicePoints` | No equivalent API | `ServicePoint` is not part of `HttpClient`. | -| `ReusePort` | No direct equivalent API | See: [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | -| `SecurityProtocol` | . | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | +| `ReusePort` | No direct equivalent API | [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | +| `SecurityProtocol` | . | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | | `ServerCertificateValidationCallback` | . | Both of them are | -| `UseNagleAlgorithm` | No direct equivalent API | See: [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | +| `UseNagleAlgorithm` | No direct equivalent API | [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | > [!WARNING] > In modern .NET, the default values for the `UseNagleAlgorithm` and `Expect100Continue` properties are set to `false`. These values were `true` by default in .NET Framework. -### Method Mapping +### method mapping -| Old API | New API | Notes | -|---------|----------------------|-------| -| `FindServicePoint` | No equivalent API | No workaround | -| `SetTcpKeepAlive` | No direct equivalent API | See: [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | +| Old API | New API | Notes | +|-----------------------------------------------|-------------------|---------------| +| `FindServicePoint` | No equivalent API | No workaround | +| `SetTcpKeepAlive` | No direct equivalent API | [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | -### Properties Mapping +### properties mapping | Old API | New API | Notes | -|---------|----------------------|-------| +|----------------------------------------|---------|-------| | `Address` | `HttpRequestMessage.RequestUri` | This is request uri, this information can be found under `HttpRequestMessage`. | -| `BindIPEndPointDelegate` | No direct equivalent API | See: [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | -| `Certificate` | No direct equivalent API | This information can be fetched from `RemoteCertificateValidationCallback`. See: [Example: Fetch Certificate](#example-fetch-certificate). | -| `ClientCertificate` | No equivalent API | See: [Example: Enabling Mutual Authentication](#example-enabling-mutual-authentication). | +| `BindIPEndPointDelegate` | No direct equivalent API | [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | +| `Certificate` | No direct equivalent API | This information can be fetched from `RemoteCertificateValidationCallback`. [Example: Fetch Certificate](#example-fetch-certificate). | +| `ClientCertificate` | No equivalent API | [Example: Enabling Mutual Authentication](#example-enable-mutual-authentication). | | `ConnectionLeaseTimeout` | `SocketsHttpHandler.PooledConnectionLifetime` | Equivalent setting in | -| `ConnectionLimit` | | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | +| `ConnectionLimit` | | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | | `ConnectionName` | No equivalent API | No workaround | -| `CurrentConnections` | No equivalent API | See [Networking telemetry in .NET docs](https://learn.microsoft.com/dotnet/fundamentals/networking/telemetry/overview). | -| `Expect100Continue` | | See: [Example: Set Request Headers](#example-set-common-request-headers). | +| `CurrentConnections` | No equivalent API | See [Networking telemetry in .NET](../telemetry/overview.md). | +| `Expect100Continue` | | [Example: Set Request Headers](#example-set-common-request-headers). | | `IdleSince` | No equivalent API | No workaround | -| `MaxIdleTime` | | See: [Example: Setting SocketsHttpHandler Properties](#example-setting-socketshttphandler-properties). | -| `ProtocolVersion` | `HttpRequestMessage.Version` | See: [Example: Usage of HttpRequestMessage properties](#example-usage-of-httprequestmessage-properties). | -| `ReceiveBufferSize` | No direct equivalent API | See: [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | +| `MaxIdleTime` | | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | +| `ProtocolVersion` | `HttpRequestMessage.Version` | [Example: Usage of HttpRequestMessage properties](#example-usage-of-httprequestmessage-properties). | +| `ReceiveBufferSize` | No direct equivalent API | [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | | `SupportsPipelining` | No equivalent API | `HttpClient` doesn't support pipelining. | -| `UseNagleAlgorithm` | No direct equivalent API | See: [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | +| `UseNagleAlgorithm` | No direct equivalent API | [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | -### Method Mapping +### method mapping | Old API | New API | Notes | |---------|----------------------|-------| | `CloseConnectionGroup` | No equivalent | No workaround | -| `SetTcpKeepAlive` | No direct equivalent API | See: [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | +| `SetTcpKeepAlive` | No direct equivalent API | [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | -## Usage of HttpClient and HttpRequestMessage Properties +## Usage of HttpClient and HttpRequestMessage properties When working with HttpClient in .NET, you have access to a variety of properties that allow you to configure and customize HTTP requests and responses. Understanding these properties can help you make the most of HttpClient and ensure that your application communicates efficiently and securely with web services. @@ -205,7 +205,7 @@ using var response = await client.SendAsync(request); var protocolVersion = response.RequestMessage.Version; // Fetch `ProtocolVersion`. ``` -### Example: Fetch Redirected URI +### Example: Fetch redirected URI Here's an example of how to fetch redirected URI (Same as `HttpWebRequest.Address`): @@ -219,7 +219,7 @@ var redirectedUri = response.RequestMessage.RequestUri; The `ConnectCallback` property in `SocketsHttpHandler` allows developers to customize the process of establishing a TCP connection. This can be useful for scenarios where you need to control DNS resolution or apply specific socket options on the connection. By using `ConnectCallback`, you can intercept and modify the connection process before it is used by `HttpClient`. -### Example: Binding IP Address to Socket +### Example: Bind IP address to socket In the old approach using `HttpWebRequest`, you might have used custom logic to bind a specific IP address to a socket. Here's how you can achieve similar functionality using `HttpClient` and `ConnectCallback`: @@ -263,7 +263,7 @@ var client = new HttpClient(handler); using var response = await client.GetAsync(uri); ``` -### Example: Applying Specific Socket Options +### Example: Apply specific socket options If you need to apply specific socket options, such as enabling TCP keep-alive, you can use `ConnectCallback` to configure the socket before it is used by `HttpClient`. In fact, `ConnectCallback` is more flexible to configure socket options. @@ -316,7 +316,7 @@ var client = new HttpClient(handler); using var response = await client.GetAsync(uri); ``` -### Example: Enabling Dns Round Robin +### Example: Enable DNS round robin DNS Round Robin is a technique used to distribute network traffic across multiple servers by rotating through a list of IP addresses associated with a single domain name. This helps in load balancing and improving the availability of services. When using HttpClient, you can implement DNS Round Robin by manually handling the DNS resolution and rotating through the IP addresses using the ConnectCallback property of SocketsHttpHandler. @@ -342,7 +342,7 @@ You can find implementation of `DnsRoundRobinConnector` [here](https://raw.githu `DnsRoundRobinConnector` Usage: :::code source="../snippets/httpclient/Program.DnsRoundRobin.cs" id="DnsRoundRobinConnect"::: -### Example: Setting SocketsHttpHandler Properties +### Example: Set SocketsHttpHandler properties SocketsHttpHandler is a powerful and flexible handler in .NET that provides advanced configuration options for managing HTTP connections. By setting various properties of SocketsHttpHandler, you can fine-tune the behavior of your HTTP client to meet specific requirements, such as performance optimization, security enhancements, and custom connection handling. @@ -373,7 +373,7 @@ using var response = await client.GetAsync(uri); This functionality is specific to certain platforms and is somewhat outdated. If you need a workaround, you can refer to [this section of the code](https://github.com/dotnet/runtime/blob/171f1a73a9f0fa77464995bcb893a59b9b98bc3d/src/libraries/System.Net.Requests/src/System/Net/HttpWebRequest.cs#L1678-L1684). -## Usage of Certificate and TLS Related Properties in HttpClient +## Usage of Certificate and TLS-related properties in HttpClient When working with `HttpClient`, you may need to handle client certificates for various purposes, such as custom validation of server certificates or fetching the server certificate. `HttpClient` provides several properties and options to manage certificates effectively. @@ -404,7 +404,7 @@ var client = new HttpClient(handler); using var response = await client.GetAsync(uri); ``` -### Example: Fetch Certificate +### Example: Fetch certificate To fetch the certificate from the `RemoteCertificateValidationCallback` in `HttpClient`, you can use the `ServerCertificateCustomValidationCallback` property of `HttpClientHandler` or `SocketsHttpHandler.SslOptions`. This callback allows you to inspect the server's certificate during the SSL/TLS handshake. @@ -437,7 +437,7 @@ var client = new HttpClient(handler); using var response = await client.GetAsync("https://example.com"); ``` -### Example: Enabling Mutual Authentication +### Example: Enable mutual authentication Mutual authentication, also known as two-way SSL or client certificate authentication, is a security process in which both the client and the server authenticate each other. This ensures that both parties are who they claim to be, providing an additional layer of security for sensitive communications. In `HttpClient`, you can enable mutual authentication by configuring the `HttpClientHandler` or `SocketsHttpHandler` to include the client certificate and validate the server's certificate. @@ -475,11 +475,11 @@ using var response = await client.GetAsync(uri); Headers play a crucial role in HTTP communication, providing essential metadata about the request and response. When working with `HttpClient` in .NET, you can set and manage various header properties to control the behavior of your HTTP requests and responses. Understanding how to use these header properties effectively can help you ensure that your application communicates efficiently and securely with web services. -### Set Request Headers +### Set request headers Request headers are used to provide additional information to the server about the request being made. Common use cases include specifying the content type, setting authentication tokens, and adding custom headers. You can set request headers using the `DefaultRequestHeaders` property of `HttpClient` or the Headers property of `HttpRequestMessage`. -#### Example: Set Custom Request Headers +#### Example: Set custom request headers **Setting Default Custom Request Headers in HttpClient** @@ -495,10 +495,10 @@ var request = new HttpRequestMessage(HttpMethod.Get, uri); request.Headers.Add("Custom-Header", "value"); ``` -#### Example: Set Common Request Headers +#### Example: Set common request headers When working with `HttpRequestMessage` in .NET, setting common request headers is essential for providing additional information to the server about the request being made. These headers can include authentication tokens and more. Properly configuring these headers ensures that your HTTP requests are processed correctly by the server. -For a comprehensive list of common properties available in HttpRequestHeaders, you can refer to the [official documentation](https://learn.microsoft.com/dotnet/api/system.net.http.headers.httprequestheaders#properties). +For a comprehensive list of common properties available in , see [Properties](xref:System.Net.Http.Headers.HttpRequestHeaders#Properties). To set common request headers in `HttpRequestMessage`, you can use the `Headers` property of the `HttpRequestMessage` object. This property provides access to the `HttpRequestHeaders` collection, where you can add or modify headers as needed. @@ -520,7 +520,7 @@ var request = new HttpRequestMessage(HttpMethod.Get, uri); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "token"); ``` -### Example: Set Content Headers +### Example: Set content headers Content headers are used to provide additional information about the body of an HTTP request or response. When working with `HttpClient` in .NET, you can set content headers to specify the media type, encoding, and other metadata related to the content being sent or received. Properly configuring content headers ensures that the server and client can correctly interpret and process the content. @@ -554,10 +554,10 @@ And usage example of `TruncatedReadStream`: :::code source="../snippets/httpclient/Program.TruncatedReadStream.cs" id="TruncatedReadStreamUsage"::: -### Example: Apply CachePolicy Headers +### Example: Apply CachePolicy headers > [!WARNING] -> HttpClient does not have built-in logic to cache responses. There is no workaround other than implementing all the caching yourself. Simply setting the headers will not achieve caching. +> `HttpClient` does not have built-in logic to cache responses. There is no workaround other than implementing all the caching yourself. Simply setting the headers will not achieve caching. When migrating from `HttpWebRequest` to `HttpClient`, it's important to correctly handle cache-related headers such as `pragma` and `cache-control`. These headers control how responses are cached and retrieved, ensuring that your application behaves as expected in terms of performance and data freshness. @@ -582,7 +582,7 @@ You can find implementation of `AddCacheControlHeaders` [here](https://raw.githu `AddCacheControlHeaders` Usage: :::code source="../snippets/httpclient/Program.CacheControlHeaders.cs" id="CacheControlProgram"::: -## Usage of Buffering Properties +## Usage of buffering properties When migrating from HttpWebRequest to `HttpClient`, it's important to understand the differences in how these two APIs handle buffering. From 6673ac7e2c97471a11f776621049fca44f53e620 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 2 Oct 2024 08:43:43 -0700 Subject: [PATCH 13/15] Update package index with latest published versions (#42806) --- docs/azure/includes/dotnet-all.md | 16 ++++++++-------- docs/azure/includes/dotnet-new.md | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/azure/includes/dotnet-all.md b/docs/azure/includes/dotnet-all.md index 7ab3976fcaa71..d9a7b46846fe7 100644 --- a/docs/azure/includes/dotnet-all.md +++ b/docs/azure/includes/dotnet-all.md @@ -75,7 +75,7 @@ | Monitor Ingestion | NuGet [1.1.2](https://www.nuget.org/packages/Azure.Monitor.Ingestion/1.1.2) | [docs](/dotnet/api/overview/azure/Monitor.Ingestion-readme) | GitHub [1.1.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Ingestion_1.1.2/sdk/monitor/Azure.Monitor.Ingestion/) | | Monitor Query | NuGet [1.5.0](https://www.nuget.org/packages/Azure.Monitor.Query/1.5.0) | [docs](/dotnet/api/overview/azure/Monitor.Query-readme) | GitHub [1.5.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Query_1.5.0/sdk/monitor/Azure.Monitor.Query/) | | OpenAI Assistants | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.AI.OpenAI.Assistants/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/AI.OpenAI.Assistants-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.OpenAI.Assistants_1.0.0-beta.4/sdk/openai/Azure.AI.OpenAI.Assistants/) | -| OpenAI Inference | NuGet [2.0.0](https://www.nuget.org/packages/Azure.AI.OpenAI/2.0.0) | [docs](/dotnet/api/overview/azure/AI.OpenAI-readme) | GitHub [2.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.OpenAI_2.0.0/sdk/openai/Azure.AI.OpenAI/) | +| OpenAI Inference | NuGet [2.0.0](https://www.nuget.org/packages/Azure.AI.OpenAI/2.0.0)
NuGet [2.1.0-beta.1](https://www.nuget.org/packages/Azure.AI.OpenAI/2.1.0-beta.1) | [docs](/dotnet/api/overview/azure/AI.OpenAI-readme) | GitHub [2.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.OpenAI_2.0.0/sdk/openai/Azure.AI.OpenAI/)
GitHub [2.1.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.OpenAI_2.1.0-beta.1/sdk/openai/Azure.AI.OpenAI/) | | OpenTelemetry AspNetCore | NuGet [1.2.0](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.AspNetCore/1.2.0)
NuGet [1.3.0-beta.1](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.AspNetCore/1.3.0-beta.1) | [docs](/dotnet/api/overview/azure/Monitor.OpenTelemetry.AspNetCore-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.AspNetCore_1.2.0/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/)
GitHub [1.3.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.AspNetCore_1.3.0-beta.1/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/) | | OpenTelemetry Exporter | NuGet [1.3.0](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.Exporter/1.3.0)
NuGet [1.4.0-beta.1](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.Exporter/1.4.0-beta.1) | [docs](/dotnet/api/overview/azure/Monitor.OpenTelemetry.Exporter-readme) | GitHub [1.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.Exporter_1.3.0/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/)
GitHub [1.4.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.Exporter_1.4.0-beta.1/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/) | | Personalizer | NuGet [2.0.0-beta.2](https://www.nuget.org/packages/Azure.AI.Personalizer/2.0.0-beta.2) | [docs](/dotnet/api/overview/azure/AI.Personalizer-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [2.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Personalizer_2.0.0-beta.2/sdk/personalizer/Azure.AI.Personalizer/) | @@ -378,7 +378,7 @@ | Common | NuGet [2.2.1](https://www.nuget.org/packages/Microsoft.Azure.Common/2.2.1) | | | | Common - Dependencies | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Common.Dependencies/1.0.0) | | | | Computer Vision | NuGet [7.0.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.ComputerVision/7.0.1) | | GitHub [7.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Vision.ComputerVision_6.0.0-preview.1/sdk/cognitiveservices/Vision.ComputerVision) | -| Cosmos DB | NuGet [3.42.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.42.0)
NuGet [3.44.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.44.0-preview.1) | [docs](/dotnet/api/overview/azure/cosmosdb) | GitHub [3.42.0](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/3.12.0/Microsoft.Azure.Cosmos) | +| Cosmos DB | NuGet [3.42.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.42.0)
NuGet [3.44.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.44.0-preview.1) | [docs](https://learn.microsoft.com/dotnet/api/overview/azure/cosmosdb) | GitHub [3.42.0](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/3.12.0/Microsoft.Azure.Cosmos) | | Custom Image Search | NuGet [2.1.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.BingCustomImageSearch/2.1.0-preview.1) | | GitHub [2.1.0-preview.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Search.BingCustomImageSearch_2.1.0-preview.1/sdk/cognitiveservices/Search.BingCustomImageSearch) | | Custom Image Search | NuGet [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.CustomImageSearch/2.0.0) | | | | Custom Search | NuGet [2.1.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.BingCustomSearch/2.1.0-preview.1) | | GitHub [2.1.0-preview.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Search.BingCustomSearch_2.1.0-preview.1/sdk/cognitiveservices/Search.BingCustomSearch) | @@ -394,15 +394,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 Plug and Play - Devices Client | NuGet [1.42.3](https://www.nuget.org/packages/Microsoft.Azure.Devices.Client/1.42.3)
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) | @@ -430,7 +430,7 @@ | News Search | NuGet [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Search.NewsSearch/2.0.0) | | | | 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) | -| 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/) | @@ -441,7 +441,7 @@ | 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.1-alpha.1](https://www.nuget.org/packages/Microsoft.Azure.DataLake.Store/2.0.1-alpha.1) | [docs](/dotnet/api/overview/azure/data-lake-store) | GitHub [2.0.1-alpha.1](https://github.com/Azure/azure-data-lake-store-net/tree/1.2.3-alpha) | +| Storage - Files Data Lake | NuGet [2.0.1-alpha.1](https://www.nuget.org/packages/Microsoft.Azure.DataLake.Store/2.0.1-alpha.1) | [docs](https://learn.microsoft.com/dotnet/api/overview/azure/data-lake-store) | GitHub [2.0.1-alpha.1](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) | | | | 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) | @@ -466,7 +466,7 @@ | Functions extension for Azure SQL and SQL Server | NuGet [3.0.534](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Sql/3.0.534)
NuGet [3.1.169-preview](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Sql/3.1.169-preview) | | | | Functions extension for Cosmos DB | NuGet [4.8.1](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.CosmosDB/4.8.1) | | GitHub [4.8.1](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/cosmos-v3.0.7/src/WebJobs.Extensions.CosmosDB) | | Functions extension for DocumentDB | NuGet [1.3.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DocumentDB/1.3.0) | | GitHub [1.3.0](https://github.com/Azure/azure-webjobs-sdk-extensions) | -| Functions extension for Durable Task Framework | NuGet [2.13.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/2.13.0)
NuGet [3.0.0-rc.2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/3.0.0-rc.2) | [docs](/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.2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/3.0.0-rc.2) | [docs](https://learn.microsoft.com/dotnet/api/overview/azure/functions) | GitHub [2.13.0](https://github.com/Azure/azure-functions-durable-extension/tree/v2.2.2/src/WebJobs.Extensions.DurableTask) | | 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.2](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask/1.2.0-rc.2) | | | | 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 ecd0a367233a2..4e61df4c9653b 100644 --- a/docs/azure/includes/dotnet-new.md +++ b/docs/azure/includes/dotnet-new.md @@ -76,7 +76,7 @@ | Monitor Ingestion | NuGet [1.1.2](https://www.nuget.org/packages/Azure.Monitor.Ingestion/1.1.2) | [docs](/dotnet/api/overview/azure/Monitor.Ingestion-readme) | GitHub [1.1.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Ingestion_1.1.2/sdk/monitor/Azure.Monitor.Ingestion/) | | Monitor Query | NuGet [1.5.0](https://www.nuget.org/packages/Azure.Monitor.Query/1.5.0) | [docs](/dotnet/api/overview/azure/Monitor.Query-readme) | GitHub [1.5.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Query_1.5.0/sdk/monitor/Azure.Monitor.Query/) | | OpenAI Assistants | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.AI.OpenAI.Assistants/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/AI.OpenAI.Assistants-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.OpenAI.Assistants_1.0.0-beta.4/sdk/openai/Azure.AI.OpenAI.Assistants/) | -| OpenAI Inference | NuGet [2.0.0](https://www.nuget.org/packages/Azure.AI.OpenAI/2.0.0) | [docs](/dotnet/api/overview/azure/AI.OpenAI-readme) | GitHub [2.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.OpenAI_2.0.0/sdk/openai/Azure.AI.OpenAI/) | +| OpenAI Inference | NuGet [2.0.0](https://www.nuget.org/packages/Azure.AI.OpenAI/2.0.0)
NuGet [2.1.0-beta.1](https://www.nuget.org/packages/Azure.AI.OpenAI/2.1.0-beta.1) | [docs](/dotnet/api/overview/azure/AI.OpenAI-readme) | GitHub [2.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.OpenAI_2.0.0/sdk/openai/Azure.AI.OpenAI/)
GitHub [2.1.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.OpenAI_2.1.0-beta.1/sdk/openai/Azure.AI.OpenAI/) | | OpenTelemetry AspNetCore | NuGet [1.2.0](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.AspNetCore/1.2.0)
NuGet [1.3.0-beta.1](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.AspNetCore/1.3.0-beta.1) | [docs](/dotnet/api/overview/azure/Monitor.OpenTelemetry.AspNetCore-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.AspNetCore_1.2.0/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/)
GitHub [1.3.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.AspNetCore_1.3.0-beta.1/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/) | | OpenTelemetry Exporter | NuGet [1.3.0](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.Exporter/1.3.0)
NuGet [1.4.0-beta.1](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.Exporter/1.4.0-beta.1) | [docs](/dotnet/api/overview/azure/Monitor.OpenTelemetry.Exporter-readme) | GitHub [1.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.Exporter_1.3.0/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/)
GitHub [1.4.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.Exporter_1.4.0-beta.1/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/) | | OpenTelemetry LiveMetrics | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.LiveMetrics/1.0.0-beta.3) | [docs](/dotnet/api/overview/azure/Monitor.OpenTelemetry.LiveMetrics-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.LiveMetrics_1.0.0-beta.3/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/) | From 3ce2e97b8f06a0d44aec4e4a16c89e310337febb Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Wed, 2 Oct 2024 13:13:14 -0400 Subject: [PATCH 14/15] Clarify extension method access (#42808) * Clarify extension method declaration Extension methods can only be declared in top-level type. They can't be declared in nested types. * quick formatting fix * fix a snippet issue * one more time --- ...ment-and-call-a-custom-extension-method.md | 51 +++++----- .../Program.cs | 25 +++++ ...-and-call-a-custom-extension-method.csproj | 10 ++ .../cs/extensionmethods.cs | 92 ++++++------------- .../cs/extensionmethods.csproj | 2 +- 5 files changed, 86 insertions(+), 94 deletions(-) create mode 100644 docs/csharp/programming-guide/classes-and-structs/snippets/how-to-implement-and-call-a-custom-extension-method/Program.cs create mode 100644 docs/csharp/programming-guide/classes-and-structs/snippets/how-to-implement-and-call-a-custom-extension-method/how-to-implement-and-call-a-custom-extension-method.csproj diff --git a/docs/csharp/programming-guide/classes-and-structs/how-to-implement-and-call-a-custom-extension-method.md b/docs/csharp/programming-guide/classes-and-structs/how-to-implement-and-call-a-custom-extension-method.md index 78a214a868496..837a1a2376c4a 100644 --- a/docs/csharp/programming-guide/classes-and-structs/how-to-implement-and-call-a-custom-extension-method.md +++ b/docs/csharp/programming-guide/classes-and-structs/how-to-implement-and-call-a-custom-extension-method.md @@ -1,42 +1,33 @@ --- title: "How to implement and call a custom extension method" description: Learn how to implement extension methods for any .NET type. Client code can use your methods by adding a reference to a DLL and adding a using directive. -ms.date: 07/20/2015 +ms.date: 10/02/2024 helpviewer_keywords: - "extension methods [C#], implementing and calling" ms.topic: how-to -ms.assetid: 7dab2a56-cf8e-4a47-a444-fe610a02772a --- # How to implement and call a custom extension method (C# Programming Guide) -This topic shows how to implement your own extension methods for any .NET type. Client code can use your extension methods by adding a reference to the DLL that contains them, and adding a [using](../../language-reference/keywords/using-directive.md) directive that specifies the namespace in which the extension methods are defined. - -## To define and call the extension method - -1. Define a static [class](./static-classes-and-static-class-members.md) to contain the extension method. - - The class must be visible to client code. For more information about accessibility rules, see [Access Modifiers](./access-modifiers.md). - -2. Implement the extension method as a static method with at least the same visibility as the containing class. - -3. The first parameter of the method specifies the type that the method operates on; it must be preceded with the [this](../../language-reference/keywords/this.md) modifier. - -4. In the calling code, add a `using` directive to specify the [namespace](../../language-reference/keywords/namespace.md) that contains the extension method class. - -5. Call the methods as if they were instance methods on the type. - - Note that the first parameter is not specified by calling code because it represents the type on which the operator is being applied, and the compiler already knows the type of your object. You only have to provide arguments for parameters 2 through `n`. - -## Example - - The following example implements an extension method named `WordCount` in the `CustomExtensions.StringExtension` class. The method operates on the class, which is specified as the first method parameter. The `CustomExtensions` namespace is imported into the application namespace, and the method is called inside the `Main` method. - - [!code-csharp[csProgGuideExtensionMethods#1](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideExtensionMethods/cs/extensionmethods.cs#1)] - -## .NET Security - - Extension methods present no specific security vulnerabilities. They can never be used to impersonate existing methods on a type, because all name collisions are resolved in favor of the instance or static method defined by the type itself. Extension methods cannot access any private data in the extended class. - +This article shows how to implement your own extension methods for any .NET type. Client code can use your extension methods. Client projects must reference the assembly that contains them. Client projects must add a [using](../../language-reference/keywords/using-directive.md) directive that specifies the namespace in which the extension methods are defined. + +To define and call the extension method: + +1. Define a static [class](./static-classes-and-static-class-members.md) to contain the extension method. The class can't be nested inside another type and must be visible to client code. For more information about accessibility rules, see [Access Modifiers](./access-modifiers.md). +1. Implement the extension method as a static method with at least the same visibility as the containing class. +1. The first parameter of the method specifies the type that the method operates on; it must be preceded with the [this](../../language-reference/keywords/this.md) modifier. +1. In the calling code, add a `using` directive to specify the [namespace](../../language-reference/keywords/namespace.md) that contains the extension method class. +1. Call the methods as instance methods on the type. + +> [!NOTE] +> +> The first parameter is not specified by calling code because it represents the type on which the operator is being applied, and the compiler already knows the type of your object. You only have to provide arguments for parameters 2 through `n`. + +The following example implements an extension method named `WordCount` in the `CustomExtensions.StringExtension` class. The method operates on the class, which is specified as the first method parameter. The `CustomExtensions` namespace is imported into the application namespace, and the method is called inside the `Main` method. + +:::code language="csharp" source="./snippets/how-to-implement-and-call-a-custom-extension-method/Program.cs" ::: + +Overload resolution prefers instance or static method defined by the type itself to extension methods. Extension methods can't access any private data in the extended class. + ## See also - [Extension Methods](./extension-methods.md) diff --git a/docs/csharp/programming-guide/classes-and-structs/snippets/how-to-implement-and-call-a-custom-extension-method/Program.cs b/docs/csharp/programming-guide/classes-and-structs/snippets/how-to-implement-and-call-a-custom-extension-method/Program.cs new file mode 100644 index 0000000000000..000548409e47b --- /dev/null +++ b/docs/csharp/programming-guide/classes-and-structs/snippets/how-to-implement-and-call-a-custom-extension-method/Program.cs @@ -0,0 +1,25 @@ +using CustomExtensions; + +string s = "The quick brown fox jumped over the lazy dog."; +// Call the method as if it were an +// instance method on the type. Note that the first +// parameter is not specified by the calling code. +int i = s.WordCount(); +System.Console.WriteLine("Word count of s is {0}", i); + + +namespace CustomExtensions +{ + // Extension methods must be defined in a static class. + public static class StringExtension + { + // This is the extension method. + // The first parameter takes the "this" modifier + // and specifies the type for which the method is defined. + public static int WordCount(this string str) + { + return str.Split(new char[] {' ', '.','?'}, StringSplitOptions.RemoveEmptyEntries).Length; + } + } +} + diff --git a/docs/csharp/programming-guide/classes-and-structs/snippets/how-to-implement-and-call-a-custom-extension-method/how-to-implement-and-call-a-custom-extension-method.csproj b/docs/csharp/programming-guide/classes-and-structs/snippets/how-to-implement-and-call-a-custom-extension-method/how-to-implement-and-call-a-custom-extension-method.csproj new file mode 100644 index 0000000000000..fd4bd08da2987 --- /dev/null +++ b/docs/csharp/programming-guide/classes-and-structs/snippets/how-to-implement-and-call-a-custom-extension-method/how-to-implement-and-call-a-custom-extension-method.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideExtensionMethods/cs/extensionmethods.cs b/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideExtensionMethods/cs/extensionmethods.cs index d7a7bf5e4f11b..05e59f4a32c11 100644 --- a/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideExtensionMethods/cs/extensionmethods.cs +++ b/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideExtensionMethods/cs/extensionmethods.cs @@ -1,38 +1,4 @@ -// -namespace CustomExtensions -{ - // Extension methods must be defined in a static class. - public static class StringExtension - { - // This is the extension method. - // The first parameter takes the "this" modifier - // and specifies the type for which the method is defined. - public static int WordCount(this string str) - { - return str.Split(new char[] {' ', '.','?'}, StringSplitOptions.RemoveEmptyEntries).Length; - } - } -} -namespace Extension_Methods_Simple -{ - // Import the extension method namespace. - using CustomExtensions; - class Program - { - static void Main(string[] args) - { - string s = "The quick brown fox jumped over the lazy dog."; - // Call the method as if it were an - // instance method on the type. Note that the first - // parameter is not specified by the calling code. - int i = s.WordCount(); - System.Console.WriteLine("Word count of s is {0}", i); - } - } -} -// - -namespace Extension2 +namespace Extension2 { // @@ -42,40 +8,40 @@ namespace EnumExtension { // Define an extension method in a non-nested static class. public static class Extensions - { - public static Grades minPassing = Grades.D; - public static bool Passing(this Grades grade) { - return grade >= minPassing; + public static Grades minPassing = Grades.D; + public static bool Passing(this Grades grade) + { + return grade >= minPassing; + } } - } - public enum Grades { F = 0, D=1, C=2, B=3, A=4 }; - class Program - { - static void Main(string[] args) + public enum Grades { F = 0, D=1, C=2, B=3, A=4 }; + class Program { - Grades g1 = Grades.D; - Grades g2 = Grades.F; - Console.WriteLine("First {0} a passing grade.", g1.Passing() ? "is" : "is not"); - Console.WriteLine("Second {0} a passing grade.", g2.Passing() ? "is" : "is not"); - - Extensions.minPassing = Grades.C; - Console.WriteLine("\r\nRaising the bar!\r\n"); - Console.WriteLine("First {0} a passing grade.", g1.Passing() ? "is" : "is not"); - Console.WriteLine("Second {0} a passing grade.", g2.Passing() ? "is" : "is not"); - } - } - } -/* Output: - First is a passing grade. - Second is not a passing grade. + static void Main(string[] args) + { + Grades g1 = Grades.D; + Grades g2 = Grades.F; + Console.WriteLine("First {0} a passing grade.", g1.Passing() ? "is" : "is not"); + Console.WriteLine("Second {0} a passing grade.", g2.Passing() ? "is" : "is not"); + + Extensions.minPassing = Grades.C; + Console.WriteLine("\r\nRaising the bar!\r\n"); + Console.WriteLine("First {0} a passing grade.", g1.Passing() ? "is" : "is not"); + Console.WriteLine("Second {0} a passing grade.", g2.Passing() ? "is" : "is not"); + } + /* Output: + First is a passing grade. + Second is not a passing grade. - Raising the bar! + Raising the bar! - First is not a passing grade. - Second is not a passing grade. - */ + First is not a passing grade. + Second is not a passing grade. + */ + } + } // } //namespace Extension2 diff --git a/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideExtensionMethods/cs/extensionmethods.csproj b/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideExtensionMethods/cs/extensionmethods.csproj index b58af6e9c2578..226a169c25be2 100644 --- a/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideExtensionMethods/cs/extensionmethods.csproj +++ b/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideExtensionMethods/cs/extensionmethods.csproj @@ -6,7 +6,7 @@ enable enable ExtensionMethods - Extension_Methods_Simple.Program + Extension2.EnumExtension.Program From 8a1b3207557ce20a8353fa1a5d44ead84f486848 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:59:02 -0700 Subject: [PATCH 15/15] Breaking change - APIs removed (#42809) --- docs/core/compatibility/9.0.md | 7 +-- docs/core/compatibility/jit/9.0/sve-apis.md | 47 +++++++++++++++++++++ docs/core/compatibility/toc.yml | 4 ++ 3 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 docs/core/compatibility/jit/9.0/sve-apis.md diff --git a/docs/core/compatibility/9.0.md b/docs/core/compatibility/9.0.md index e649796818b88..7b52fe2f7c208 100644 --- a/docs/core/compatibility/9.0.md +++ b/docs/core/compatibility/9.0.md @@ -61,9 +61,10 @@ If you're migrating an app to .NET 9, the breaking changes listed here might aff ## JIT compiler -| Title | Type of change | Introduced version | -|----------------------------------------------------------------------------------|-------------------|--------------------| -| [Floating point to integer conversions are saturating](jit/9.0/fp-to-integer.md) | Behavioral change | Preview 4 | +| Title | Type of change | Introduced version | +|----------------------------------------------------------------------------------|---------------------|--------------------| +| [Floating point to integer conversions are saturating](jit/9.0/fp-to-integer.md) | Behavioral change | Preview 4 | +| [Some SVE APIs removed](jit/9.0/sve-apis.md) | Source incompatible | RC 2 | ## Networking diff --git a/docs/core/compatibility/jit/9.0/sve-apis.md b/docs/core/compatibility/jit/9.0/sve-apis.md new file mode 100644 index 0000000000000..6e68ff5fcfa77 --- /dev/null +++ b/docs/core/compatibility/jit/9.0/sve-apis.md @@ -0,0 +1,47 @@ +--- +title: "Breaking change: Some SVE APIs removed" +description: Learn about the breaking change in .NET 9 where some SVE APIs that take 32-bit address have been removed. +ms.date: 10/02/2024 +--- +# Some SVE APIs removed + +Several APIs that take a 32-bit address as an input parameter have been removed because of lack of testing with such addresses. These APIs might be re-enabled in the future when relevant test coverage is added. + +## Previous behavior + +In previous versions, these APIs were available. + +## New behavior + +Starting in .NET 9, these APIs aren't available. + +## Version introduced + +.NET 9 RC 2 + +## Type of breaking change + +This change can affect [source compatibility](../../categories.md#source-compatibility). + +## Reason for change + +The affected APIs were removed because of lack of testing of 32-bit addresses. The affected APIs might be re-enabled in the future when relevant test coverage is added. + +## Recommended action + +Stop using the removed APIs and instead use the overloads that take 64-bit addresses as input. + +## Affected APIs + +- +- +- +- +- +- +- +- +- +- +- +- diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index aba5e1bba1ae5..4f2b75d9a4586 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -60,6 +60,8 @@ items: items: - name: Floating point to integer conversions are saturating href: jit/9.0/fp-to-integer.md + - name: Some SVE APIs removed + href: jit/9.0/sve-apis.md - name: Networking items: - name: HttpClientFactory logging redacts header values by default @@ -1636,6 +1638,8 @@ items: items: - name: Floating point to integer conversions are saturating href: jit/9.0/fp-to-integer.md + - name: Some SVE APIs removed + href: jit/9.0/sve-apis.md - name: .NET 6 items: - name: Call argument coercion