diff --git a/.github/workflows/check-for-build-warnings.yml b/.github/workflows/check-for-build-warnings.yml
index e6b9c42617d0a..80045e68b81e8 100644
--- a/.github/workflows/check-for-build-warnings.yml
+++ b/.github/workflows/check-for-build-warnings.yml
@@ -16,7 +16,7 @@ jobs:
pull-requests: write
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
diff --git a/.github/workflows/cleanrepo-orphaned-articles.yml b/.github/workflows/cleanrepo-orphaned-articles.yml
index 554689691bb16..9f4beb6cef8db 100644
--- a/.github/workflows/cleanrepo-orphaned-articles.yml
+++ b/.github/workflows/cleanrepo-orphaned-articles.yml
@@ -17,11 +17,11 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
# Call clean repo
- name: Clean repo
diff --git a/.github/workflows/cleanrepo-orphaned-images.yml b/.github/workflows/cleanrepo-orphaned-images.yml
index e04b327055037..5c5ac641c3897 100644
--- a/.github/workflows/cleanrepo-orphaned-images.yml
+++ b/.github/workflows/cleanrepo-orphaned-images.yml
@@ -17,11 +17,11 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
# Call clean repo
- name: Clean repo
diff --git a/.github/workflows/cleanrepo-orphaned-includes.yml b/.github/workflows/cleanrepo-orphaned-includes.yml
index 31d8689d8a526..c89775f643f02 100644
--- a/.github/workflows/cleanrepo-orphaned-includes.yml
+++ b/.github/workflows/cleanrepo-orphaned-includes.yml
@@ -17,11 +17,11 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
# Call clean repo
- name: Clean repo
diff --git a/.github/workflows/cleanrepo-orphaned-snippets.yml b/.github/workflows/cleanrepo-orphaned-snippets.yml
index bb642c6dc2009..34221905ecac4 100644
--- a/.github/workflows/cleanrepo-orphaned-snippets.yml
+++ b/.github/workflows/cleanrepo-orphaned-snippets.yml
@@ -17,11 +17,11 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
# Call clean repo
- name: Clean repo
diff --git a/.github/workflows/cleanrepo-redirect-hops.yml b/.github/workflows/cleanrepo-redirect-hops.yml
index 931fe9ea87e61..55c202f8fbbec 100644
--- a/.github/workflows/cleanrepo-redirect-hops.yml
+++ b/.github/workflows/cleanrepo-redirect-hops.yml
@@ -17,11 +17,11 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
# Call clean repo
- name: Clean repo
diff --git a/.github/workflows/cleanrepo-relative-links.yml b/.github/workflows/cleanrepo-relative-links.yml
index 24526537863a4..242e3febffab6 100644
--- a/.github/workflows/cleanrepo-relative-links.yml
+++ b/.github/workflows/cleanrepo-relative-links.yml
@@ -17,11 +17,11 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
# Call clean repo
- name: Clean repo
diff --git a/.github/workflows/cleanrepo-replace-redirects.yml b/.github/workflows/cleanrepo-replace-redirects.yml
index ff26a53c4fa52..3c8f3ffbb0b16 100644
--- a/.github/workflows/cleanrepo-replace-redirects.yml
+++ b/.github/workflows/cleanrepo-replace-redirects.yml
@@ -17,11 +17,11 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
# Call clean repo
- name: Clean repo
diff --git a/.github/workflows/dependabot-bot.yml b/.github/workflows/dependabot-bot.yml
index 83f33ee238bbd..40b3efae238f2 100644
--- a/.github/workflows/dependabot-bot.yml
+++ b/.github/workflows/dependabot-bot.yml
@@ -26,11 +26,11 @@ jobs:
# Checkout the repo into the workspace within the VM
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
# - name: Setup .NET
# uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0
# with:
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
index 7d526cec230fa..f172bf1491730 100644
--- a/.github/workflows/dependency-review.yml
+++ b/.github/workflows/dependency-review.yml
@@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- name: 'Checkout Repository'
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: 'Dependency Review'
uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2
diff --git a/.github/workflows/do-not-merge-label-check.yml b/.github/workflows/do-not-merge-label-check.yml
index 1e626a6b73b0b..2c7a69d2b8d81 100644
--- a/.github/workflows/do-not-merge-label-check.yml
+++ b/.github/workflows/do-not-merge-label-check.yml
@@ -22,7 +22,7 @@ jobs:
- 'DO NOT MERGE'
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
diff --git a/.github/workflows/docs-verifier.yml b/.github/workflows/docs-verifier.yml
index 98626918400ef..5c4dc10587d05 100644
--- a/.github/workflows/docs-verifier.yml
+++ b/.github/workflows/docs-verifier.yml
@@ -14,12 +14,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- name: Checkout the repository
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Validate
uses: dotnet/docs-actions/actions/docs-verifier@5e8bcc78465d45a7544bba56509a1a69922b6a5a # main
diff --git a/.github/workflows/live-protection.yml b/.github/workflows/live-protection.yml
index c308b2f6c26e3..30fd02dee8f3b 100644
--- a/.github/workflows/live-protection.yml
+++ b/.github/workflows/live-protection.yml
@@ -11,7 +11,7 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml
index fc3a3a72d5681..3f6fb6a00de93 100644
--- a/.github/workflows/markdownlint.yml
+++ b/.github/workflows/markdownlint.yml
@@ -22,11 +22,11 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: DavidAnson/markdownlint-cli2-action@30a0e04f1870d58f8d717450cc6134995f993c63 # v21.0.0
with:
config: ".markdownlint-cli2.jsonc"
diff --git a/.github/workflows/profanity-filter.yml b/.github/workflows/profanity-filter.yml
index c839a0e00ee05..5ddd5e79ecc5a 100644
--- a/.github/workflows/profanity-filter.yml
+++ b/.github/workflows/profanity-filter.yml
@@ -19,7 +19,7 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
diff --git a/.github/workflows/quest-bulk.yml b/.github/workflows/quest-bulk.yml
index 6fd60faafb767..e38bd2abae504 100644
--- a/.github/workflows/quest-bulk.yml
+++ b/.github/workflows/quest-bulk.yml
@@ -28,7 +28,7 @@ jobs:
if: ${{ github.repository_owner == 'dotnet' }}
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
diff --git a/.github/workflows/quest.yml b/.github/workflows/quest.yml
index e30dbc5b9390a..17476902c55dc 100644
--- a/.github/workflows/quest.yml
+++ b/.github/workflows/quest.yml
@@ -29,7 +29,7 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml
index 07d4125ca8fd6..a9a8bd19b2920 100644
--- a/.github/workflows/scorecards.yml
+++ b/.github/workflows/scorecards.yml
@@ -31,12 +31,12 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- name: "Checkout code"
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
@@ -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@fdbfb4d2750291e159f0156def62b853c2798ca2 # v3.29.5
+ uses: github/codeql-action/upload-sarif@fe4161a26a8629af62121b670040955b330f9af2 # v3.29.5
with:
sarif_file: results.sarif
diff --git a/.github/workflows/snippets5000.yml b/.github/workflows/snippets5000.yml
index 6905ea4393cf2..81f7e2b24b264 100644
--- a/.github/workflows/snippets5000.yml
+++ b/.github/workflows/snippets5000.yml
@@ -31,12 +31,12 @@ jobs:
steps:
# Checkout the repository for the PR
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- name: Checkout repository
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #@v6.0.0
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #@v6.0.1
# Get the latest preview SDK (or sdk not installed by the runner)
- name: Setup .NET
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index 423d270005119..b412cbcda2373 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -16,11 +16,11 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- - uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008
+ - uses: actions/stale@997185467fa4f803885201cee163a9f38240193d
with:
start-date: '2022-03-01T00:00:00Z' # ISO 8601 or RFC 2822
repo-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/version-sweep.yml b/.github/workflows/version-sweep.yml
index ead1b08fdc392..e48d31fc35ada 100644
--- a/.github/workflows/version-sweep.yml
+++ b/.github/workflows/version-sweep.yml
@@ -34,7 +34,7 @@ jobs:
# Start the .NET version updater action
# A composite of the .NET Version Sweeper and the .NET Upgrade Assistant
- name: Harden Runner
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
+ uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
diff --git a/.openpublishing.redirection.core.json b/.openpublishing.redirection.core.json
index d72d8c27a8c73..bfaf313158f1a 100644
--- a/.openpublishing.redirection.core.json
+++ b/.openpublishing.redirection.core.json
@@ -1227,6 +1227,10 @@
"redirect_url": "/dotnet/core/testing/unit-testing-platform-extensions-vstest-bridge#runsettings-support",
"redirect_document_id": true
},
+ {
+ "source_path_from_root": "/docs/core/testing/unit-testing-with-copilot.md",
+ "redirect_url": "/visualstudio/ide/copilot-chat-context#slash-commands"
+ },
{
"source_path_from_root": "/docs/core/tools/cli-msbuild-architecture.md",
"redirect_url": "/dotnet/core/tools/dotnet-migrate"
diff --git a/docs/ai/evaluation/snippets/evaluate-with-reporting/TestAIWithReporting.csproj b/docs/ai/evaluation/snippets/evaluate-with-reporting/TestAIWithReporting.csproj
index 283a6de1126c2..779b9569dec22 100644
--- a/docs/ai/evaluation/snippets/evaluate-with-reporting/TestAIWithReporting.csproj
+++ b/docs/ai/evaluation/snippets/evaluate-with-reporting/TestAIWithReporting.csproj
@@ -10,8 +10,8 @@
-
-
+
+
diff --git a/docs/ai/quickstarts/snippets/chat-with-data/azure-openai/VectorDataAI.csproj b/docs/ai/quickstarts/snippets/chat-with-data/azure-openai/VectorDataAI.csproj
index 1826987581fbf..61d485ed813e9 100644
--- a/docs/ai/quickstarts/snippets/chat-with-data/azure-openai/VectorDataAI.csproj
+++ b/docs/ai/quickstarts/snippets/chat-with-data/azure-openai/VectorDataAI.csproj
@@ -10,10 +10,10 @@
-
+
-
-
+
+
diff --git a/docs/ai/quickstarts/snippets/mcp-server/SampleMcpServer.csproj b/docs/ai/quickstarts/snippets/mcp-server/SampleMcpServer.csproj
index 6b697d4b7a21e..26044b768eb55 100644
--- a/docs/ai/quickstarts/snippets/mcp-server/SampleMcpServer.csproj
+++ b/docs/ai/quickstarts/snippets/mcp-server/SampleMcpServer.csproj
@@ -33,7 +33,7 @@
-
+
diff --git a/docs/ai/quickstarts/snippets/structured-output/SOChat.csproj b/docs/ai/quickstarts/snippets/structured-output/SOChat.csproj
index 947d6ea1aed68..9bb6b764a9dbd 100644
--- a/docs/ai/quickstarts/snippets/structured-output/SOChat.csproj
+++ b/docs/ai/quickstarts/snippets/structured-output/SOChat.csproj
@@ -10,8 +10,8 @@
-
-
+
+
diff --git a/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.CacheResponses/ConsoleAI.CacheResponses.csproj b/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.CacheResponses/ConsoleAI.CacheResponses.csproj
index 1d41826d30183..971bf45c23f8b 100644
--- a/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.CacheResponses/ConsoleAI.CacheResponses.csproj
+++ b/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.CacheResponses/ConsoleAI.CacheResponses.csproj
@@ -8,8 +8,8 @@
-
-
+
+
diff --git a/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.GetStreamingResponseAsync/ConsoleAI.GetStreamingResponseAsync.csproj b/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.GetStreamingResponseAsync/ConsoleAI.GetStreamingResponseAsync.csproj
index 7e663bbd6775f..f0a40345ab8a2 100644
--- a/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.GetStreamingResponseAsync/ConsoleAI.GetStreamingResponseAsync.csproj
+++ b/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.GetStreamingResponseAsync/ConsoleAI.GetStreamingResponseAsync.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.UseTelemetry/ConsoleAI.UseTelemetry.csproj b/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.UseTelemetry/ConsoleAI.UseTelemetry.csproj
index 8da12b0015d0b..9b613b2562243 100644
--- a/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.UseTelemetry/ConsoleAI.UseTelemetry.csproj
+++ b/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.UseTelemetry/ConsoleAI.UseTelemetry.csproj
@@ -8,8 +8,8 @@
-
-
+
+
diff --git a/docs/azure/includes/dotnet-all.md b/docs/azure/includes/dotnet-all.md
index 4af77a486805f..db66f88482541 100644
--- a/docs/azure/includes/dotnet-all.md
+++ b/docs/azure/includes/dotnet-all.md
@@ -544,7 +544,7 @@
| Functions extension for Application Insights | NuGet [1.0.0-preview4](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.ApplicationInsights/1.0.0-preview4) | | |
| Functions extension for Azure Mobile Apps | NuGet [3.0.0-beta8](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.MobileApps/3.0.0-beta8) | | GitHub [3.0.0-beta8](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/v3.0.0-beta8/src/WebJobs.Extensions.MobileApps) |
| Functions extension for Azure SQL and SQL Server | NuGet [3.1.527](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Sql/3.1.527) | | |
-| Functions extension for Cosmos DB | NuGet [4.11.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.CosmosDB/4.11.0)
NuGet [4.12.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.CosmosDB/4.12.0-preview.1) | | GitHub [4.11.0](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/cosmos-v3.0.7/src/WebJobs.Extensions.CosmosDB) |
+| Functions extension for Cosmos DB | NuGet [4.11.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.CosmosDB/4.11.0)
NuGet [4.13.0-preview.1](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.CosmosDB/4.13.0-preview.1) | | GitHub [4.11.0](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/cosmos-v3.0.7/src/WebJobs.Extensions.CosmosDB) |
| Functions extension for DocumentDB | NuGet [1.3.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DocumentDB/1.3.0) | | GitHub [1.3.0](https://github.com/Azure/azure-webjobs-sdk-extensions) |
| Functions extension for Durable Task Framework | NuGet [3.8.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/3.8.0) | [docs](/dotnet/api/overview/azure/functions) | GitHub [3.8.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.10.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask/1.10.0) | | |
diff --git a/docs/azure/migration/appmod/coding-agent-support.md b/docs/azure/migration/appmod/coding-agent-support.md
index 166a8dc5f3032..0d2ffa1d3b301 100644
--- a/docs/azure/migration/appmod/coding-agent-support.md
+++ b/docs/azure/migration/appmod/coding-agent-support.md
@@ -34,7 +34,7 @@ This article shows you how to migrate .NET apps using **GitHub Copilot app moder
dotnet --info
```
-## Get started
+## Add the MCP Server
1. Go to **Settings** for the target repository you want to modernize (admin access required).
1. Select **Copilot**, then select **Coding Agent**.
@@ -65,21 +65,118 @@ This article shows you how to migrate .NET apps using **GitHub Copilot app moder
1. (Optional) If environment variables are required, set them under **Environment → Copilot** in the settings. These variables initialize automatically the first time an agentic task is invoked in this repository.
1. Save the MCP configuration.
-### Migrate your .NET application to Azure
+### Create a custom agent
-To migrate your .NET application to Azure, describe your migration scenario in the agent prompt. For example:
+1. Go to the agents tab at .
+1. In the prompt box, open the dropdown, and select the repository where you want to create the custom agent profile.
+1. (Optional) Select the branch where you want to create the agent profile. The default is the main branch.
+1. Select the **Copilot** icon, then select **+ Create an agent**. This action opens a template agent profile named `my-agent.agent.md` in the `.github/agents` directory of your target repository.
+1. Paste the content below into the template, and rename the file to `appmod-dotnet.agent.md`.
-```text
-Migrate this project from local file I/O to Azure Blob Storage
-Migrate this project from local SQL Server to Azure SQL Database with managed identity
-Migrate this project from file-based logging to OpenTelemetry
-```
+ ```
+ ---
+ # .NET Modernization Assistant - Custom GitHub Copilot Agent
+ # This agent helps modernize .NET applications with modern technologies and prepare them for Azure
+ # For format details, see: https://gh.io/customagents/config
+
+ name: dotnet-modernization
+ description: Expert assistant for modernizing .NET applications with modern technologies (logging, authentication, configuration) and preparing them for Azure migration, with specialized tools for assessment, code analysis, and step-by-step migration guidance.
+ ---
+
+ # .NET Modernization Assistant
+
+ I am a specialized AI assistant for modernizing .NET applications with modern technologies and preparing them for Azure.
+
+ ## What I Can Do
+
+ - **Migration**: Execute structured migrations to modern technologies (logging, authentication, configuration, data access)
+ - **Validation**: Run builds, tests, CVE checks, and consistency/completeness verification
+ - **Tracking**: Maintain migration plans and progress in `.appmod/.migration/` directory
+ - **Azure Preparation**: Modernize code patterns for cloud-native Azure deployment
+
+ ## ⚠️ CRITICAL: Migration Workflow
+
+ ### 1. Planning Phase (REQUIRED FIRST STEP)
+ **Before any migration work, I MUST call `dotnet_migration_plan_tool` first.**
+
+ This tool will provide instructions for generating `plan.md` and `progress.md` files in `.appmod/.migration/`.
+
+ ### 2. Execution Phase
+ **I MUST strictly follow the plan and progress files.**
+
+ Migration phases in order:
+ 1. **Analysis**: Analyze the solution structure and dependencies
+ 2. **Dependencies**: Update NuGet packages and project references
+ 3. **Configuration**: Migrate config files (app.config/web.config → appsettings.json)
+ 4. **Code**: Transform code to modern .NET patterns
+ 5. **Verification** (MANDATORY - NO SKIPPING):
+ - ✅ Build verification (use bash command `dotnet msbuild`)
+ - ✅ CVE vulnerability check (`check_cve_vulnerability`)
+ - ✅ Consistency check (`migration_consistency`)
+ - ✅ Completeness check (`migration_completeness`)
+ - ✅ Unit test verification (use bash command `dotnet test`)
+
+ ### 3. Completion Phase
+ **Write a brief summary of the migration process**, including:
+ - What was migrated
+ - Key changes made
+ - Verification results
+ - Any issues encountered and resolved
+
+ ## Core Principles
+
+ 1. **Always call tools in real-time** - Never reuse previous results
+ 2. **Follow the plan strictly** - Update `progress.md` after each task
+ 3. **Never skip verification steps** - All checks are mandatory
+ 4. **Use tools, not instructions** - Execute actions directly via tools
+ 5. **Track progress** - Create Git branches and commits for each task
+
+ ## Important Rules
+
+ ✅ **DO:**
+ - Call `dotnet_migration_plan_tool` before any migration
+ - Follow plan.md and progress.md strictly
+ - Complete ALL verification steps
+ - Write migration summary at completion
+ - Read files before editing them
+ - Track all changes in Git
+
+ ❌ **DON'T:**
+ - Skip the planning tool
+ - Skip any verification steps
+ - Reuse previous tool results
+ - Stop mid-migration for confirmation
+ - Skip progress tracking
+
+ ---
+
+ **Ready to modernize your .NET applications?** Ask me to start a migration!
+
+ ```
-For details on predefined migration tasks, see [migration tasks](predefined-tasks.md).
+1. Commit the file, and merge it into the default branch.
+1. Return to the agents tab, and refresh the page if needed. Your custom agent appears in the dropdown when you open the agent selector in the prompt box.
-1. Open the Agents panel and enter your prompt. After you submit it, Copilot starts a new session and opens a new pull request. It appears in the list below the prompt box. Copilot works on the task and adds you as a reviewer when it finishes, triggering a notification.
+ Visit [Create a custom agent profile in a repository on GitHub](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents#creating-a-custom-agent-profile-in-a-repository-on-github) for more information.
+
+### Migrate the .NET application to Azure
+
+1. Open the [Agents panel](https://github.com/copilot/agents).
+1. Select your `target repository`, select the `custom agent` and enter your `prompt`.
+
+ After you submit it, Copilot starts a new session and opens a new pull request. It appears in the list below the prompt box. Copilot works on the task and adds you as a reviewer when it finishes, triggering a notification.
+
+ :::image type="content" source="./media/coding-agent/select-custom-agent.png" lightbox="./media/coding-agent/select-custom-agent.png" alt-text="Screenshot of .NET migrate task input in Coding Agent.":::
+
+ Here are some prompt examples for your reference:
+
+ ```text
+ Migrate this project from local file I/O to Azure Blob Storage
+ Migrate this project from local SQL Server to Azure SQL Database with managed identity
+ Migrate this project from file-based logging to OpenTelemetry
+ ```
- :::image type="content" source="./media/coding-agent/migrate-input.png" lightbox="./media/coding-agent/migrate-input.png" alt-text="Screenshot of .NET migrate task input in Coding Agent.":::
+ For details on predefined migration tasks, see [migration tasks](predefined-tasks.md).
1. After the migration starts, monitor the progress:
@@ -89,7 +186,7 @@ For details on predefined migration tasks, see [migration tasks](predefined-task
:::image type="content" source="./media/coding-agent/migrate-completion.png" lightbox="./media/coding-agent/migrate-completion.png" alt-text="Screenshot of .NET migrate completion in Coding Agent.":::
-### Deploy your .NET application to Azure
+### Deploy the .NET application to Azure
After migration, deploy directly from Coding Agent using a prompt such as:
diff --git a/docs/azure/migration/appmod/copilot-cli-support.md b/docs/azure/migration/appmod/copilot-cli-support.md
index e632e4a8f1ffd..c5500d85754ed 100644
--- a/docs/azure/migration/appmod/copilot-cli-support.md
+++ b/docs/azure/migration/appmod/copilot-cli-support.md
@@ -30,7 +30,7 @@ Learn how to migrate .NET applications to Azure with **GitHub Copilot app modern
- A GitHub Copilot subscription. See [Copilot plans](https://github.com/features/copilot/plans?ref_product=copilot).
- [Install the .NET 10 SDK](https://dotnet.microsoft.com/download/dotnet/10.0).
-## Getting started
+## Get started
1. In a terminal, navigate to the .NET project folder containing the code you want to work on.
1. Run `copilot` to start Copilot CLI.
@@ -49,13 +49,15 @@ Learn how to migrate .NET applications to Azure with **GitHub Copilot app modern
- **Yes, and remember this folder for future sessions**: Trust the files in this folder for this and future sessions. You won't be asked again when you start Copilot CLI here. Only choose this option if you are sure it will always be safe for Copilot to work with files in this location.
- **No, exit (Esc)**: End the Copilot CLI session.
-1. Add MCP servers. Run `/mcp add` in Copilot CLI using the configuration below. For example, to add the .NET migration MCP server:
+### Add the MCP Server
- ```bash
+1. Run `/mcp add` in Copilot CLI using the configuration below. For example, here are two ways to add the .NET migration MCP server:
+
+ ```text
/mcp add DotNetAppModMcpServer-migrate
```
- Fill the fields as follows:
+1. Fill the fields as follows:
- Server Type: Local
- Command: `dnx Microsoft.AppModernization.McpServer.DotNet.Migration --yes --source https://api.nuget.org/v3/index.json`
@@ -84,33 +86,141 @@ Learn how to migrate .NET applications to Azure with **GitHub Copilot app modern
}
```
- Run `/mcp show` to confirm the MCP server configuration.
+1. Run `/mcp show` to confirm the MCP server configuration.
- ```bash
+ ```text
/mcp show
```
-1. Run the migration task in Copilot CLI.
+### Configure a custom agent
- Describe your migration scenario in Copilot CLI to migrate your .NET app to Azure.
- Use a prompt like *migrate from X to Y* for any migration task.
- Copilot CLI supports predefined migration scenarios that follow Microsoft best practices. For details, see [migration tasks](predefined-tasks.md).
+1. Create a file in the local `~/.copilot/agents` directory named `appmod-dotnet.agent.md`.
+1. Add the following content to define a User-level custom agent.
- Example prompts:
+ For more information, visit [Use custom agents in Copilot CLI](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-copilot-cli#use-custom-agents).
```text
- Migrate this app from local file I/O to Azure Blob Storage
- Migrate this app from local SQL Server to Azure SQL Database with managed identity
- Migrate this app from file-based logging to OpenTelemetry
+ ---
+ # .NET Modernization Assistant - Custom GitHub Copilot Agent
+ # This agent helps modernize .NET applications with modern technologies and prepare them for Azure
+ # For format details, see: https://gh.io/customagents/config
+
+ name: dotnet-modernization
+ description: Expert assistant for modernizing .NET applications with modern technologies (logging, authentication, configuration) and preparing them for Azure migration, with specialized tools for assessment, code analysis, and step-by-step migration guidance.
+ ---
+
+ # .NET Modernization Assistant
+
+ I am a specialized AI assistant for modernizing .NET applications with modern technologies and preparing them for Azure.
+
+ ## What I Can Do
+
+ - **Migration**: Execute structured migrations to modern technologies (logging, authentication, configuration, data access)
+ - **Validation**: Run builds, tests, CVE checks, and consistency/completeness verification
+ - **Tracking**: Maintain migration plans and progress in `.appmod/.migration/` directory
+ - **Azure Preparation**: Modernize code patterns for cloud-native Azure deployment
+
+ ## ⚠️ CRITICAL: Migration Workflow
+
+ ### 1. Planning Phase (REQUIRED FIRST STEP)
+ **Before any migration work, I MUST call `dotnet_migration_plan_tool` first.**
+
+ This tool will provide instructions for generating `plan.md` and `progress.md` files in `.appmod/.migration/`.
+
+ ### 2. Execution Phase
+ **I MUST strictly follow the plan and progress files.**
+
+ Migration phases in order:
+ 1. **Analysis**: Analyze the solution structure and dependencies
+ 2. **Dependencies**: Update NuGet packages and project references
+ 3. **Configuration**: Migrate config files (app.config/web.config → appsettings.json)
+ 4. **Code**: Transform code to modern .NET patterns
+ 5. **Verification** (MANDATORY - NO SKIPPING):
+ - ✅ Build verification (use bash command `dotnet msbuild`)
+ - ✅ CVE vulnerability check (`check_cve_vulnerability`)
+ - ✅ Consistency check (`migration_consistency`)
+ - ✅ Completeness check (`migration_completeness`)
+ - ✅ Unit test verification (use bash command `dotnet test`)
+
+ ### 3. Completion Phase
+ **Write a brief summary of the migration process**, including:
+ - What was migrated
+ - Key changes made
+ - Verification results
+ - Any issues encountered and resolved
+
+ ## Core Principles
+
+ 1. **Always call tools in real-time** - Never reuse previous results
+ 2. **Follow the plan strictly** - Update `progress.md` after each task
+ 3. **Never skip verification steps** - All checks are mandatory
+ 4. **Use tools, not instructions** - Execute actions directly via tools
+ 5. **Track progress** - Create Git branches and commits for each task
+
+ ## Important Rules
+
+ ✅ **DO:**
+ - Call `dotnet_migration_plan_tool` before any migration
+ - Follow plan.md and progress.md strictly
+ - Complete ALL verification steps
+ - Write migration summary at completion
+ - Read files before editing them
+ - Track all changes in Git
+
+ ❌ **DON'T:**
+ - Skip the planning tool
+ - Skip any verification steps
+ - Reuse previous tool results
+ - Stop mid-migration for confirmation
+ - Skip progress tracking
+
+ ---
+
+ **Ready to modernize your .NET applications?** Ask me to start a migration!
+
```
- The migration task runs and shows progress in Copilot CLI.
+ Use the custom agent in one of the following ways:
+
+ - Use the slash command in interactive mode to select from the list of available custom agents:
+
+ ```text
+ /agent
+ ```
+
+ :::image type="content" source="./media/select-custom-agent.png" lightbox="./media/select-custom-agent.png" alt-text="Screenshot of selecting .NET migration custom agent in Copilot CLI.":::
+
+ - Call the custom agent directly in a prompt:
+
+ ```text
+ Use the dotnet modernization agent to migrate this application from local File IO to use Azure Blob Storage.
+ ```
+
+### Run the migration task in Copilot CLI
+
+Describe your migration scenario in Copilot CLI to migrate your .NET app to Azure. Use a prompt like:
+
+```text
+*migrate from X to Y* for any migration task
+```
+
+Copilot CLI supports predefined migration scenarios that follow Microsoft best practices. For details, see [migration tasks](predefined-tasks.md).
+
+Example prompts:
+
+```text
+Use the dotnet modernization agent to migrate this app from local file I/O to Azure Blob Storage
+Use the dotnet modernization agent to migrate this app from local SQL Server to Azure SQL Database with managed identity
+Use the dotnet modernization agent to migrate this app from file-based logging to OpenTelemetry
+```
+
+The migration task runs and shows progress in Copilot CLI.
- :::image type="content" source="./media/migrate-details.png" lightbox="./media/migrate-details.png" alt-text="Screenshot of a .NET migration task progress details in Copilot CLI.":::
+:::image type="content" source="./media/migrate-details.png" lightbox="./media/migrate-details.png" alt-text="Screenshot of a .NET migration task progress details in Copilot CLI.":::
- After migration, view the summary:
+After migration, view the summary:
- :::image type="content" source="./media/migrate-summary.png" lightbox="./media/migrate-summary.png" alt-text="Screenshot of the .NET migration summary in Copilot CLI.":::
+:::image type="content" source="./media/migrate-summary.png" lightbox="./media/migrate-summary.png" alt-text="Screenshot of the .NET migration summary in Copilot CLI.":::
## Provide feedback
diff --git a/docs/azure/migration/appmod/media/coding-agent/migrate-input.png b/docs/azure/migration/appmod/media/coding-agent/migrate-input.png
deleted file mode 100644
index 1d6020e3a21bd..0000000000000
Binary files a/docs/azure/migration/appmod/media/coding-agent/migrate-input.png and /dev/null differ
diff --git a/docs/azure/migration/appmod/media/coding-agent/select-custom-agent.png b/docs/azure/migration/appmod/media/coding-agent/select-custom-agent.png
new file mode 100644
index 0000000000000..d085a859d9724
Binary files /dev/null and b/docs/azure/migration/appmod/media/coding-agent/select-custom-agent.png differ
diff --git a/docs/azure/migration/appmod/media/select-custom-agent.png b/docs/azure/migration/appmod/media/select-custom-agent.png
new file mode 100644
index 0000000000000..dc7be219d588a
Binary files /dev/null and b/docs/azure/migration/appmod/media/select-custom-agent.png differ
diff --git a/docs/azure/sdk/snippets/aspnetcore-guidance/MinApiSample/MinApiSample.csproj b/docs/azure/sdk/snippets/aspnetcore-guidance/MinApiSample/MinApiSample.csproj
index 41534ada7e968..105c96ed588d5 100644
--- a/docs/azure/sdk/snippets/aspnetcore-guidance/MinApiSample/MinApiSample.csproj
+++ b/docs/azure/sdk/snippets/aspnetcore-guidance/MinApiSample/MinApiSample.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/docs/azure/sdk/snippets/logging/LoggingSampleApp.csproj b/docs/azure/sdk/snippets/logging/LoggingSampleApp.csproj
index f38d36a9821e5..9b4ff4ad51198 100644
--- a/docs/azure/sdk/snippets/logging/LoggingSampleApp.csproj
+++ b/docs/azure/sdk/snippets/logging/LoggingSampleApp.csproj
@@ -9,8 +9,8 @@
-
-
+
+
diff --git a/docs/core/compatibility/10.0.md b/docs/core/compatibility/10.0.md
index 1b3c5e71df340..2f61c764e29f2 100644
--- a/docs/core/compatibility/10.0.md
+++ b/docs/core/compatibility/10.0.md
@@ -144,6 +144,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
| [HTTP warnings promoted to errors in `dotnet package list` and `dotnet package search`](sdk/10.0/http-warnings-to-errors.md) | Behavioral/source incompatible change |
| [NUGET_ENABLE_ENHANCED_HTTP_RETRY environment variable removed](sdk/10.0/nuget-enhanced-http-retry-removed.md) | Behavioral change |
| [NuGet logs an error for invalid package IDs](sdk/10.0/nuget-packageid-validation.md) | Behavioral change |
+| [`ToolCommandName` not set for non-tool packages](sdk/10.0/toolcommandname-not-set.md) | Source incompatible |
## Serialization
diff --git a/docs/core/compatibility/sdk/10.0/toolcommandname-not-set.md b/docs/core/compatibility/sdk/10.0/toolcommandname-not-set.md
new file mode 100644
index 0000000000000..419aa14d446bc
--- /dev/null
+++ b/docs/core/compatibility/sdk/10.0/toolcommandname-not-set.md
@@ -0,0 +1,54 @@
+---
+title: "Breaking change - ToolCommandName is not set for non tool packages"
+description: "Learn about the breaking change in .NET 10 where ToolCommandName is only set for projects with PackAsTool set to true."
+ms.date: 12/02/2025
+ai-usage: ai-assisted
+---
+
+# `ToolCommandName` not set for non-tool packages
+
+The `ToolCommandName` property is no longer set automatically for all projects during build or package operations. It's now only set when `PackAsTool` is set to `true`, indicating that the project is a .NET tool package.
+
+## Version introduced
+
+.NET 10
+
+## Previous behavior
+
+Previously, the `ToolCommandName` property was always set during build or pack operations, regardless of whether the project was configured as a tool package.
+
+## New behavior
+
+Starting in .NET 10, the `ToolCommandName` property is only set when `PackAsTool` is set to `true`, indicating that the project is a .NET tool.
+
+## Type of breaking change
+
+This change can affect [source compatibility](../../categories.md#source-compatibility).
+
+## Reason for change
+
+The `ToolCommandName` property doesn't make sense for non-tool projects. Setting it for all projects was unnecessary and could cause confusion about the project's purpose.
+
+## Recommended action
+
+If your project relies on the `ToolCommandName` property being set, you have two options:
+
+- Set the property explicitly in your project file:
+
+ ```xml
+
+ your-command-name
+
+ ```
+
+- Convert your project to a .NET tool by setting `PackAsTool` to `true`:
+
+ ```xml
+
+ true
+
+ ```
+
+## Affected APIs
+
+None.
diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml
index 98e7aa1f57fe9..c83d1fb7215ff 100644
--- a/docs/core/compatibility/toc.yml
+++ b/docs/core/compatibility/toc.yml
@@ -176,6 +176,8 @@ items:
href: sdk/10.0/nu1015-packagereference-version.md
- name: PrunePackageReference privatizes direct prunable references
href: sdk/10.0/prune-packagereference-privateassets.md
+ - name: "'ToolCommandName' not set for non-tool packages"
+ href: sdk/10.0/toolcommandname-not-set.md
- name: Serialization
items:
- name: System.Text.Json checks for property name conflicts
diff --git a/docs/core/extensions/snippets/http/generated/generated.csproj b/docs/core/extensions/snippets/http/generated/generated.csproj
index bcb24b073321d..45b4dcc1a448b 100644
--- a/docs/core/extensions/snippets/http/generated/generated.csproj
+++ b/docs/core/extensions/snippets/http/generated/generated.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/docs/core/extensions/snippets/primitives/string/tokenizers.csproj b/docs/core/extensions/snippets/primitives/string/tokenizers.csproj
index 65f48fcada546..6d0292bdcfccb 100644
--- a/docs/core/extensions/snippets/primitives/string/tokenizers.csproj
+++ b/docs/core/extensions/snippets/primitives/string/tokenizers.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/docs/core/testing/unit-testing-with-copilot.md b/docs/core/testing/unit-testing-with-copilot.md
deleted file mode 100644
index f6c100c90ff54..0000000000000
--- a/docs/core/testing/unit-testing-with-copilot.md
+++ /dev/null
@@ -1,84 +0,0 @@
----
-title: Generate Unit Tests with Copilot
-author: sigmade
-description: How to generate unit tests and test projects in C# using the xUnit framework with the help of Visual Studio commands and GitHub Copilot
-ms.date: 01/12/2025
-ms.update-cycle: 180-days
-ms.collection: ce-skilling-ai-copilot
----
-
-# Generate unit tests with GitHub Copilot
-
-In this article, you explore how to generate unit tests and test projects in C# using the xUnit framework with the help of Visual Studio commands and GitHub Copilot. Using Visual Studio in combination with GitHub Copilot significantly simplifies the process of generating and writing unit tests.
-
-## Create a test project
-
-Imagine that there's a `ProductService` class with a `GetProductById` method that depends on the `IProductDataStorage` and `ICacheClient` interfaces.
-
-```csharp
-public class ProductService(
- IProductDataStorage productDataStorage,
- ICacheClient cacheClient)
-{
- public async Task GetProductById(int productId)
- {
- var product = await cacheClient.GetProduct(productId);
-
- if (product is not null)
- {
- return product;
- }
-
- product = await productDataStorage.GetProduct(productId);
-
- if (product is not null)
- {
- await _cacheClient.SetProduct(product);
- }
-
- return product;
- }
-}
-```
-
-To generate a test project and a stub method, follow these steps:
-
-- Select the method.
-- Right-click and select **Create Unit Tests**.
-
-:::image type="content" source="media/create-unit-test.png" lightbox="media/create-unit-test.png" alt-text="Command Create Unit Tests":::
-
-In the **Create Unit Tests** dialog, select **xUnit** from the **Test Framework** dropdown menu.
-
-> [!NOTE]
-> The **Create Unit Tests** command defaults to the MSTest framework. However, since this example uses xUnit, you need to install the Visual Studio extension [xUnit.net.TestGenerator2022](https://marketplace.visualstudio.com/items?itemName=YowkoTsai.xunitnettestgenerator2022).
-
-:::image type="content" source="media/create-unit-test-window.png" lightbox="media/create-unit-test-window.png" alt-text="Create Unit Tests window":::
-
-- If you don't have a test project yet, choose **New Test Project** or select an existing one.
-- If necessary, specify a template for the namespace, class, and method name, then click **OK**.
-
-After a few seconds, Visual Studio will pull in the necessary packages, and you'll get a generated xUnit project with the required packages and structure, a reference to the project being tested, and the `ProductServiceTests` class and a stub method.
-
-:::image type="content" source="media/test-mehod-stub.png" lightbox="media/test-mehod-stub.png" alt-text="Generated stub method":::
-
-## Generate the tests themselves
-
-- Select the method being tested again.
-- Right-click and select **Ask Copilot**.
-- Enter a simple prompt, such as:
-
- "Generate unit tests using xunit, nsubstitute and insert the result into #ProductServiceTests file."
-
- You need to select your test class when you type the `#` character.
-
-> [!TIP]
-> For quick search, it's desirable that `ProductServiceTests` is open in a separate tab.
-
-:::image type="content" source="media/test-copilot-prompt.png" lightbox="media/test-copilot-prompt.png" alt-text="Prompt for generate tests":::
-
-Execute the prompt, click **Accept**, and Copilot generates the test code. After that, it remains to install the necessary packages.
-
-When the packages are installed, the tests can be run. This example worked on the first try: Copilot knows how to work with NSubstitute, and all dependencies were defined through interfaces.
-
-:::image type="content" source="media/test-copilot-result.png" lightbox="media/test-copilot-result.png" alt-text="Generated tests":::
diff --git a/docs/csharp/tutorials/snippets/StringInterpolation/Program.cs b/docs/csharp/tutorials/snippets/StringInterpolation/Program.cs
index 8a270a1365ac6..bde39c0dfc6e0 100644
--- a/docs/csharp/tutorials/snippets/StringInterpolation/Program.cs
+++ b/docs/csharp/tutorials/snippets/StringInterpolation/Program.cs
@@ -71,10 +71,10 @@ private static void SpecifyAlignment()
// Output:
// Author and Title List
//
- // |Author |Title |
- // |Doyle, Arthur Conan |Hound of the Baskervilles, The |
- // |London, Jack | Call of the Wild, The |
- // |Shakespeare, William | Tempest, The |
+ // |Author | Title|
+ // |Doyle, Arthur Conan |Hound of the Baskervilles, The|
+ // |London, Jack | Call of the Wild, The|
+ // |Shakespeare, William | Tempest, The|
//
}
diff --git a/docs/fsharp/language-reference/pattern-matching.md b/docs/fsharp/language-reference/pattern-matching.md
index eca14fe0d96ac..2afe39eded9a9 100644
--- a/docs/fsharp/language-reference/pattern-matching.md
+++ b/docs/fsharp/language-reference/pattern-matching.md
@@ -289,7 +289,7 @@ let len (str: string | null) =
Similarly, you can use new dedicated nullability related [patterns](./active-patterns.md):
```fsharp
-let let str = // str is inferred to be `string | null`
+let len str = // str is inferred to be `string | null`
match str with
| Null -> -1
| NonNull (s: string) -> s.Length
diff --git a/docs/fundamentals/code-analysis/style-rules/ide3000.md b/docs/fundamentals/code-analysis/style-rules/ide3000.md
index 4b7ff0fb3e377..ef046c4ffa518 100644
--- a/docs/fundamentals/code-analysis/style-rules/ide3000.md
+++ b/docs/fundamentals/code-analysis/style-rules/ide3000.md
@@ -75,5 +75,4 @@ For more information, see [How to suppress code analysis warnings](../suppress-w
## See also
-- [Generate unit tests with GitHub Copilot](../../../core/testing/unit-testing-with-copilot.md)
- [Code style rules reference](index.md)
diff --git a/docs/navigate/devops-testing/toc.yml b/docs/navigate/devops-testing/toc.yml
index 60e8585352339..c32bcee014f3e 100644
--- a/docs/navigate/devops-testing/toc.yml
+++ b/docs/navigate/devops-testing/toc.yml
@@ -53,8 +53,6 @@ items:
- name: Organize a project and test with xUnit
href: ../../core/tutorials/testing-with-cli.md
displayName: tutorials, cli
- - name: Generate unit tests with GitHub Copilot
- href: ../../core/testing/unit-testing-with-copilot.md
- name: NUnit
items:
- name: C# unit testing
diff --git a/docs/standard/analyzers/platform-compat-analyzer.md b/docs/standard/analyzers/platform-compat-analyzer.md
index fbe380085633d..6f97a609f7104 100644
--- a/docs/standard/analyzers/platform-compat-analyzer.md
+++ b/docs/standard/analyzers/platform-compat-analyzer.md
@@ -216,11 +216,11 @@ The following code snippet shows how you can combine attributes to set the right
The recommended way to deal with these diagnostics is to make sure you only call platform-specific APIs when running on an appropriate platform. Following are the options you can use to address the warnings; choose whichever is most appropriate for your situation:
-- **Guard the call**. You can achieve this by conditionally calling the code at run time. Check whether you're running on a desired `Platform` by using one of platform-check methods, for example, `OperatingSystem.Is()` or `OperatingSystem.IsVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0)`. [Example](#guard-platform-specific-apis-with-guard-methods).
+- **Guard the call**. You can achieve this by conditionally calling the code at runtime. Check whether you're running on a desired `Platform` by using one of platform-check methods, for example, `OperatingSystem.Is()` or `OperatingSystem.IsVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0)`. [Example](#guard-platform-specific-apis-with-guard-methods).
- **Mark the call site as platform-specific**. You can also choose to mark your own APIs as being platform-specific, thus effectively just forwarding the requirements to your callers. Mark the containing method or type or the entire assembly with the same attributes as the referenced platform-dependent call. [Examples](#mark-call-site-as-platform-specific).
-- **Assert the call site with platform check**. If you don't want the overhead of an additional `if` statement at run time, use . [Example](#assert-the-call-site-with-platform-check).
+- **Assert the call site with platform check**. If you don't want the overhead of an additional `if` statement at runtime, use . [Example](#assert-the-call-site-with-platform-check).
- **Delete the code**. Generally not what you want because it means you lose fidelity when your code is used by Windows users. For cases where a cross-platform alternative exists, you're likely better off using that over platform-specific APIs.
diff --git a/docs/standard/assembly/create-use-strong-named.md b/docs/standard/assembly/create-use-strong-named.md
index 7591a33bdf995..b7edfb08b4ff5 100644
--- a/docs/standard/assembly/create-use-strong-named.md
+++ b/docs/standard/assembly/create-use-strong-named.md
@@ -40,7 +40,7 @@ The following scenario outlines the process of signing an assembly with a strong
3. Assembly B is a consumer of Assembly A. The reference section of Assembly B's manifest includes a token that represents Assembly A's public key. A token is a portion of the full public key and is used rather than the key itself to save space.
-4. The common language runtime verifies the strong name signature when the assembly is placed in the global assembly cache. When binding by strong name at run time, the common language runtime compares the key stored in Assembly B's manifest with the key used to generate the strong name for Assembly A. If the .NET security checks pass and the bind succeeds, Assembly B has a guarantee that Assembly A's bits have not been tampered with and that these bits actually come from the developers of Assembly A.
+4. The common language runtime verifies the strong name signature when the assembly is placed in the global assembly cache. When binding by strong name at runtime, the common language runtime compares the key stored in Assembly B's manifest with the key used to generate the strong name for Assembly A. If the .NET security checks pass and the bind succeeds, Assembly B has a guarantee that Assembly A's bits have not been tampered with and that these bits actually come from the developers of Assembly A.
> [!NOTE]
> This scenario doesn't address trust issues. Assemblies can carry full Microsoft Authenticode signatures in addition to a strong name. Authenticode signatures include a certificate that establishes trust. It's important to note that strong names don't require code to be signed in this way. Strong names only provide a unique identity.
@@ -68,7 +68,7 @@ This feature can be disabled for individual applications or for a computer. See
|[How to: Create a public-private key pair](create-public-private-key-pair.md)|Describes how to create a cryptographic key pair for signing an assembly.|
|[How to: Sign an assembly with a strong name](sign-strong-name.md)|Describes how to create a strong-named assembly.|
|[Enhanced strong naming](enhanced-strong-naming.md)|Describes enhancements to strong-names in the .NET Framework 4.5.|
-|[How to: Reference a strong-named assembly](reference-strong-named.md)|Describes how to reference types or resources in a strong-named assembly at compile time or run time.|
+|[How to: Reference a strong-named assembly](reference-strong-named.md)|Describes how to reference types or resources in a strong-named assembly at compile time or runtime.|
|[How to: Disable the strong-name bypass feature](disable-strong-name-bypass-feature.md)|Describes how to disable the feature that bypasses the validation of strong-name signatures. This feature can be disabled for all or for specific applications.|
|[Create assemblies](create.md)|Provides an overview of single-file and multifile assemblies.|
|[How to delay sign an assembly in Visual Studio](/visualstudio/ide/managing-assembly-and-manifest-signing#how-to-sign-an-assembly-in-visual-studio)|Explains how to sign an assembly with a strong name after the assembly has been created.|
diff --git a/docs/standard/assembly/file-format.md b/docs/standard/assembly/file-format.md
index 32e9617eefe61..8669d8f2beb40 100644
--- a/docs/standard/assembly/file-format.md
+++ b/docs/standard/assembly/file-format.md
@@ -28,4 +28,4 @@ Assembly Headers from ECMA 335 II.25.1, Structure of the runtime file format.
## Process the assemblies
-It is possible to write tools or APIs to process assemblies. Assembly information enables making programmatic decisions at run time, rewriting assemblies, providing API IntelliSense in an editor, and generating documentation. , , and [Mono.Cecil](https://www.mono-project.com/docs/tools+libraries/libraries/Mono.Cecil/) are good examples of tools that are frequently used for this purpose.
+It is possible to write tools or APIs to process assemblies. Assembly information enables making programmatic decisions at runtime, rewriting assemblies, providing API IntelliSense in an editor, and generating documentation. , , and [Mono.Cecil](https://www.mono-project.com/docs/tools+libraries/libraries/Mono.Cecil/) are good examples of tools that are frequently used for this purpose.
diff --git a/docs/standard/assembly/index.md b/docs/standard/assembly/index.md
index 59f180512dcc2..6d5fb3b678666 100644
--- a/docs/standard/assembly/index.md
+++ b/docs/standard/assembly/index.md
@@ -103,7 +103,7 @@ In C#, you can use two versions of the same assembly in a single application. Fo
|[Assembly placement](../../framework/app-domains/assembly-placement.md)|Where to locate assemblies.|
|[Assemblies and side-by-side execution](side-by-side-execution.md)|Use multiple versions of the runtime or an assembly simultaneously.|
|[Emit dynamic methods and assemblies](../../fundamentals/reflection/emitting-dynamic-methods-and-assemblies.md)|How to create dynamic assemblies.|
-|[How the runtime locates assemblies](../../framework/deployment/how-the-runtime-locates-assemblies.md)|How the .NET Framework resolves assembly references at run time.|
+|[How the runtime locates assemblies](../../framework/deployment/how-the-runtime-locates-assemblies.md)|How the .NET Framework resolves assembly references at runtime.|
## Reference
diff --git a/docs/standard/assembly/reference-strong-named.md b/docs/standard/assembly/reference-strong-named.md
index 562135bc04d31..3d68f7a9d4728 100644
--- a/docs/standard/assembly/reference-strong-named.md
+++ b/docs/standard/assembly/reference-strong-named.md
@@ -2,55 +2,55 @@
title: "How to: Reference a strong-named assembly"
description: This article shows you how to reference types or resources in a strong-named .NET assembly, either at compile time or runtime.
ms.date: "08/20/2019"
-helpviewer_keywords:
+helpviewer_keywords:
- "strong-named assemblies, compile-time references"
- "compile-time assembly referencing"
- "assemblies [.NET], strong-named"
- "assembly binding, strong-named"
ms.topic: how-to
-dev_langs:
+dev_langs:
- "csharp"
- "vb"
- "cpp"
---
# How to: Reference a strong-named assembly
-The process for referencing types or resources in a strong-named assembly is usually transparent. You can make the reference either at compile time (early binding) or at run time.
-
+The process for referencing types or resources in a strong-named assembly is usually transparent. You can make the reference either at compile time (early binding) or at runtime.
+
A compile-time reference occurs when you indicate to the compiler that the assembly to be compiled explicitly references another assembly. When you use compile-time referencing, the compiler automatically gets the public key of the targeted strong-named assembly and places it in the assembly reference of the assembly being compiled.
-
+
> [!NOTE]
-> A strong-named assembly can only use types from other strong-named assemblies. Otherwise, the security of the strong-named assembly would be compromised.
-
-## Make a compile-time reference to a strong-named assembly
+> A strong-named assembly can only use types from other strong-named assemblies. Otherwise, the security of the strong-named assembly would be compromised.
+
+## Make a compile-time reference to a strong-named assembly
-At a command prompt, type the following command:
+At a command prompt, type the following command:
-\<*compiler command*> **/reference:**\<*assembly name*>
+\<*compiler command*> **/reference:**\<*assembly name*>
-In this command, *compiler command* is the compiler command for the language you are using, and *assembly name* is the name of the strong-named assembly being referenced. You can also use other compiler options, such as the **/t:library** option for creating a library assembly.
+In this command, *compiler command* is the compiler command for the language you are using, and *assembly name* is the name of the strong-named assembly being referenced. You can also use other compiler options, such as the **/t:library** option for creating a library assembly.
-The following example creates an assembly called *myAssembly.dll* that references a strong-named assembly called *myLibAssembly.dll* from a code module called *myAssembly.cs*.
+The following example creates an assembly called *myAssembly.dll* that references a strong-named assembly called *myLibAssembly.dll* from a code module called *myAssembly.cs*.
```cmd
-csc /t:library myAssembly.cs /reference:myLibAssembly.dll
-```
+csc /t:library myAssembly.cs /reference:myLibAssembly.dll
+```
+
+## Make a runtime reference to a strong-named assembly
-## Make a run-time reference to a strong-named assembly
-
-When you make a run-time reference to a strong-named assembly, for example by using the or method, you must use the display name of the referenced strong-named assembly. The syntax of a display name is as follows:
+When you make a runtime reference to a strong-named assembly, for example by using the or method, you must use the display name of the referenced strong-named assembly. The syntax of a display name is as follows:
-\<*assembly name*>**,** \<*version number*>**,** \<*culture*>**,** \<*public key token*>
+\<*assembly name*>**,** \<*version number*>**,** \<*culture*>**,** \<*public key token*>
-For example:
+For example:
```console
myDll, Version=1.1.0.0, Culture=en, PublicKeyToken=03689116d3a4ae33
-```
+```
-In this example, `PublicKeyToken` is the hexadecimal form of the public key token. If there is no culture value, use `Culture=neutral`.
+In this example, `PublicKeyToken` is the hexadecimal form of the public key token. If there is no culture value, use `Culture=neutral`.
-The following code example shows how to use this information with the method.
+The following code example shows how to use this information with the method.
```cpp
Assembly^ myDll =
@@ -67,13 +67,13 @@ Dim myDll As Assembly = _
Assembly.Load("myDll, Version=1.0.0.1, Culture=neutral, PublicKeyToken=9b35aa32c18d4fb1")
```
-You can print the hexadecimal format of the public key and public key token for a specific assembly by using the following [Strong Name (Sn.exe)](../../framework/tools/sn-exe-strong-name-tool.md) command:
+You can print the hexadecimal format of the public key and public key token for a specific assembly by using the following [Strong Name (Sn.exe)](../../framework/tools/sn-exe-strong-name-tool.md) command:
-**sn -Tp \<** *assembly* **>**
+**sn -Tp \<** *assembly* **>**
-If you have a public key file, you can use the following command instead (note the difference in case on the command-line option):
+If you have a public key file, you can use the following command instead (note the difference in case on the command-line option):
-**sn -tp \<** *public key file* **>**
+**sn -tp \<** *public key file* **>**
## See also
diff --git a/docs/standard/assembly/set-attributes.md b/docs/standard/assembly/set-attributes.md
index ab174e4c9624a..f9acd5a6c0155 100644
--- a/docs/standard/assembly/set-attributes.md
+++ b/docs/standard/assembly/set-attributes.md
@@ -68,7 +68,7 @@ You can use informational attributes to provide additional company or product in
| | String value specifying a company name. |
| | String value specifying copyright information. |
| | String value specifying the Win32 file version number. This normally defaults to the assembly version. |
-| | String value specifying version information that is not used by the common language runtime, such as a full product version number. **Note:** If this attribute is applied to an assembly, the string it specifies can be obtained at run time by using the property. The string is also used in the path and registry key provided by the and properties. |
+| | String value specifying version information that is not used by the common language runtime, such as a full product version number. **Note:** If this attribute is applied to an assembly, the string it specifies can be obtained at runtime by using the property. The string is also used in the path and registry key provided by the and properties. |
| | String value specifying product information. |
| | String value specifying trademark information. |
diff --git a/docs/standard/assembly/side-by-side-execution.md b/docs/standard/assembly/side-by-side-execution.md
index 89f50b5727d5c..b06a6e337ddb8 100644
--- a/docs/standard/assembly/side-by-side-execution.md
+++ b/docs/standard/assembly/side-by-side-execution.md
@@ -2,19 +2,19 @@
title: "Assemblies and side-by-side execution"
description: Learn about side-by-side execution, which is the ability to store and run multiple versions of an application or component on the same computer.
ms.date: "08/20/2019"
-helpviewer_keywords:
+helpviewer_keywords:
- "side-by-side execution [.NET]"
- "assemblies [.NET], side-by-side execution"
ms.assetid: e42036ee-7590-47d1-b884-cc856e39bd5d
---
# Assemblies and side-by-side execution
-Side-by-side execution is the ability to store and execute multiple versions of an application or component on the same computer. This means that you can have multiple versions of the runtime, and multiple versions of applications and components that use a version of the runtime, on the same computer at the same time. Side-by-side execution gives you more control over what versions of a component an application binds to, and more control over what version of the runtime an application uses.
-
-Support for side-by-side storage and execution of different versions of the same assembly is an integral part of strong naming and is built into the infrastructure of the runtime. Because the strong-named assembly's version number is part of its identity, the runtime can store multiple versions of the same assembly in the global assembly cache and load those assemblies at run time.
-
-Although the runtime provides you with the ability to create side-by-side applications, side-by-side execution is not automatic. For more information on creating applications for side-by-side execution, see [Guidelines for creating components for side-by-side execution](../../framework/deployment/guidelines-for-creating-components-for-side-by-side-execution.md).
-
+Side-by-side execution is the ability to store and execute multiple versions of an application or component on the same computer. This means that you can have multiple versions of the runtime, and multiple versions of applications and components that use a version of the runtime, on the same computer at the same time. Side-by-side execution gives you more control over what versions of a component an application binds to, and more control over what version of the runtime an application uses.
+
+Support for side-by-side storage and execution of different versions of the same assembly is an integral part of strong naming and is built into the infrastructure of the runtime. Because the strong-named assembly's version number is part of its identity, the runtime can store multiple versions of the same assembly in the global assembly cache and load those assemblies at runtime.
+
+Although the runtime provides you with the ability to create side-by-side applications, side-by-side execution is not automatic. For more information on creating applications for side-by-side execution, see [Guidelines for creating components for side-by-side execution](../../framework/deployment/guidelines-for-creating-components-for-side-by-side-execution.md).
+
## See also
- [How the runtime locates assemblies](../../framework/deployment/how-the-runtime-locates-assemblies.md)
diff --git a/docs/standard/assembly/versioning.md b/docs/standard/assembly/versioning.md
index 996819add92f3..4b92e5d26ebad 100644
--- a/docs/standard/assembly/versioning.md
+++ b/docs/standard/assembly/versioning.md
@@ -2,7 +2,7 @@
title: "Assembly versioning"
description: Learn about versioning of .NET assemblies. All versioning of assemblies that use the CLR is done at the assembly level.
ms.date: "08/20/2019"
-helpviewer_keywords:
+helpviewer_keywords:
- "informational versions"
- "version numbers, assemblies"
- "assemblies [.NET], versioning"
@@ -12,57 +12,57 @@ ms.assetid: 775ad4fb-914f-453c-98ef-ce1089b6f903
---
# Assembly versioning
-All versioning of assemblies that use the common language runtime is done at the assembly level. The specific version of an assembly and the versions of dependent assemblies are recorded in the assembly's manifest. The default version policy for the runtime is that applications run only with the versions they were built and tested with, unless overridden by explicit version policy in configuration files (the application configuration file, the publisher policy file, and the computer's administrator configuration file).
-
-The runtime performs several steps to resolve an assembly binding request:
-
-1. Checks the original assembly reference to determine the version of the assembly to be bound.
-
-2. Checks for all applicable configuration files to apply version policy.
-
-3. Determines the correct assembly from the original assembly reference and any redirection specified in the configuration files, and determines the version that should be bound to the calling assembly.
-
-4. Checks the global assembly cache, codebases specified in configuration files, and then checks the application's directory and subdirectories using the probing rules explained in [How the runtime locates assemblies](../../framework/deployment/how-the-runtime-locates-assemblies.md).
-
-The following illustration shows these steps:
-
+All versioning of assemblies that use the common language runtime is done at the assembly level. The specific version of an assembly and the versions of dependent assemblies are recorded in the assembly's manifest. The default version policy for the runtime is that applications run only with the versions they were built and tested with, unless overridden by explicit version policy in configuration files (the application configuration file, the publisher policy file, and the computer's administrator configuration file).
+
+The runtime performs several steps to resolve an assembly binding request:
+
+1. Checks the original assembly reference to determine the version of the assembly to be bound.
+
+2. Checks for all applicable configuration files to apply version policy.
+
+3. Determines the correct assembly from the original assembly reference and any redirection specified in the configuration files, and determines the version that should be bound to the calling assembly.
+
+4. Checks the global assembly cache, codebases specified in configuration files, and then checks the application's directory and subdirectories using the probing rules explained in [How the runtime locates assemblies](../../framework/deployment/how-the-runtime-locates-assemblies.md).
+
+The following illustration shows these steps:
+

-
-For more information about configuring applications, see [Configure apps](../../framework/configure-apps/index.md). For more information about binding policy, see [How the runtime locates assemblies](../../framework/deployment/how-the-runtime-locates-assemblies.md).
-
-## Version information
-
-Each assembly has two distinct ways of expressing version information:
-
-- The assembly's version number, which, together with the assembly name and culture information, is part of the assembly's identity. This number is used by the runtime to enforce version policy and plays a key part in the type resolution process at run time.
-
-- An informational version, which is a string that represents additional version information included for informational purposes only.
-
-### Assembly version number
-
-Each assembly has a version number as part of its identity. As such, two assemblies that differ by version number are considered by the runtime to be completely different assemblies. This version number is physically represented as a four-part string with the following format:
-
-\<*major version*>.\<*minor version*>.\<*build number*>.\<*revision*>
-
-For example, version 1.5.1254.0 indicates 1 as the major version, 5 as the minor version, 1254 as the build number, and 0 as the revision number.
-
-The version number is stored in the assembly manifest along with other identity information, including the assembly name and public key, as well as information on relationships and identities of other assemblies connected with the application.
-
-When an assembly is built, the development tool records dependency information for each assembly that is referenced in the assembly manifest. The runtime uses these version numbers, in conjunction with configuration information set by an administrator, an application, or a publisher, to load the proper version of a referenced assembly.
-
-The runtime distinguishes between regular and strong-named assemblies for the purposes of versioning. Version checking only occurs with strong-named assemblies.
-
-For information about specifying version binding policies, see [Configure apps](../../framework/configure-apps/index.md). For information about how the runtime uses version information to find a particular assembly, see [How the runtime locates assemblies](../../framework/deployment/how-the-runtime-locates-assemblies.md).
-
-### Assembly informational version
-
-The informational version is a string that attaches additional version information to an assembly for informational purposes only; this information is not used at run time. The text-based informational version corresponds to the product's marketing literature, packaging, or product name and is not used by the runtime. For example, an informational version could be "Common Language Runtime version 1.0" or "NET Control SP 2". On the Version tab of the file properties dialog in Microsoft Windows, this information appears in the item "Product Version".
-
+
+For more information about configuring applications, see [Configure apps](../../framework/configure-apps/index.md). For more information about binding policy, see [How the runtime locates assemblies](../../framework/deployment/how-the-runtime-locates-assemblies.md).
+
+## Version information
+
+Each assembly has two distinct ways of expressing version information:
+
+- The assembly's version number, which, together with the assembly name and culture information, is part of the assembly's identity. This number is used by the runtime to enforce version policy and plays a key part in the type resolution process at runtime.
+
+- An informational version, which is a string that represents additional version information included for informational purposes only.
+
+### Assembly version number
+
+Each assembly has a version number as part of its identity. As such, two assemblies that differ by version number are considered by the runtime to be completely different assemblies. This version number is physically represented as a four-part string with the following format:
+
+\<*major version*>.\<*minor version*>.\<*build number*>.\<*revision*>
+
+For example, version 1.5.1254.0 indicates 1 as the major version, 5 as the minor version, 1254 as the build number, and 0 as the revision number.
+
+The version number is stored in the assembly manifest along with other identity information, including the assembly name and public key, as well as information on relationships and identities of other assemblies connected with the application.
+
+When an assembly is built, the development tool records dependency information for each assembly that is referenced in the assembly manifest. The runtime uses these version numbers, in conjunction with configuration information set by an administrator, an application, or a publisher, to load the proper version of a referenced assembly.
+
+The runtime distinguishes between regular and strong-named assemblies for the purposes of versioning. Version checking only occurs with strong-named assemblies.
+
+For information about specifying version binding policies, see [Configure apps](../../framework/configure-apps/index.md). For information about how the runtime uses version information to find a particular assembly, see [How the runtime locates assemblies](../../framework/deployment/how-the-runtime-locates-assemblies.md).
+
+### Assembly informational version
+
+The informational version is a string that attaches additional version information to an assembly for informational purposes only; this information is not used at runtime. The text-based informational version corresponds to the product's marketing literature, packaging, or product name and is not used by the runtime. For example, an informational version could be "Common Language Runtime version 1.0" or "NET Control SP 2". On the Version tab of the file properties dialog in Microsoft Windows, this information appears in the item "Product Version".
+
> [!NOTE]
-> Although you can specify any text, a warning message appears on compilation if the string is not in the format used by the assembly version number, or if it is in that format but contains wildcards. This warning is harmless.
-
-The informational version is represented using the custom attribute . For more information about the informational version attribute, see [Set assembly attributes](set-attributes.md).
-
+> Although you can specify any text, a warning message appears on compilation if the string is not in the format used by the assembly version number, or if it is in that format but contains wildcards. This warning is harmless.
+
+The informational version is represented using the custom attribute . For more information about the informational version attribute, see [Set assembly attributes](set-attributes.md).
+
## See also
- [How the runtime locates assemblies](../../framework/deployment/how-the-runtime-locates-assemblies.md)
diff --git a/docs/standard/base-types/common-type-system.md b/docs/standard/base-types/common-type-system.md
index 52a4b0e269021..674a50546974a 100644
--- a/docs/standard/base-types/common-type-system.md
+++ b/docs/standard/base-types/common-type-system.md
@@ -154,7 +154,7 @@ A type definition includes the following:
### Attributes
-Attributes provide additional user-defined metadata. Most commonly, they are used to store additional information about a type in its assembly, or to modify the behavior of a type member in either the design-time or run-time environment.
+Attributes provide additional user-defined metadata. Most commonly, they are used to store additional information about a type in its assembly, or to modify the behavior of a type member in either the design-time or runtime environment.
Attributes are themselves classes that inherit from . Languages that support the use of attributes each have their own syntax for applying attributes to a language element. Attributes can be applied to almost any language element; the specific elements to which an attribute can be applied are defined by the that is applied to that attribute class.
@@ -268,7 +268,7 @@ The common type system allows type members to have a variety of characteristics;
|literal|Fields|The value assigned to the field is a fixed value, known at compile time, of a built-in value type. Literal fields are sometimes referred to as constants.|
|newslot or override|All|Defines how the member interacts with inherited members that have the same signature:
newslot
Hides inherited members that have the same signature.
override
Replaces the definition of an inherited virtual method.
The default is newslot.|
|static|Fields, methods, properties, and events|The member belongs to the type it is defined on, not to a particular instance of the type; the member exists even if an instance of the type is not created, and it is shared among all instances of the type.|
-|virtual|Methods, properties, and events|The method can be implemented by a derived type and can be invoked either statically or dynamically. If dynamic invocation is used, the type of the instance that makes the call at run time (rather than the type known at compile time) determines which implementation of the method is called. To invoke a virtual method statically, the variable might have to be cast to a type that uses the desired version of the method.|
+|virtual|Methods, properties, and events|The method can be implemented by a derived type and can be invoked either statically or dynamically. If dynamic invocation is used, the type of the instance that makes the call at runtime (rather than the type known at compile time) determines which implementation of the method is called. To invoke a virtual method statically, the variable might have to be cast to a type that uses the desired version of the method.|
### Overloading
@@ -283,7 +283,7 @@ A derived type inherits all members of its base type; that is, these members are
- A derived type can hide an inherited member by defining a new member with the same signature. This might be done to make a previously public member private or to define new behavior for an inherited method that is marked as `sealed`.
-- A derived type can override an inherited virtual method. The overriding method provides a new definition of the method that will be invoked based on the type of the value at run time rather than the type of the variable known at compile time. A method can override a virtual method only if the virtual method is not marked as `sealed` and the new method is at least as accessible as the virtual method.
+- A derived type can override an inherited virtual method. The overriding method provides a new definition of the method that will be invoked based on the type of the value at runtime rather than the type of the variable known at compile time. A method can override a virtual method only if the virtual method is not marked as `sealed` and the new method is at least as accessible as the virtual method.
## See also
diff --git a/docs/standard/base-types/composite-formatting.md b/docs/standard/base-types/composite-formatting.md
index 19430f835a054..4a4be55abd5b5 100644
--- a/docs/standard/base-types/composite-formatting.md
+++ b/docs/standard/base-types/composite-formatting.md
@@ -64,7 +64,7 @@ Multiple format items can refer to the same element in the list of objects by sp
:::code language="csharp" source="./snippets/composite-formatting/net/csharp/Program.cs" id="multiple":::
:::code language="vb" source="./snippets/composite-formatting/net/vb/Program.vb" id="multiple":::
-Each format item can refer to any object in the list. For example, if there are three objects, you can format the second, first, and third object by specifying a composite format string such as `{1} {0} {2}`. An object that isn't referenced by a format item is ignored. A is thrown at run time if a parameter specifier designates an item outside the bounds of the list of objects.
+Each format item can refer to any object in the list. For example, if there are three objects, you can format the second, first, and third object by specifying a composite format string such as `{1} {0} {2}`. An object that isn't referenced by a format item is ignored. A is thrown at runtime if a parameter specifier designates an item outside the bounds of the list of objects.
### Width component
diff --git a/docs/standard/base-types/regular-expression-options.md b/docs/standard/base-types/regular-expression-options.md
index 911d9ca8a6c87..02eca90d7eeee 100644
--- a/docs/standard/base-types/regular-expression-options.md
+++ b/docs/standard/base-types/regular-expression-options.md
@@ -228,9 +228,9 @@ Finally, you can use the inline group element `(?n:)` to suppress automatic capt
> [!NOTE]
> Where possible, use [source-generated regular expressions](regular-expression-source-generators.md) instead of compiling regular expressions using the option. Source generation can help your app start faster, run more quickly and be more trimmable. To learn when source generation is possible, see [When to use it](regular-expression-source-generators.md#when-to-use-it).
-By default, regular expressions in .NET are interpreted. When a object is instantiated or a static method is called, the regular expression pattern is parsed into a set of custom opcodes, and an interpreter uses these opcodes to run the regular expression. This involves a tradeoff: the cost of initializing the regular expression engine is minimized at the expense of run-time performance.
+By default, regular expressions in .NET are interpreted. When a object is instantiated or a static method is called, the regular expression pattern is parsed into a set of custom opcodes, and an interpreter uses these opcodes to run the regular expression. This involves a tradeoff: the cost of initializing the regular expression engine is minimized at the expense of runtime performance.
-You can use compiled instead of interpreted regular expressions by using the option. In this case, when a pattern is passed to the regular expression engine, it is parsed into a set of opcodes and then converted to common intermediate language (CIL), which can be passed directly to the common language runtime. Compiled regular expressions maximize run-time performance at the expense of initialization time.
+You can use compiled instead of interpreted regular expressions by using the option. In this case, when a pattern is passed to the regular expression engine, it is parsed into a set of opcodes and then converted to common intermediate language (CIL), which can be passed directly to the common language runtime. Compiled regular expressions maximize runtime performance at the expense of initialization time.
> [!NOTE]
> A regular expression can be compiled only by supplying the value to the `options` parameter of a class constructor or a static pattern-matching method. It's not available as an inline option.
@@ -266,9 +266,9 @@ However, in the following cases, white-space characters in a regular expression
- White space isn't allowed within a character sequence that introduces a language element. For example:
- - The language element `(?:`*subexpression*`)` represents a noncapturing group, and the `(?:` portion of the element can't have embedded spaces. The pattern `(? :`*subexpression*`)` throws an at run time because the regular expression engine can't parse the pattern, and the pattern `( ?:`*subexpression*`)` fails to match *subexpression*.
+ - The language element `(?:`*subexpression*`)` represents a noncapturing group, and the `(?:` portion of the element can't have embedded spaces. The pattern `(? :`*subexpression*`)` throws an at runtime because the regular expression engine can't parse the pattern, and the pattern `( ?:`*subexpression*`)` fails to match *subexpression*.
- - The language element `\p{`*name*`}`, which represents a Unicode category or named block, can't include embedded spaces in the `\p{` portion of the element. If you do include a white space, the element throws an at run time.
+ - The language element `\p{`*name*`}`, which represents a Unicode category or named block, can't include embedded spaces in the `\p{` portion of the element. If you do include a white space, the element throws an at runtime.
Enabling this option helps simplify regular expressions that are often difficult to parse and to understand. It improves readability, and makes it possible to document a regular expression.
diff --git a/docs/standard/base-types/regular-expression-source-generators.md b/docs/standard/base-types/regular-expression-source-generators.md
index b87579359ef0e..bcde7e299f5ea 100644
--- a/docs/standard/base-types/regular-expression-source-generators.md
+++ b/docs/standard/base-types/regular-expression-source-generators.md
@@ -368,7 +368,7 @@ Also, neither `RegexCompiler` nor the source generator supports the new `RegexOp
The general guidance is if you can use the source generator, use it. If you're using `Regex` today in C# with arguments known at compile time, and especially if you're already using `RegexOptions.Compiled` (because the regex has been identified as a hot spot that would benefit from faster throughput), you should prefer to use the source generator. The source generator will give your regex the following benefits:
- All the throughput benefits of `RegexOptions.Compiled`.
-- The startup benefits of not having to do all the regex parsing, analysis, and compilation at run time.
+- The startup benefits of not having to do all the regex parsing, analysis, and compilation at runtime.
- The option of using ahead-of-time compilation with the code generated for the regex.
- Better debuggability and understanding of the regex.
- The possibility to reduce the size of your trimmed app by trimming out large swaths of code associated with `RegexCompiler` (and potentially even reflection emit itself).
diff --git a/docs/standard/base-types/standard-date-and-time-format-strings.md b/docs/standard/base-types/standard-date-and-time-format-strings.md
index b5bd0d22c9c42..54abb1eb1ab0d 100644
--- a/docs/standard/base-types/standard-date-and-time-format-strings.md
+++ b/docs/standard/base-types/standard-date-and-time-format-strings.md
@@ -49,7 +49,7 @@ A standard date and time format string uses a single character as the format spe
|"u"|Universal sortable date/time pattern.
More information: [The universal sortable ("u") format specifier](#UniversalSortable).|With a value: 2009-06-15T13:45:30 -> 2009-06-15 13:45:30Z
With a value: 2009-06-15T13:45:30 -> 2009-06-15 20:45:30Z|
|"U"|Universal full date/time pattern.
More information: [The universal full ("U") format specifier](#UniversalFull).|2009-06-15T13:45:30 -> Monday, June 15, 2009 8:45:30 PM (en-US)
2009-06-15T13:45:30 -> den 15 juni 2009 20:45:30 (sv-SE)
2009-06-15T13:45:30 -> Δευτέρα, 15 Ιουνίου 2009 8:45:30 μμ (el-GR)|
|"Y", "y"|Year month pattern.
More information: [The year month ("Y") format specifier](#YearMonth).|2009-06-15T13:45:30 -> June 2009 (en-US)
2009-06-15T13:45:30 -> juni 2009 (da-DK)
2009-06-15T13:45:30 -> Juni 2009 (id-ID)|
-|Any other single character|Unknown specifier.|Throws a run-time .|
+|Any other single character|Unknown specifier.|Throws a runtime .|
## How standard format strings work
diff --git a/docs/standard/base-types/standard-numeric-format-strings.md b/docs/standard/base-types/standard-numeric-format-strings.md
index b084452518e0b..2a2848c077043 100644
--- a/docs/standard/base-types/standard-numeric-format-strings.md
+++ b/docs/standard/base-types/standard-numeric-format-strings.md
@@ -63,7 +63,7 @@ The following table describes the standard numeric format specifiers and display
| "P" or "p" | Percent | Result: Number multiplied by 100 and displayed with a percent symbol.
Supported by: All numeric types.
Precision specifier: Desired number of decimal places.
Default precision specifier: Defined by .
More information: [The Percent ("P") Format Specifier](#PFormatString). | 1 ("P", en-US)
-> 100.00 %
1 ("P", fr-FR)
-> 100,00 %
-0.39678 ("P1", en-US)
-> -39.7 %
-0.39678 ("P1", fr-FR)
-> -39,7 % |
| "R" or "r" | Round-trip | Result: A string that can round-trip to an identical number.
Supported by: , , and .
Note: Recommended for the type only. For types, use "G17"; for types, use "G9".
Precision specifier: Ignored.
More information: [The Round-trip ("R") Format Specifier](#RFormatString). | 123456789.12345678 ("R")
-> 123456789.12345678
-1234567890.12345678 ("R")
-> -1234567890.1234567 |
| "X" or "x" | Hexadecimal | Result: A hexadecimal string.
Supported by: Integral types only.
Precision specifier: Number of digits in the result string.
More information: [The Hexadecimal ("X") Format Specifier](#XFormatString). | 255 ("X")
-> FF
-1 ("x")
-> ff
255 ("x4")
-> 00ff
-1 ("X4")
-> 00FF |
-| Any other single character | Unknown specifier | Result: Throws a at run time. | |
+| Any other single character | Unknown specifier | Result: Throws a at runtime. | |
## Use standard numeric format strings
diff --git a/docs/standard/base-types/type-conversion.md b/docs/standard/base-types/type-conversion.md
index 1482b1f5c8a02..abef4340b59e6 100644
--- a/docs/standard/base-types/type-conversion.md
+++ b/docs/standard/base-types/type-conversion.md
@@ -3,10 +3,10 @@ title: "Type Conversion in .NET"
description: Read about type conversion in .NET, which creates a value in a new type that's equivalent to the old type's value, but may not keep the original's identity.
ms.topic: article
ms.date: 03/30/2017
-dev_langs:
+dev_langs:
- "csharp"
- "vb"
-helpviewer_keywords:
+helpviewer_keywords:
- "widening conversions"
- "explicit conversions"
- "narrowing conversions"
@@ -28,171 +28,171 @@ ms.assetid: ba36154f-064c-47d3-9f05-72f93a7ca96d
---
# Type conversion in .NET
-Every value has an associated type, which defines attributes such as the amount of space allocated to the value, the range of possible values it can have, and the members that it makes available. Many values can be expressed as more than one type. For example, the value 4 can be expressed as an integer or a floating-point value. Type conversion creates a value in a new type that is equivalent to the value of an old type, but does not necessarily preserve the identity (or exact value) of the original object.
-
-.NET automatically supports the following conversions:
-
-- Conversion from a derived class to a base class. This means, for example, that an instance of any class or structure can be converted to an instance. This conversion does not require a casting or conversion operator.
-
-- Conversion from a base class back to the original derived class. In C#, this conversion requires a casting operator. In Visual Basic, it requires the `CType` operator if `Option Strict` is on.
-
-- Conversion from a type that implements an interface to an interface object that represents that interface. This conversion does not require a casting or conversion operator.
-
-- Conversion from an interface object back to the original type that implements that interface. In C#, this conversion requires a casting operator. In Visual Basic, it requires the `CType` operator if `Option Strict` is on.
-
-In addition to these automatic conversions, .NET provides several features that support custom type conversion. These include the following:
-
-- The `Implicit` operator, which defines the available widening conversions between types. For more information, see the [Implicit Conversion with the Implicit Operator](#implicit-conversion-with-the-implicit-operator) section.
-
-- The `Explicit` operator, which defines the available narrowing conversions between types. For more information, see the [Explicit Conversion with the Explicit Operator](#explicit-conversion-with-the-explicit-operator) section.
-
-- The interface, which defines conversions to each of the base .NET data types. For more information, see [The IConvertible Interface](#the-iconvertible-interface) section.
-
-- The class, which provides a set of methods that implement the methods in the interface. For more information, see [The Convert Class](#the-convert-class) section.
-
-- The class, which is a base class that can be extended to support the conversion of a specified type to any other type. For more information, see [The TypeConverter Class](#the-typeconverter-class) section.
+Every value has an associated type, which defines attributes such as the amount of space allocated to the value, the range of possible values it can have, and the members that it makes available. Many values can be expressed as more than one type. For example, the value 4 can be expressed as an integer or a floating-point value. Type conversion creates a value in a new type that is equivalent to the value of an old type, but does not necessarily preserve the identity (or exact value) of the original object.
+
+.NET automatically supports the following conversions:
+
+- Conversion from a derived class to a base class. This means, for example, that an instance of any class or structure can be converted to an instance. This conversion does not require a casting or conversion operator.
+
+- Conversion from a base class back to the original derived class. In C#, this conversion requires a casting operator. In Visual Basic, it requires the `CType` operator if `Option Strict` is on.
+
+- Conversion from a type that implements an interface to an interface object that represents that interface. This conversion does not require a casting or conversion operator.
+
+- Conversion from an interface object back to the original type that implements that interface. In C#, this conversion requires a casting operator. In Visual Basic, it requires the `CType` operator if `Option Strict` is on.
+
+In addition to these automatic conversions, .NET provides several features that support custom type conversion. These include the following:
+
+- The `Implicit` operator, which defines the available widening conversions between types. For more information, see the [Implicit Conversion with the Implicit Operator](#implicit-conversion-with-the-implicit-operator) section.
+
+- The `Explicit` operator, which defines the available narrowing conversions between types. For more information, see the [Explicit Conversion with the Explicit Operator](#explicit-conversion-with-the-explicit-operator) section.
+
+- The interface, which defines conversions to each of the base .NET data types. For more information, see [The IConvertible Interface](#the-iconvertible-interface) section.
+
+- The class, which provides a set of methods that implement the methods in the interface. For more information, see [The Convert Class](#the-convert-class) section.
+
+- The class, which is a base class that can be extended to support the conversion of a specified type to any other type. For more information, see [The TypeConverter Class](#the-typeconverter-class) section.
## Implicit conversion with the implicit operator
-Widening conversions involve the creation of a new value from the value of an existing type that has either a more restrictive range or a more restricted member list than the target type. Widening conversions cannot result in data loss (although they may result in a loss of precision). Because data cannot be lost, compilers can handle the conversion implicitly or transparently, without requiring the use of an explicit conversion method or a casting operator.
-
+Widening conversions involve the creation of a new value from the value of an existing type that has either a more restrictive range or a more restricted member list than the target type. Widening conversions cannot result in data loss (although they may result in a loss of precision). Because data cannot be lost, compilers can handle the conversion implicitly or transparently, without requiring the use of an explicit conversion method or a casting operator.
+
> [!NOTE]
-> Although code that performs an implicit conversion can call a conversion method or use a casting operator, their use is not required by compilers that support implicit conversions.
-
- For example, the type supports implicit conversions from , , , , , , , , and values. The following example illustrates some of these implicit conversions in assigning values to a variable.
-
+> Although code that performs an implicit conversion can call a conversion method or use a casting operator, their use is not required by compilers that support implicit conversions.
+
+ For example, the type supports implicit conversions from , , , , , , , , and values. The following example illustrates some of these implicit conversions in assigning values to a variable.
+
[!code-csharp[Conceptual.Conversion#1](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.conversion/cs/implicit1.cs#1)]
- [!code-vb[Conceptual.Conversion#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/implicit1.vb#1)]
-
- If a particular language compiler supports custom operators, you can also define implicit conversions in your own custom types. The following example provides a partial implementation of a signed byte data type named `ByteWithSign` that uses sign-and-magnitude representation. It supports implicit conversion of and values to `ByteWithSign` values.
-
+ [!code-vb[Conceptual.Conversion#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/implicit1.vb#1)]
+
+ If a particular language compiler supports custom operators, you can also define implicit conversions in your own custom types. The following example provides a partial implementation of a signed byte data type named `ByteWithSign` that uses sign-and-magnitude representation. It supports implicit conversion of and values to `ByteWithSign` values.
+
[!code-csharp[Conceptual.Conversion#2](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.conversion/cs/implicit1.cs#2)]
- [!code-vb[Conceptual.Conversion#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/implicit1.vb#2)]
-
- Client code can then declare a `ByteWithSign` variable and assign it and values without performing any explicit conversions or using any casting operators, as the following example shows.
-
+ [!code-vb[Conceptual.Conversion#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/implicit1.vb#2)]
+
+ Client code can then declare a `ByteWithSign` variable and assign it and values without performing any explicit conversions or using any casting operators, as the following example shows.
+
[!code-csharp[Conceptual.Conversion#3](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.conversion/cs/implicit1.cs#3)]
- [!code-vb[Conceptual.Conversion#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/implicit1.vb#3)]
+ [!code-vb[Conceptual.Conversion#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/implicit1.vb#3)]
## Explicit conversion with the explicit operator
-Narrowing conversions involve the creation of a new value from the value of an existing type that has either a greater range or a larger member list than the target type. Because a narrowing conversion can result in a loss of data, compilers often require that the conversion be made explicit through a call to a conversion method or a casting operator. That is, the conversion must be handled explicitly in developer code.
-
+Narrowing conversions involve the creation of a new value from the value of an existing type that has either a greater range or a larger member list than the target type. Because a narrowing conversion can result in a loss of data, compilers often require that the conversion be made explicit through a call to a conversion method or a casting operator. That is, the conversion must be handled explicitly in developer code.
+
> [!NOTE]
-> The major purpose of requiring a conversion method or casting operator for narrowing conversions is to make the developer aware of the possibility of data loss or an so that it can be handled in code. However, some compilers can relax this requirement. For example, in Visual Basic, if `Option Strict` is off (its default setting), the Visual Basic compiler tries to perform narrowing conversions implicitly.
-
- For example, the , , and data types have ranges that exceed that the data type, as the following table shows.
-
-|Type|Comparison with range of Int32|
-|----------|------------------------------------|
-|| is greater than , and is less than (has a greater negative range than) .|
-|| is greater than .|
-|| is greater than .|
-
- To handle such narrowing conversions, .NET allows types to define an `Explicit` operator. Individual language compilers can then implement this operator using their own syntax, or a member of the class can be called to perform the conversion. (For more information about the class, see [The Convert Class](#the-convert-class) later in this topic.) The following example illustrates the use of language features to handle the explicit conversion of these potentially out-of-range integer values to values.
-
+> The major purpose of requiring a conversion method or casting operator for narrowing conversions is to make the developer aware of the possibility of data loss or an so that it can be handled in code. However, some compilers can relax this requirement. For example, in Visual Basic, if `Option Strict` is off (its default setting), the Visual Basic compiler tries to perform narrowing conversions implicitly.
+
+ For example, the , , and data types have ranges that exceed that the data type, as the following table shows.
+
+|Type|Comparison with range of Int32|
+|----------|------------------------------------|
+|| is greater than , and is less than (has a greater negative range than) .|
+|| is greater than .|
+|| is greater than .|
+
+ To handle such narrowing conversions, .NET allows types to define an `Explicit` operator. Individual language compilers can then implement this operator using their own syntax, or a member of the class can be called to perform the conversion. (For more information about the class, see [The Convert Class](#the-convert-class) later in this topic.) The following example illustrates the use of language features to handle the explicit conversion of these potentially out-of-range integer values to values.
+
[!code-csharp[Conceptual.Conversion#4](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.conversion/cs/explicit1.cs#4)]
- [!code-vb[Conceptual.Conversion#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/explicit1.vb#4)]
-
- Explicit conversions can produce different results in different languages, and these results can differ from the value returned by the corresponding method. For example, if the value 12.63251 is converted to an , both the Visual Basic `CInt` method and the .NET method round the to return a value of 13, but the C# `(int)` operator truncates the to return a value of 12. Similarly, the C# `(int)` operator does not support Boolean-to-integer conversion, but the Visual Basic `CInt` method converts a value of `true` to -1. On the other hand, the method converts a value of `true` to 1.
-
- Most compilers allow explicit conversions to be performed in a checked or unchecked manner. When a checked conversion is performed, an is thrown when the value of the type to be converted is outside the range of the target type. When an unchecked conversion is performed under the same conditions, the conversion might not throw an exception, but the exact behavior becomes undefined and an incorrect value might result.
-
+ [!code-vb[Conceptual.Conversion#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/explicit1.vb#4)]
+
+ Explicit conversions can produce different results in different languages, and these results can differ from the value returned by the corresponding method. For example, if the value 12.63251 is converted to an , both the Visual Basic `CInt` method and the .NET method round the to return a value of 13, but the C# `(int)` operator truncates the to return a value of 12. Similarly, the C# `(int)` operator does not support Boolean-to-integer conversion, but the Visual Basic `CInt` method converts a value of `true` to -1. On the other hand, the method converts a value of `true` to 1.
+
+ Most compilers allow explicit conversions to be performed in a checked or unchecked manner. When a checked conversion is performed, an is thrown when the value of the type to be converted is outside the range of the target type. When an unchecked conversion is performed under the same conditions, the conversion might not throw an exception, but the exact behavior becomes undefined and an incorrect value might result.
+
> [!NOTE]
-> In C#, checked conversions can be performed by using the `checked` keyword together with a casting operator, or by specifying the `/checked+` compiler option. Conversely, unchecked conversions can be performed by using the `unchecked` keyword together with the casting operator, or by specifying the `/checked-` compiler option. By default, explicit conversions are unchecked. In Visual Basic, checked conversions can be performed by clearing the **Remove integer overflow checks** check box in the project's **Advanced Compiler Settings** dialog box, or by specifying the `/removeintchecks-` compiler option. Conversely, unchecked conversions can be performed by selecting the **Remove integer overflow checks** check box in the project's **Advanced Compiler Settings** dialog box or by specifying the `/removeintchecks+` compiler option. By default, explicit conversions are checked.
-
- The following C# example uses the `checked` and `unchecked` keywords to illustrate the difference in behavior when a value outside the range of a is converted to a . The checked conversion throws an exception, but the unchecked conversion assigns to the variable.
-
- [!code-csharp[Conceptual.Conversion#12](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.conversion/cs/explicit1.cs#12)]
-
- If a particular language compiler supports custom overloaded operators, you can also define explicit conversions in your own custom types. The following example provides a partial implementation of a signed byte data type named `ByteWithSign` that uses sign-and-magnitude representation. It supports explicit conversion of and values to `ByteWithSign` values.
-
+> In C#, checked conversions can be performed by using the `checked` keyword together with a casting operator, or by specifying the `/checked+` compiler option. Conversely, unchecked conversions can be performed by using the `unchecked` keyword together with the casting operator, or by specifying the `/checked-` compiler option. By default, explicit conversions are unchecked. In Visual Basic, checked conversions can be performed by clearing the **Remove integer overflow checks** check box in the project's **Advanced Compiler Settings** dialog box, or by specifying the `/removeintchecks-` compiler option. Conversely, unchecked conversions can be performed by selecting the **Remove integer overflow checks** check box in the project's **Advanced Compiler Settings** dialog box or by specifying the `/removeintchecks+` compiler option. By default, explicit conversions are checked.
+
+ The following C# example uses the `checked` and `unchecked` keywords to illustrate the difference in behavior when a value outside the range of a is converted to a . The checked conversion throws an exception, but the unchecked conversion assigns to the variable.
+
+ [!code-csharp[Conceptual.Conversion#12](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.conversion/cs/explicit1.cs#12)]
+
+ If a particular language compiler supports custom overloaded operators, you can also define explicit conversions in your own custom types. The following example provides a partial implementation of a signed byte data type named `ByteWithSign` that uses sign-and-magnitude representation. It supports explicit conversion of and values to `ByteWithSign` values.
+
[!code-csharp[Conceptual.Conversion#5](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.conversion/cs/explicit1.cs#5)]
- [!code-vb[Conceptual.Conversion#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/explicit1.vb#5)]
-
- Client code can then declare a `ByteWithSign` variable and assign it and values if the assignments include a casting operator or a conversion method, as the following example shows.
-
+ [!code-vb[Conceptual.Conversion#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/explicit1.vb#5)]
+
+ Client code can then declare a `ByteWithSign` variable and assign it and values if the assignments include a casting operator or a conversion method, as the following example shows.
+
[!code-csharp[Conceptual.Conversion#6](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.conversion/cs/explicit1.cs#6)]
- [!code-vb[Conceptual.Conversion#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/explicit1.vb#6)]
+ [!code-vb[Conceptual.Conversion#6](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/explicit1.vb#6)]
## The IConvertible interface
-To support the conversion of any type to a common language runtime base type, .NET provides the interface. The implementing type is required to provide the following:
-
-- A method that returns the of the implementing type.
-
-- Methods to convert the implementing type to each common language runtime base type (, , , , , and so on).
-
-- A generalized conversion method to convert an instance of the implementing type to another specified type. Conversions that are not supported should throw an .
-
- Each common language runtime base type (that is, the , , , , , , , , , , , , , , and ), as well as the and types, implement the interface. However, these are explicit interface implementations; the conversion method can be called only through an interface variable, as the following example shows. This example converts an value to its equivalent value.
-
+To support the conversion of any type to a common language runtime base type, .NET provides the interface. The implementing type is required to provide the following:
+
+- A method that returns the of the implementing type.
+
+- Methods to convert the implementing type to each common language runtime base type (, , , , , and so on).
+
+- A generalized conversion method to convert an instance of the implementing type to another specified type. Conversions that are not supported should throw an .
+
+ Each common language runtime base type (that is, the , , , , , , , , , , , , , , and ), as well as the and types, implement the interface. However, these are explicit interface implementations; the conversion method can be called only through an interface variable, as the following example shows. This example converts an value to its equivalent value.
+
[!code-csharp[Conceptual.Conversion#7](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.conversion/cs/iconvertible1.cs#7)]
- [!code-vb[Conceptual.Conversion#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/iconvertible1.vb#7)]
-
- The requirement to call the conversion method on its interface rather than on the implementing type makes explicit interface implementations relatively expensive. Instead, we recommend that you call the appropriate member of the class to convert between common language runtime base types. For more information, see the next section, [The Convert Class](#the-convert-class).
-
+ [!code-vb[Conceptual.Conversion#7](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.conversion/vb/iconvertible1.vb#7)]
+
+ The requirement to call the conversion method on its interface rather than on the implementing type makes explicit interface implementations relatively expensive. Instead, we recommend that you call the appropriate member of the class to convert between common language runtime base types. For more information, see the next section, [The Convert Class](#the-convert-class).
+
> [!NOTE]
-> In addition to the interface and the class provided by .NET, individual languages may also provide ways to perform conversions. For example, C# uses casting operators; Visual Basic uses compiler-implemented conversion functions such as `CType`, `CInt`, and `DirectCast`.
-
+> In addition to the interface and the class provided by .NET, individual languages may also provide ways to perform conversions. For example, C# uses casting operators; Visual Basic uses compiler-implemented conversion functions such as `CType`, `CInt`, and `DirectCast`.
+
For the most part, the interface is designed to support conversion between the base types in .NET. However, the interface can also be implemented by a custom type to support conversion of that type to other custom types. For more information, see the section [Custom Conversions with the ChangeType Method](#custom-conversions-with-the-changetype-method) later in this topic.
## The Convert class
-Although each base type's interface implementation can be called to perform a type conversion, calling the methods of the class is the recommended language-neutral way to convert from one base type to another. In addition, the method can be used to convert from a specified custom type to another type.
-
+Although each base type's interface implementation can be called to perform a type conversion, calling the methods of the class is the recommended language-neutral way to convert from one base type to another. In addition, the method can be used to convert from a specified custom type to another type.
+
### Conversions between base types
-The class provides a language-neutral way to perform conversions between base types and is available to all languages that target the common language runtime. It provides a complete set of methods for both widening and narrowing conversions, and throws an for conversions that are not supported (such as the conversion of a value to an integer value). Narrowing conversions are performed in a checked context, and an is thrown if the conversion fails.
-
+The class provides a language-neutral way to perform conversions between base types and is available to all languages that target the common language runtime. It provides a complete set of methods for both widening and narrowing conversions, and throws an for conversions that are not supported (such as the conversion of a value to an integer value). Narrowing conversions are performed in a checked context, and an