diff --git a/.github/workflows/check-for-build-warnings.yml b/.github/workflows/check-for-build-warnings.yml index 84c9b1372021e..404fdcecbe119 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@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/cleanrepo-orphaned-articles.yml b/.github/workflows/cleanrepo-orphaned-articles.yml index 6e34b80d4a256..c11af177eec4a 100644 --- a/.github/workflows/cleanrepo-orphaned-articles.yml +++ b/.github/workflows/cleanrepo-orphaned-articles.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/cleanrepo-orphaned-images.yml b/.github/workflows/cleanrepo-orphaned-images.yml index 991552cedf192..f75c8f097ca88 100644 --- a/.github/workflows/cleanrepo-orphaned-images.yml +++ b/.github/workflows/cleanrepo-orphaned-images.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/cleanrepo-orphaned-includes.yml b/.github/workflows/cleanrepo-orphaned-includes.yml index 839749711af01..b7c6a5689b3de 100644 --- a/.github/workflows/cleanrepo-orphaned-includes.yml +++ b/.github/workflows/cleanrepo-orphaned-includes.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/cleanrepo-orphaned-snippets.yml b/.github/workflows/cleanrepo-orphaned-snippets.yml index 092dac8bba21e..0e9524e71d0a7 100644 --- a/.github/workflows/cleanrepo-orphaned-snippets.yml +++ b/.github/workflows/cleanrepo-orphaned-snippets.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/cleanrepo-redirect-hops.yml b/.github/workflows/cleanrepo-redirect-hops.yml index 629df7b1a717e..88f080c660f9b 100644 --- a/.github/workflows/cleanrepo-redirect-hops.yml +++ b/.github/workflows/cleanrepo-redirect-hops.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/cleanrepo-relative-links.yml b/.github/workflows/cleanrepo-relative-links.yml index 8f29a59384809..44fa28bb6e32e 100644 --- a/.github/workflows/cleanrepo-relative-links.yml +++ b/.github/workflows/cleanrepo-relative-links.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/cleanrepo-replace-redirects.yml b/.github/workflows/cleanrepo-replace-redirects.yml index a78705b7c8039..7b79aeb4ae90c 100644 --- a/.github/workflows/cleanrepo-replace-redirects.yml +++ b/.github/workflows/cleanrepo-replace-redirects.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/dependabot-bot.yml b/.github/workflows/dependabot-bot.yml index e72b58552f4df..a6c86b473cf13 100644 --- a/.github/workflows/dependabot-bot.yml +++ b/.github/workflows/dependabot-bot.yml @@ -26,7 +26,7 @@ jobs: # Checkout the repo into the workspace within the VM steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 922916c510160..1b495dbce772e 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/do-not-merge-label-check.yml b/.github/workflows/do-not-merge-label-check.yml index af74e91740a62..630a7b04b6a40 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@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/docs-verifier.yml b/.github/workflows/docs-verifier.yml index 9ed38c4d3eca0..68f6bc1a33270 100644 --- a/.github/workflows/docs-verifier.yml +++ b/.github/workflows/docs-verifier.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/live-protection.yml b/.github/workflows/live-protection.yml index 6213b84ea1798..38bdd4e23e5c5 100644 --- a/.github/workflows/live-protection.yml +++ b/.github/workflows/live-protection.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index 5b0a0f3d54dfb..49040588cea36 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -22,12 +22,12 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: DavidAnson/markdownlint-cli2-action@a23dae216ce3fee4db69da41fed90d2a4af801cf # v19.0.0 + - uses: DavidAnson/markdownlint-cli2-action@05f32210e84442804257b2a6f20b273450ec8265 # v19.1.0 with: config: ".markdownlint-cli2.jsonc" globs: "**/*.md" diff --git a/.github/workflows/profanity-filter.yml b/.github/workflows/profanity-filter.yml index b98ae5f309240..3ce7f738f830c 100644 --- a/.github/workflows/profanity-filter.yml +++ b/.github/workflows/profanity-filter.yml @@ -19,13 +19,13 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit - name: Profanity filter if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'github-actions[bot]' }} - uses: IEvangelist/profanity-filter@e370e4ba671feb530a5481b4595413c7fd032b9b # main + uses: IEvangelist/profanity-filter@16d90c28e18f1c583c067be61506d24e13d18cb8 # main id: profanity-filter with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/quest-bulk.yml b/.github/workflows/quest-bulk.yml index fd5dff756cff3..33928ce1eaf9c 100644 --- a/.github/workflows/quest-bulk.yml +++ b/.github/workflows/quest-bulk.yml @@ -26,7 +26,7 @@ jobs: if: ${{ github.repository_owner == 'dotnet' }} steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/quest.yml b/.github/workflows/quest.yml index d09567f1f15d0..f1cfb319b1340 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@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 59f6832663a63..89d7f8db95759 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -31,7 +31,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit @@ -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@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1 + uses: github/codeql-action/upload-sarif@d68b2d4edb4189fd2a5366ac14e72027bd4b37dd # v3.28.2 with: sarif_file: results.sarif diff --git a/.github/workflows/snippets5000.yml b/.github/workflows/snippets5000.yml index aea8d75c34db2..a97fe3924add0 100644 --- a/.github/workflows/snippets5000.yml +++ b/.github/workflows/snippets5000.yml @@ -31,7 +31,7 @@ jobs: steps: # Checkout the repository for the PR - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 982441c02e154..2017d293faadb 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@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit - - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e + - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 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 b26c74a62bcc4..35a5084201d79 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@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/.github/workflows/whats-new.yml b/.github/workflows/whats-new.yml index b2dcce24d1563..22d31435a4ecf 100644 --- a/.github/workflows/whats-new.yml +++ b/.github/workflows/whats-new.yml @@ -23,7 +23,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 with: egress-policy: audit diff --git a/docs/azure/includes/dotnet-all.md b/docs/azure/includes/dotnet-all.md index 81b068d8635cc..fac02198fc347 100644 --- a/docs/azure/includes/dotnet-all.md +++ b/docs/azure/includes/dotnet-all.md @@ -40,7 +40,7 @@ | Digital Twins | NuGet [1.4.0](https://www.nuget.org/packages/Azure.DigitalTwins.Core/1.4.0) | [docs](/dotnet/api/overview/azure/DigitalTwins.Core-readme) | GitHub [1.4.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.DigitalTwins.Core_1.4.0/sdk/digitaltwins/Azure.DigitalTwins.Core/) | | Document Intelligence | NuGet [1.0.0](https://www.nuget.org/packages/Azure.AI.DocumentIntelligence/1.0.0) | [docs](/dotnet/api/overview/azure/AI.DocumentIntelligence-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.DocumentIntelligence_1.0.0/sdk/documentintelligence/Azure.AI.DocumentIntelligence/) | | Document Translation | NuGet [2.0.0](https://www.nuget.org/packages/Azure.AI.Translation.Document/2.0.0) | [docs](/dotnet/api/overview/azure/AI.Translation.Document-readme) | GitHub [2.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Translation.Document_2.0.0/sdk/translation/Azure.AI.Translation.Document/) | -| Event Grid | NuGet [4.28.0](https://www.nuget.org/packages/Azure.Messaging.EventGrid/4.28.0) | [docs](/dotnet/api/overview/azure/Messaging.EventGrid-readme) | GitHub [4.28.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventGrid_4.28.0/sdk/eventgrid/Azure.Messaging.EventGrid/) | +| Event Grid | NuGet [4.29.0](https://www.nuget.org/packages/Azure.Messaging.EventGrid/4.29.0) | [docs](/dotnet/api/overview/azure/Messaging.EventGrid-readme) | GitHub [4.29.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventGrid_4.29.0/sdk/eventgrid/Azure.Messaging.EventGrid/) | | Event Grid Namespaces | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Messaging.EventGrid.Namespaces/1.0.0) | [docs](/dotnet/api/overview/azure/Messaging.EventGrid.Namespaces-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventGrid.Namespaces_1.0.0/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/) | | Event Hubs | NuGet [5.11.5](https://www.nuget.org/packages/Azure.Messaging.EventHubs/5.11.5)
NuGet [5.12.0-beta.1](https://www.nuget.org/packages/Azure.Messaging.EventHubs/5.12.0-beta.1) | [docs](/dotnet/api/overview/azure/Messaging.EventHubs-readme) | GitHub [5.11.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventHubs_5.11.5/sdk/eventhub/Azure.Messaging.EventHubs/)
GitHub [5.12.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventHubs_5.12.0-beta.1/sdk/eventhub/Azure.Messaging.EventHubs/) | | Event Hubs - Event Processor | NuGet [5.11.5](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor/5.11.5)
NuGet [5.12.0-beta.1](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor/5.12.0-beta.1) | [docs](/dotnet/api/overview/azure/Messaging.EventHubs.Processor-readme) | GitHub [5.11.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventHubs.Processor_5.11.5/sdk/eventhub/Azure.Messaging.EventHubs.Processor/)
GitHub [5.12.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventHubs.Processor_5.12.0-beta.1/sdk/eventhub/Azure.Messaging.EventHubs.Processor/) | @@ -130,7 +130,7 @@ | WebJobs Extensions - Event Hubs | NuGet [6.3.5](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.EventHubs/6.3.5) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.EventHubs-readme) | GitHub [6.3.5](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.EventHubs_6.3.5/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/) | | WebJobs Extensions - Service Bus | NuGet [5.16.4](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.ServiceBus/5.16.4) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.ServiceBus-readme) | GitHub [5.16.4](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.ServiceBus_5.16.4/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/) | | WebJobs Extensions - SignalR Service | NuGet [1.14.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.SignalRService/1.14.0) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.SignalRService-readme) | GitHub [1.14.0](https://github.com/Azure/azure-functions-signalrservice-extension/tree/v1.2.0/src/SignalRServiceExtension) | -| WebJobs Extensions - Storage | NuGet [5.3.2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Storage/5.3.2) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.Storage-readme) | GitHub [5.3.2](https://github.com/Azure/azure-webjobs-sdk/tree/master/src/Microsoft.Azure.WebJobs.Extensions.Storage) | +| WebJobs Extensions - Storage | NuGet [5.3.3](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Storage/5.3.3) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.Storage-readme) | GitHub [5.3.3](https://github.com/Azure/azure-webjobs-sdk/tree/master/src/Microsoft.Azure.WebJobs.Extensions.Storage) | | WebJobs Extensions - Web PubSub | NuGet [1.8.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSub/1.8.0) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.WebPubSub-readme) | GitHub [1.8.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.WebPubSub_1.8.0/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/) | | Functions extension for Blob Storage | NuGet [5.3.3](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/5.3.3) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs-readme) | GitHub [5.3.3](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs_5.3.3/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/) | | Functions extension for Storage Queues | NuGet [5.3.3](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/5.3.3) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.Storage.Queues-readme) | GitHub [5.3.3](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.Storage.Queues_5.3.3/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/) | @@ -259,7 +259,7 @@ | Resource Management - IoT Hub | NuGet [1.1.1](https://www.nuget.org/packages/Azure.ResourceManager.IotHub/1.1.1)
NuGet [1.2.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.IotHub/1.2.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.IotHub-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.IotHub_1.1.1/sdk/iothub/Azure.ResourceManager.IotHub/)
GitHub [1.2.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.IotHub_1.2.0-beta.1/sdk/iothub/Azure.ResourceManager.IotHub/) | | Resource Management - Key Vault | NuGet [1.3.0](https://www.nuget.org/packages/Azure.ResourceManager.KeyVault/1.3.0) | [docs](/dotnet/api/overview/azure/ResourceManager.KeyVault-readme) | GitHub [1.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.KeyVault_1.3.0/sdk/keyvault/Azure.ResourceManager.KeyVault/) | | Resource Management - Kubernetes Configuration | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.KubernetesConfiguration/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.KubernetesConfiguration-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.KubernetesConfiguration_1.2.0/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/) | -| Resource Management - Kusto | NuGet [1.5.1](https://www.nuget.org/packages/Azure.ResourceManager.Kusto/1.5.1) | [docs](/dotnet/api/overview/azure/ResourceManager.Kusto-readme) | GitHub [1.5.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Kusto_1.5.1/sdk/kusto/Azure.ResourceManager.Kusto/) | +| Resource Management - Kusto | NuGet [1.6.0](https://www.nuget.org/packages/Azure.ResourceManager.Kusto/1.6.0) | [docs](/dotnet/api/overview/azure/ResourceManager.Kusto-readme) | GitHub [1.6.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Kusto_1.6.0/sdk/kusto/Azure.ResourceManager.Kusto/) | | Resource Management - Lab Services | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.LabServices/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.LabServices-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.LabServices_1.1.0/sdk/labservices/Azure.ResourceManager.LabServices/) | | Resource Management - Large Instance | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.LargeInstance/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.LargeInstance-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.LargeInstance_1.0.0-beta.1/sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/) | | Resource Management - Load Testing | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.LoadTesting/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.LoadTesting-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.LoadTesting_1.1.0/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/) | diff --git a/docs/azure/includes/dotnet-new.md b/docs/azure/includes/dotnet-new.md index 91864963e0844..255e183cff914 100644 --- a/docs/azure/includes/dotnet-new.md +++ b/docs/azure/includes/dotnet-new.md @@ -41,7 +41,7 @@ | Digital Twins | NuGet [1.4.0](https://www.nuget.org/packages/Azure.DigitalTwins.Core/1.4.0) | [docs](/dotnet/api/overview/azure/DigitalTwins.Core-readme) | GitHub [1.4.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.DigitalTwins.Core_1.4.0/sdk/digitaltwins/Azure.DigitalTwins.Core/) | | Document Intelligence | NuGet [1.0.0](https://www.nuget.org/packages/Azure.AI.DocumentIntelligence/1.0.0) | [docs](/dotnet/api/overview/azure/AI.DocumentIntelligence-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.DocumentIntelligence_1.0.0/sdk/documentintelligence/Azure.AI.DocumentIntelligence/) | | Document Translation | NuGet [2.0.0](https://www.nuget.org/packages/Azure.AI.Translation.Document/2.0.0) | [docs](/dotnet/api/overview/azure/AI.Translation.Document-readme) | GitHub [2.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Translation.Document_2.0.0/sdk/translation/Azure.AI.Translation.Document/) | -| Event Grid | NuGet [4.28.0](https://www.nuget.org/packages/Azure.Messaging.EventGrid/4.28.0) | [docs](/dotnet/api/overview/azure/Messaging.EventGrid-readme) | GitHub [4.28.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventGrid_4.28.0/sdk/eventgrid/Azure.Messaging.EventGrid/) | +| Event Grid | NuGet [4.29.0](https://www.nuget.org/packages/Azure.Messaging.EventGrid/4.29.0) | [docs](/dotnet/api/overview/azure/Messaging.EventGrid-readme) | GitHub [4.29.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventGrid_4.29.0/sdk/eventgrid/Azure.Messaging.EventGrid/) | | Event Grid Namespaces | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Messaging.EventGrid.Namespaces/1.0.0) | [docs](/dotnet/api/overview/azure/Messaging.EventGrid.Namespaces-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventGrid.Namespaces_1.0.0/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/) | | Event Hubs | NuGet [5.11.5](https://www.nuget.org/packages/Azure.Messaging.EventHubs/5.11.5)
NuGet [5.12.0-beta.1](https://www.nuget.org/packages/Azure.Messaging.EventHubs/5.12.0-beta.1) | [docs](/dotnet/api/overview/azure/Messaging.EventHubs-readme) | GitHub [5.11.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventHubs_5.11.5/sdk/eventhub/Azure.Messaging.EventHubs/)
GitHub [5.12.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventHubs_5.12.0-beta.1/sdk/eventhub/Azure.Messaging.EventHubs/) | | Event Hubs - Event Processor | NuGet [5.11.5](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor/5.11.5)
NuGet [5.12.0-beta.1](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor/5.12.0-beta.1) | [docs](/dotnet/api/overview/azure/Messaging.EventHubs.Processor-readme) | GitHub [5.11.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventHubs.Processor_5.11.5/sdk/eventhub/Azure.Messaging.EventHubs.Processor/)
GitHub [5.12.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Messaging.EventHubs.Processor_5.12.0-beta.1/sdk/eventhub/Azure.Messaging.EventHubs.Processor/) | @@ -135,7 +135,7 @@ | WebJobs Extensions - Event Hubs | NuGet [6.3.5](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.EventHubs/6.3.5) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.EventHubs-readme) | GitHub [6.3.5](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.EventHubs_6.3.5/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/) | | WebJobs Extensions - Service Bus | NuGet [5.16.4](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.ServiceBus/5.16.4) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.ServiceBus-readme) | GitHub [5.16.4](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.ServiceBus_5.16.4/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/) | | WebJobs Extensions - SignalR Service | NuGet [1.14.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.SignalRService/1.14.0) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.SignalRService-readme) | GitHub [1.14.0](https://github.com/Azure/azure-functions-signalrservice-extension/tree/v1.2.0/src/SignalRServiceExtension) | -| WebJobs Extensions - Storage | NuGet [5.3.2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Storage/5.3.2) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.Storage-readme) | GitHub [5.3.2](https://github.com/Azure/azure-webjobs-sdk/tree/master/src/Microsoft.Azure.WebJobs.Extensions.Storage) | +| WebJobs Extensions - Storage | NuGet [5.3.3](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Storage/5.3.3) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.Storage-readme) | GitHub [5.3.3](https://github.com/Azure/azure-webjobs-sdk/tree/master/src/Microsoft.Azure.WebJobs.Extensions.Storage) | | WebJobs Extensions - Web PubSub | NuGet [1.8.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSub/1.8.0) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.WebPubSub-readme) | GitHub [1.8.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.WebPubSub_1.8.0/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/) | | Functions extension for Blob Storage | NuGet [5.3.3](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/5.3.3) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs-readme) | GitHub [5.3.3](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs_5.3.3/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/) | | Functions extension for Storage Queues | NuGet [5.3.3](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/5.3.3) | [docs](/dotnet/api/overview/azure/Microsoft.Azure.WebJobs.Extensions.Storage.Queues-readme) | GitHub [5.3.3](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.WebJobs.Extensions.Storage.Queues_5.3.3/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/) | @@ -266,7 +266,7 @@ | Resource Management - IoT Hub | NuGet [1.1.1](https://www.nuget.org/packages/Azure.ResourceManager.IotHub/1.1.1)
NuGet [1.2.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.IotHub/1.2.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.IotHub-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.IotHub_1.1.1/sdk/iothub/Azure.ResourceManager.IotHub/)
GitHub [1.2.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.IotHub_1.2.0-beta.1/sdk/iothub/Azure.ResourceManager.IotHub/) | | Resource Management - Key Vault | NuGet [1.3.0](https://www.nuget.org/packages/Azure.ResourceManager.KeyVault/1.3.0) | [docs](/dotnet/api/overview/azure/ResourceManager.KeyVault-readme) | GitHub [1.3.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.KeyVault_1.3.0/sdk/keyvault/Azure.ResourceManager.KeyVault/) | | Resource Management - Kubernetes Configuration | NuGet [1.2.0](https://www.nuget.org/packages/Azure.ResourceManager.KubernetesConfiguration/1.2.0) | [docs](/dotnet/api/overview/azure/ResourceManager.KubernetesConfiguration-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.KubernetesConfiguration_1.2.0/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/) | -| Resource Management - Kusto | NuGet [1.5.1](https://www.nuget.org/packages/Azure.ResourceManager.Kusto/1.5.1) | [docs](/dotnet/api/overview/azure/ResourceManager.Kusto-readme) | GitHub [1.5.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Kusto_1.5.1/sdk/kusto/Azure.ResourceManager.Kusto/) | +| Resource Management - Kusto | NuGet [1.6.0](https://www.nuget.org/packages/Azure.ResourceManager.Kusto/1.6.0) | [docs](/dotnet/api/overview/azure/ResourceManager.Kusto-readme) | GitHub [1.6.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.Kusto_1.6.0/sdk/kusto/Azure.ResourceManager.Kusto/) | | Resource Management - Lab Services | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.LabServices/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.LabServices-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.LabServices_1.1.0/sdk/labservices/Azure.ResourceManager.LabServices/) | | Resource Management - Large Instance | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.ResourceManager.LargeInstance/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/ResourceManager.LargeInstance-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.LargeInstance_1.0.0-beta.1/sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/) | | Resource Management - Load Testing | NuGet [1.1.0](https://www.nuget.org/packages/Azure.ResourceManager.LoadTesting/1.1.0) | [docs](/dotnet/api/overview/azure/ResourceManager.LoadTesting-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.ResourceManager.LoadTesting_1.1.0/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/) | diff --git a/docs/azure/sdk/snippets/aspnetcore-guidance/BlazorSample/BlazorSample.csproj b/docs/azure/sdk/snippets/aspnetcore-guidance/BlazorSample/BlazorSample.csproj index c48e2ca5243cc..7d0ed8a290c20 100644 --- a/docs/azure/sdk/snippets/aspnetcore-guidance/BlazorSample/BlazorSample.csproj +++ b/docs/azure/sdk/snippets/aspnetcore-guidance/BlazorSample/BlazorSample.csproj @@ -7,7 +7,7 @@ - + diff --git a/docs/azure/sdk/snippets/aspnetcore-guidance/MinApiSample/MinApiSample.csproj b/docs/azure/sdk/snippets/aspnetcore-guidance/MinApiSample/MinApiSample.csproj index c835802c1be77..d25f2aab6ae13 100644 --- a/docs/azure/sdk/snippets/aspnetcore-guidance/MinApiSample/MinApiSample.csproj +++ b/docs/azure/sdk/snippets/aspnetcore-guidance/MinApiSample/MinApiSample.csproj @@ -8,7 +8,7 @@ - + diff --git a/docs/azure/sdk/snippets/unit-testing/UnitTestingSampleApp.csproj b/docs/azure/sdk/snippets/unit-testing/UnitTestingSampleApp.csproj index 5a4719a4a0133..1a7285c0a1533 100644 --- a/docs/azure/sdk/snippets/unit-testing/UnitTestingSampleApp.csproj +++ b/docs/azure/sdk/snippets/unit-testing/UnitTestingSampleApp.csproj @@ -20,7 +20,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/docs/core/compatibility/sdk/5.0/override-windows-sdk-package-version.md b/docs/core/compatibility/sdk/5.0/override-windows-sdk-package-version.md index 86b930d255155..ce502a9bfabd2 100644 --- a/docs/core/compatibility/sdk/5.0/override-windows-sdk-package-version.md +++ b/docs/core/compatibility/sdk/5.0/override-windows-sdk-package-version.md @@ -47,6 +47,8 @@ This change was introduced to simplify the package override behavior for targeti Remove any use of `FrameworkReference` in your .NET 5+ app's project file when targeting the Windows SDK. +When working with the [Windows App SDK](https://github.com/microsoft/WindowsAppSDK), you might need to explicitly add the `WindowsSdkPackageVersion` property if the required [Windows SDK package](https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref) version cannot be resolved by .NET SDK. This issue can arise due to different release mechanisms for the Windows App SDK and .NET SDK, where the .NET SDK is shipped through Visual Studio. See details in this [GitHub issue](https://github.com/microsoft/WindowsAppSDK/issues/4734). You might also consider removing the `WindowsSdkPackageVersion` property once the required Windows SDK package version has been resolved by .NET SDK, ensuring you have the latest Windows SDK package. This typically happens after Visual Studio releases a new version and you've upgraded to that version. + ## Affected APIs Windows APIs in .NET 5 and later versions that are provided by the [Windows SDK targeting package](https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref). diff --git a/docs/core/diagnostics/snippets/OTLP-Example/csharp/OTLP-Example.csproj b/docs/core/diagnostics/snippets/OTLP-Example/csharp/OTLP-Example.csproj index 1ba5ea0ba76a2..f0410394aa6e5 100644 --- a/docs/core/diagnostics/snippets/OTLP-Example/csharp/OTLP-Example.csproj +++ b/docs/core/diagnostics/snippets/OTLP-Example/csharp/OTLP-Example.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/docs/core/diagnostics/snippets/OTel-Prometheus-Grafana-Jaeger/csharp/OTel-Prometheus-Grafana-Jaeger.csproj b/docs/core/diagnostics/snippets/OTel-Prometheus-Grafana-Jaeger/csharp/OTel-Prometheus-Grafana-Jaeger.csproj index 6be66a16631e9..eb91f1e89a5c8 100644 --- a/docs/core/diagnostics/snippets/OTel-Prometheus-Grafana-Jaeger/csharp/OTel-Prometheus-Grafana-Jaeger.csproj +++ b/docs/core/diagnostics/snippets/OTel-Prometheus-Grafana-Jaeger/csharp/OTel-Prometheus-Grafana-Jaeger.csproj @@ -13,11 +13,11 @@ - - + + - - + + diff --git a/docs/core/extensions/snippets/ai/ConsoleAI.CustomEmbeddingsMiddle/ConsoleAI.CustomEmbeddingsMiddle.csproj b/docs/core/extensions/snippets/ai/ConsoleAI.CustomEmbeddingsMiddle/ConsoleAI.CustomEmbeddingsMiddle.csproj index dfd7ef5d1f522..6f2d3980a233b 100644 --- a/docs/core/extensions/snippets/ai/ConsoleAI.CustomEmbeddingsMiddle/ConsoleAI.CustomEmbeddingsMiddle.csproj +++ b/docs/core/extensions/snippets/ai/ConsoleAI.CustomEmbeddingsMiddle/ConsoleAI.CustomEmbeddingsMiddle.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/core/extensions/snippets/ai/ConsoleAI.FunctionalityPipelines/ConsoleAI.FunctionalityPipelines.csproj b/docs/core/extensions/snippets/ai/ConsoleAI.FunctionalityPipelines/ConsoleAI.FunctionalityPipelines.csproj index 2e19e010cf62b..ab64ab1f4841c 100644 --- a/docs/core/extensions/snippets/ai/ConsoleAI.FunctionalityPipelines/ConsoleAI.FunctionalityPipelines.csproj +++ b/docs/core/extensions/snippets/ai/ConsoleAI.FunctionalityPipelines/ConsoleAI.FunctionalityPipelines.csproj @@ -10,7 +10,7 @@ - + diff --git a/docs/core/extensions/snippets/ai/ConsoleAI.UseTelemetry/ConsoleAI.UseTelemetry.csproj b/docs/core/extensions/snippets/ai/ConsoleAI.UseTelemetry/ConsoleAI.UseTelemetry.csproj index b97375a313615..bb178fe3d7cc8 100644 --- a/docs/core/extensions/snippets/ai/ConsoleAI.UseTelemetry/ConsoleAI.UseTelemetry.csproj +++ b/docs/core/extensions/snippets/ai/ConsoleAI.UseTelemetry/ConsoleAI.UseTelemetry.csproj @@ -8,7 +8,7 @@ - + diff --git a/docs/core/extensions/snippets/logging/getting-started-open-telemetry/getting-started-open-telemetry.csproj b/docs/core/extensions/snippets/logging/getting-started-open-telemetry/getting-started-open-telemetry.csproj index 27808aa918f0c..1d4141e4e12db 100644 --- a/docs/core/extensions/snippets/logging/getting-started-open-telemetry/getting-started-open-telemetry.csproj +++ b/docs/core/extensions/snippets/logging/getting-started-open-telemetry/getting-started-open-telemetry.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/core/testing/mstest-analyzers/mstest0035.md b/docs/core/testing/mstest-analyzers/mstest0035.md index 5799b725339e0..8f7cd315d3f7f 100644 --- a/docs/core/testing/mstest-analyzers/mstest0035.md +++ b/docs/core/testing/mstest-analyzers/mstest0035.md @@ -1,5 +1,5 @@ --- -title: "[DeploymentItem] can be specified only on test class or test method." +title: "MSTEST0035: [DeploymentItem] can be specified only on test class or test method." description: "Learn about code analysis rule MSTEST0035: `[DeploymentItem]` can be specified only on test class or test method." ms.date: 08/02/2024 f1_keywords: diff --git a/docs/core/testing/mstest-analyzers/mstest0036.md b/docs/core/testing/mstest-analyzers/mstest0036.md index c6f38fad5f3b2..bd19254747486 100644 --- a/docs/core/testing/mstest-analyzers/mstest0036.md +++ b/docs/core/testing/mstest-analyzers/mstest0036.md @@ -1,5 +1,5 @@ --- -title: "Do not use shadowing inside test class." +title: "MSTEST0036: Do not use shadowing inside test class." description: "Learn about code analysis rule MSTEST0036: Do not use shadowing inside test class." ms.date: 08/19/2024 f1_keywords: diff --git a/docs/core/testing/mstest-analyzers/mstest0037.md b/docs/core/testing/mstest-analyzers/mstest0037.md index d43323fe80205..7194da83ff2c2 100644 --- a/docs/core/testing/mstest-analyzers/mstest0037.md +++ b/docs/core/testing/mstest-analyzers/mstest0037.md @@ -1,5 +1,5 @@ --- -title: "Use proper 'Assert' methods" +title: "MSTEST0037: Use proper 'Assert' methods" description: "Learn about code analysis rule MSTEST0037: Use proper 'Assert' methods." ms.date: 11/17/2024 f1_keywords: diff --git a/docs/core/testing/mstest-analyzers/mstest0038.md b/docs/core/testing/mstest-analyzers/mstest0038.md index 09423518792da..d0f0e5b6c06bc 100644 --- a/docs/core/testing/mstest-analyzers/mstest0038.md +++ b/docs/core/testing/mstest-analyzers/mstest0038.md @@ -1,5 +1,5 @@ --- -title: "Don't use 'Assert.AreSame' or 'Assert.AreNotSame' with value types" +title: "MSTEST0038: Don't use 'Assert.AreSame' or 'Assert.AreNotSame' with value types" description: "Learn about code analysis rule MSTEST0038: Don't use 'Assert.AreSame' or 'Assert.AreNotSame' with value types" ms.date: 01/06/2025 f1_keywords: diff --git a/docs/core/testing/mstest-analyzers/mstest0039.md b/docs/core/testing/mstest-analyzers/mstest0039.md new file mode 100644 index 0000000000000..e6f63c5d5762f --- /dev/null +++ b/docs/core/testing/mstest-analyzers/mstest0039.md @@ -0,0 +1,41 @@ +--- +title: "MSTEST0039: Use newer 'Assert.Throws' methods" +description: "Learn about code analysis rule MSTEST0039: Use 'Assert.ThrowsExactly' instead of 'Assert.ThrowsException'" +ms.date: 01/17/2025 +f1_keywords: +- MSTEST0039 +- UseNewerAssertThrowsAnalyzer +helpviewer_keywords: +- UseNewerAssertThrowsAnalyzer +- MSTEST0039 +author: Youssef1313 +ms.author: ygerges +--- +# MSTEST0039: Use newer 'Assert.Throws' methods + +| Property | Value | +|-------------------------------------|------------------------------------------------------------------------| +| **Rule ID** | MSTEST0039 | +| **Title** | Use newer 'Assert.Throws' methods | +| **Category** | Usage | +| **Fix is breaking or non-breaking** | Non-breaking | +| **Enabled by default** | Yes | +| **Default severity** | Info | +| **Introduced in version** | 3.8.0 | +| **Is there a code fix** | Yes | + +## Cause + +The use of or , which are no longer recommended. + +## Rule description + + and are not recommended and might be deprecated in the future. + +## How to fix violations + +Use `Assert.ThrowsExactly` or `Assert.ThrowsExactlyAsync` instead of `Assert.ThrowsException` or `Assert.ThrowsExceptionAsync`. + +## When to suppress warnings + +Do not suppress a warning from this rule. It's strongly recommended to move from the old APIs to the new ones. diff --git a/docs/core/testing/mstest-analyzers/mstest0040.md b/docs/core/testing/mstest-analyzers/mstest0040.md new file mode 100644 index 0000000000000..74bb770e9bc27 --- /dev/null +++ b/docs/core/testing/mstest-analyzers/mstest0040.md @@ -0,0 +1,41 @@ +--- +title: "MSTEST0040: Do not assert inside 'async void' contexts" +description: "Learn about code analysis rule MSTEST0040: Do not assert inside 'async void' methods, local functions, or lambdas because they may not fail the test" +ms.date: 01/17/2025 +f1_keywords: +- MSTEST0040 +- AvoidUsingAssertsInAsyncVoidContextAnalyzer +helpviewer_keywords: +- AvoidUsingAssertsInAsyncVoidContextAnalyzer +- MSTEST0040 +author: Youssef1313 +ms.author: ygerges +--- +# MSTEST0040: Do not assert inside 'async void' contexts + +| Property | Value | +|-------------------------------------|------------------------------------------------------------------------| +| **Rule ID** | MSTEST0040 | +| **Title** | Do not assert inside 'async void' contexts | +| **Category** | Usage | +| **Fix is breaking or non-breaking** | Non-breaking | +| **Enabled by default** | Yes | +| **Default severity** | Warning | +| **Introduced in version** | 3.8.0 | +| **Is there a code fix** | No | + +## Cause + +The use of any assertion method in an `async void` method, local function, or lambda. + +## Rule description + +Exceptions that are thrown in an `async void` context are unhandled. A failing assertion in an `async void` method will be swallowed and will not crash the process when using VSTest under .NET Framework. Under .NET, a failing assertion in an `async void` method might crash the process when using Microsoft.Testing.Platform or VSTest. In cases where a custom `SynchronizationContext` is present that catches the exception, the failing assertion might be silently swallowed. + +## How to fix violations + +Refactor the code to not use assertions in `async void`. + +## When to suppress warnings + +Do not suppress a warning from this rule. diff --git a/docs/core/testing/mstest-analyzers/usage-rules.md b/docs/core/testing/mstest-analyzers/usage-rules.md index cbd2bdfa23b9a..8df56f13079bb 100644 --- a/docs/core/testing/mstest-analyzers/usage-rules.md +++ b/docs/core/testing/mstest-analyzers/usage-rules.md @@ -35,3 +35,5 @@ Identifier | Name | Description [MSTEST0035](mstest0035.md) | UseDeploymentItemWithTestMethodOrTestClassTitle | `[DeploymentItem]` can be specified only on test class or test method [MSTEST0037](mstest0037.md) | UseProperAssertMethodsAnalyzer | Use proper `Assert` methods [MSTEST0038](mstest0038.md) | AvoidAssertAreSameWithValueTypesAnalyzer | Don't use `Assert.AreSame` or `Assert.AreNotSame` with value types +[MSTEST0039](mstest0039.md) | UseNewerAssertThrowsAnalyzer | Use newer 'Assert.Throws' methods +[MSTEST0040](mstest0040.md) | AvoidUsingAssertsInAsyncVoidContextAnalyzer | Do not assert inside 'async void' contexts diff --git a/docs/core/testing/snippets/order-unit-tests/csharp/MSTest.Project/MSTest.Project.csproj b/docs/core/testing/snippets/order-unit-tests/csharp/MSTest.Project/MSTest.Project.csproj index d825789ebf68b..73e6027192e35 100644 --- a/docs/core/testing/snippets/order-unit-tests/csharp/MSTest.Project/MSTest.Project.csproj +++ b/docs/core/testing/snippets/order-unit-tests/csharp/MSTest.Project/MSTest.Project.csproj @@ -9,9 +9,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/docs/core/testing/snippets/order-unit-tests/csharp/XUnit.TestProject/XUnit.Project.csproj b/docs/core/testing/snippets/order-unit-tests/csharp/XUnit.TestProject/XUnit.Project.csproj index af13e3c5d6827..fc58a0a4da1b7 100644 --- a/docs/core/testing/snippets/order-unit-tests/csharp/XUnit.TestProject/XUnit.Project.csproj +++ b/docs/core/testing/snippets/order-unit-tests/csharp/XUnit.TestProject/XUnit.Project.csproj @@ -14,7 +14,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/docs/core/testing/snippets/testcontext/csharp/project.csproj b/docs/core/testing/snippets/testcontext/csharp/project.csproj index b4c7b3342fafb..f73e1db55491b 100644 --- a/docs/core/testing/snippets/testcontext/csharp/project.csproj +++ b/docs/core/testing/snippets/testcontext/csharp/project.csproj @@ -8,7 +8,7 @@ - + diff --git a/docs/core/testing/snippets/unit-testing-using-mstest/csharp/PrimeService.Tests/PrimeService.Tests.csproj b/docs/core/testing/snippets/unit-testing-using-mstest/csharp/PrimeService.Tests/PrimeService.Tests.csproj index e7a04e7151de8..5a1cf43e4ea67 100644 --- a/docs/core/testing/snippets/unit-testing-using-mstest/csharp/PrimeService.Tests/PrimeService.Tests.csproj +++ b/docs/core/testing/snippets/unit-testing-using-mstest/csharp/PrimeService.Tests/PrimeService.Tests.csproj @@ -8,9 +8,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/docs/core/tools/sdk-errors/netsdk1138.md b/docs/core/tools/sdk-errors/netsdk1138.md index 2ed1d5f253584..764f9c640efcd 100644 --- a/docs/core/tools/sdk-errors/netsdk1138.md +++ b/docs/core/tools/sdk-errors/netsdk1138.md @@ -12,7 +12,7 @@ NETSDK1138 indicates that your project targets a version of the framework that i > The target framework '\' is out of support and will not receive security updates in the future. Please refer to for more information about the support policy. -Out-of-support versions include 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, and 5.0. +Out-of-support versions include 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5, 6, and 7. To resolve this error, change your project to target a supported version of .NET. diff --git a/docs/core/tutorials/snippets/library-with-visual-studio/csharp/StringLibraryTest/StringLibraryTest.csproj b/docs/core/tutorials/snippets/library-with-visual-studio/csharp/StringLibraryTest/StringLibraryTest.csproj index 424113dc114a3..4df69b78c1e59 100644 --- a/docs/core/tutorials/snippets/library-with-visual-studio/csharp/StringLibraryTest/StringLibraryTest.csproj +++ b/docs/core/tutorials/snippets/library-with-visual-studio/csharp/StringLibraryTest/StringLibraryTest.csproj @@ -7,8 +7,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/docs/core/tutorials/snippets/library-with-visual-studio/csharp/StringLibraryTestNet8/StringLibraryTest.csproj b/docs/core/tutorials/snippets/library-with-visual-studio/csharp/StringLibraryTestNet8/StringLibraryTest.csproj index 75a8745eab277..016809ddd6eab 100644 --- a/docs/core/tutorials/snippets/library-with-visual-studio/csharp/StringLibraryTestNet8/StringLibraryTest.csproj +++ b/docs/core/tutorials/snippets/library-with-visual-studio/csharp/StringLibraryTestNet8/StringLibraryTest.csproj @@ -11,9 +11,9 @@ - - - + + + diff --git a/docs/core/tutorials/snippets/library-with-visual-studio/vb/StringLibraryTest/StringLibraryTest.vbproj b/docs/core/tutorials/snippets/library-with-visual-studio/vb/StringLibraryTest/StringLibraryTest.vbproj index e1da2c70ecf15..d0faca03fc58e 100644 --- a/docs/core/tutorials/snippets/library-with-visual-studio/vb/StringLibraryTest/StringLibraryTest.vbproj +++ b/docs/core/tutorials/snippets/library-with-visual-studio/vb/StringLibraryTest/StringLibraryTest.vbproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/docs/core/whats-new/snippets/dotnet-8/csharp/ConsoleApp/Project.csproj b/docs/core/whats-new/snippets/dotnet-8/csharp/ConsoleApp/Project.csproj index 4c674177b2c40..94172f57013f0 100644 --- a/docs/core/whats-new/snippets/dotnet-8/csharp/ConsoleApp/Project.csproj +++ b/docs/core/whats-new/snippets/dotnet-8/csharp/ConsoleApp/Project.csproj @@ -12,7 +12,7 @@ - + diff --git a/docs/core/whats-new/snippets/dotnet-9/csharp/Project.csproj b/docs/core/whats-new/snippets/dotnet-9/csharp/Project.csproj index e546010dd94f6..c48fa60e5ee07 100644 --- a/docs/core/whats-new/snippets/dotnet-9/csharp/Project.csproj +++ b/docs/core/whats-new/snippets/dotnet-9/csharp/Project.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/csharp/language-reference/operators/snippets/shared/operators.csproj b/docs/csharp/language-reference/operators/snippets/shared/operators.csproj index d525383ec35b2..175da6f0da578 100644 --- a/docs/csharp/language-reference/operators/snippets/shared/operators.csproj +++ b/docs/csharp/language-reference/operators/snippets/shared/operators.csproj @@ -10,7 +10,7 @@ - + diff --git a/docs/csharp/linq/snippets/HowToBuildDynamicQueries/HowToBuildDynamicQueries.csproj b/docs/csharp/linq/snippets/HowToBuildDynamicQueries/HowToBuildDynamicQueries.csproj index 8c9d3fb4adb27..c3e39867ae37d 100644 --- a/docs/csharp/linq/snippets/HowToBuildDynamicQueries/HowToBuildDynamicQueries.csproj +++ b/docs/csharp/linq/snippets/HowToBuildDynamicQueries/HowToBuildDynamicQueries.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/csharp/roslyn-sdk/tutorials/snippets/how-to-write-csharp-analyzer-code-fix/MakeConst/MakeConst.Test/MakeConst.Test.csproj b/docs/csharp/roslyn-sdk/tutorials/snippets/how-to-write-csharp-analyzer-code-fix/MakeConst/MakeConst.Test/MakeConst.Test.csproj index 6cdce3b4ea3f8..e11483fd37274 100644 --- a/docs/csharp/roslyn-sdk/tutorials/snippets/how-to-write-csharp-analyzer-code-fix/MakeConst/MakeConst.Test/MakeConst.Test.csproj +++ b/docs/csharp/roslyn-sdk/tutorials/snippets/how-to-write-csharp-analyzer-code-fix/MakeConst/MakeConst.Test/MakeConst.Test.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/docs/fsharp/language-reference/active-patterns.md b/docs/fsharp/language-reference/active-patterns.md index cbc8ae04de099..d7960e5c975b7 100644 --- a/docs/fsharp/language-reference/active-patterns.md +++ b/docs/fsharp/language-reference/active-patterns.md @@ -177,6 +177,26 @@ let (|Int|_|) str = The attribute must be specified, because the use of a struct return is not inferred from simply changing the return type to `ValueOption`. For more information, see [RFC FS-1039](https://github.com/fsharp/fslang-design/blob/main/FSharp-6.0/FS-1039-struct-representation-for-active-patterns.md). +## Null active patterns + +In F# 9, nullability related active patterns were added. + +The first one is `| Null | NonNull x |`, which is a recommended way to handle possible nulls. In the following example, parameter `s` is inferred nullable via this active pattern usage: + +```fsharp + let len s = + match s with + | Null -> -1 + | NonNull s -> String.length s +``` + +If you rather want to automatically throw `NullReferenceException`, you can use the `| NonNullQuick |` pattern: + +```fsharp +let len (NonNullQuick str) = // throws if the argument is null + String.length str +``` + ## See also - [F# Language Reference](index.md) diff --git a/docs/fsharp/language-reference/compiler-directives.md b/docs/fsharp/language-reference/compiler-directives.md index a94b560561768..b467d5339cf6d 100644 --- a/docs/fsharp/language-reference/compiler-directives.md +++ b/docs/fsharp/language-reference/compiler-directives.md @@ -52,6 +52,28 @@ let str = "Debugging!" #endif ``` +## NULLABLE directive + +Starting with F# 9, you can enable nullable reference types in the project: + +```xml +enable +``` + +This automatically sets `NULLABLE` directive to the build. It's useful while initially rolling out the feature, to conditionally change conflicting code by `#if NULLABLE` hash directives: + +```fsharp +#if NULLABLE +let length (arg: 'T when 'T: not null) = + Seq.length arg +#else +let length arg = + match arg with + | null -> -1 + | s -> Seq.length s +#endif +``` + ## Line Directives When building, the compiler reports errors in F# code by referencing line numbers on which each error occurs. These line numbers start at 1 for the first line in a file. However, if you are generating F# source code from another tool, the line numbers in the generated code are generally not of interest, because the errors in the generated F# code most likely arise from another source. The `#line` directive provides a way for authors of tools that generate F# source code to pass information about the original line numbers and source files to the generated F# code. diff --git a/docs/fsharp/language-reference/compiler-options.md b/docs/fsharp/language-reference/compiler-options.md index ef5f3bc91fc0b..e25ef30c96b9f 100644 --- a/docs/fsharp/language-reference/compiler-options.md +++ b/docs/fsharp/language-reference/compiler-options.md @@ -18,6 +18,7 @@ The following table shows compiler options listed alphabetically. Some of the F# |`--allsigs`|Generates a new (or regenerates an existing) signature file for each source file in the compilation. For more information about signature files, see [Signatures](signature-files.md).| |`-a filename.fs`|Generates a library from the specified file. This option is a short form of `--target:library filename.fs`.| |`--baseaddress:address`|Specifies the preferred base address at which to load a DLL.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see [/baseaddress (C# Compiler Options)](../../csharp/language-reference/compiler-options/advanced.md#baseaddress).| +|--checknulls[+|-]|Enables [nullable reference types](./values/null-values.md#null-values-starting-with-f-9), added in F# 9.| |`--codepage:id`|Specifies which code page to use during compilation if the required page isn't the current default code page for the system.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see [/code pages (C# Compiler Options)](../../csharp/language-reference/compiler-options/advanced.md#codepage).| |`--consolecolors`|Specifies that errors and warnings use color-coded text on the console.| |`--crossoptimize[+ or -]`|Enables or disables cross-module optimizations.| diff --git a/docs/fsharp/language-reference/fsharp-interactive-options.md b/docs/fsharp/language-reference/fsharp-interactive-options.md index 339af09765c7c..85bed67294c7d 100644 --- a/docs/fsharp/language-reference/fsharp-interactive-options.md +++ b/docs/fsharp/language-reference/fsharp-interactive-options.md @@ -27,6 +27,7 @@ Where lists appear in F# Interactive option arguments, list elements are separat |------|-----------| |**--**|Used to instruct F# Interactive to treat remaining arguments as command-line arguments to the F# program or script, which you can access in code by using the list **fsi.CommandLineArgs**.| |**--checked**[**+**|**-**]|Same as the **fsc.exe** compiler option. For more information, see [Compiler Options](compiler-options.md).| +|**--checknulls**[**+**|**-**]|Same as the **fsc.exe** compiler option. For more information, see [Compiler Options](compiler-options.md).| |**--codepage:<int>**|Same as the **fsc.exe** compiler option. For more information, see [Compiler Options](compiler-options.md).| |**--consolecolors**[**+**|**-**]|Outputs warning and error messages in color.| |**--compilertool:<extensionsfolder>|Reference an assembly or directory containing a design time tool (Short form: -t).| diff --git a/docs/fsharp/language-reference/generics/constraints.md b/docs/fsharp/language-reference/generics/constraints.md index 474fc7bdbe34d..0aa7683b52a7f 100644 --- a/docs/fsharp/language-reference/generics/constraints.md +++ b/docs/fsharp/language-reference/generics/constraints.md @@ -20,7 +20,8 @@ There are several different constraints you can apply to limit the types that ca |Constraint|Syntax|Description| |----------|------|-----------| |Type Constraint|*type-parameter* :> *type*|The provided type must be equal to or derived from the type specified, or, if the type is an interface, the provided type must implement the interface.| -|Null Constraint|*type-parameter* : null|The provided type must support the null literal. This includes all .NET object types but not F# list, tuple, function, class, record, or union types.| +|Null Constraint|*type-parameter* : null|The provided type must support the null value. This includes all .NET object types but not F# list, tuple, function, class, record, or union types.| +|Not Null Constraint|*type-parameter* : not null|The provided type must not support the null value. This disallows both `null` annotated types and types which have null as their representation value (such as the option type or types defined with AllowNullLiteral attribute). This generic constraint does allow value types, since those can never be null.| |Explicit Member Constraint|[(]*type-parameter* [or ... or *type-parameter*)] : (*member-signature*)|At least one of the type arguments provided must have a member that has the specified signature; not intended for common use. Members must be either explicitly defined on the type or part of an implicit type extension to be valid targets for an Explicit Member Constraint.| |Constructor Constraint|*type-parameter* : ( new : unit -> 'a )|The provided type must have a parameterless constructor.| |Value Type Constraint|*type-parameter* : struct|The provided type must be a .NET value type.| @@ -54,6 +55,10 @@ type Class2<'T when 'T :> System.IComparable> = type Class3<'T when 'T : null> = class end +// Not Null constraint +type Class4<'T when 'T : not null> = + class end + // Member constraint with instance member type Class5<'T when 'T : (member Method1 : 'T -> int)> = class end diff --git a/docs/fsharp/language-reference/nullable-value-types.md b/docs/fsharp/language-reference/nullable-value-types.md index fc2516a404253..3390b1339339d 100644 --- a/docs/fsharp/language-reference/nullable-value-types.md +++ b/docs/fsharp/language-reference/nullable-value-types.md @@ -108,10 +108,10 @@ You can also use an appropriate non-nullable operator to convert to a primitive open System open FSharp.Linq -let nullableInt = Nullable 10 -let nullableFloat = Nullable.float nullableInt +let nullableFloat = Nullable 10.0 +let standardFloat = float nullableFloat -printfn $"value is %f{float nullableFloat}" +printfn $"value is %f{float standardFloat}" ``` You can also use nullable operators as a short-hand for checking `HasValue` and `Value`: diff --git a/docs/fsharp/language-reference/pattern-matching.md b/docs/fsharp/language-reference/pattern-matching.md index 5535213a35d39..4ac2d0e7c6a87 100644 --- a/docs/fsharp/language-reference/pattern-matching.md +++ b/docs/fsharp/language-reference/pattern-matching.md @@ -210,6 +210,24 @@ The following example uses the null pattern and the variable pattern. [!code-fsharp[Main](~/samples/snippets/fsharp/lang-ref-2/snippet4817.fs)] +Null pattern is also recommended for the F# 9 [nullability capabilities](./values/null-values.md#null-values-starting-with-f-9): + +```fsharp +let len (str: string | null) = + match str with + | null -> -1 + | s -> s.Length +``` + +Similarly, you can use new dedicated nullability related [patterns](./active-patterns.md): + +```fsharp +let let str = // str is inferred to be `string | null` + match str with + | Null -> -1 + | NonNull (s: string) -> s.Length +``` + ## Nameof pattern The `nameof` pattern matches against a string when its value is equal to the expression that follows the `nameof` keyword. for example: diff --git a/docs/fsharp/language-reference/values/null-values.md b/docs/fsharp/language-reference/values/null-values.md index f5187e754e22e..ff99f5a7ec3d7 100644 --- a/docs/fsharp/language-reference/values/null-values.md +++ b/docs/fsharp/language-reference/values/null-values.md @@ -7,7 +7,7 @@ ms.date: 08/15/2020 This topic describes how the null value is used in F#. -## Null Value +## Null Values Prior To F# 9 The null value is not normally used in F# for values or variables. However, null appears as an abnormal value in certain situations. If a type is defined in F#, null is not permitted as a regular value unless the [AllowNullLiteral](https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-allownullliteralattribute.html#Value) attribute is applied to the type. If a type is defined in some other .NET language, null is a possible value, and when you are interoperating with such types, your F# code might encounter null values. @@ -31,6 +31,73 @@ You can use the following code to check if an arbitrary value is null. [!code-fsharp[Main](~/samples/snippets/fsharp/lang-ref-1/snippet703.fs)] +## Null Values starting with F# 9 + +In F# 9, extra capabilities are added to the language to deal with reference types which can have `null` as a value. Those are off by default - to turn them on, the following property must be put in your project file: + +```xml +enable +``` + +This passes the `--checknulls+` [flag](../compiler-options.md) to the F# compiler and sets a `NULLABLE` [preprocessor directive](../compiler-directives.md#nullable-directive) for the build. + +To explicitly opt-in into nullability, a type declaration has to be suffixed with the new syntax: + +```fsharp +type | null +``` + +The bar symbol `|` has the meaning of a logical OR in the syntax, building a union of two disjoint sets of types: the underlying type, and the nullable reference. This is the same syntactical symbol which is used for declaring multiple cases of an F# discriminated union: `type AB = A | B` carries the meaning of either `A`, or `B`. + +The nullable annotation `| null` can be used at all places where a reference type would be normally used: + +- Fields of union types, record types and custom types. +- Type aliases to existing types. +- Type applications of a generic type. +- Explicit type annotations to let bindings, parameters or return types. +- Type annotations to object-programming constructs like members, properties or fields. + +```fsharp +type AB = A | B +type AbNull = AB | null + +type RecordField = { X: string | null } +type TupleField = string * string | null + +type NestedGenerics = { Z : List | null> | null } +``` + +The bar symbol `|` does have other usages in F# which might lead to syntactical ambiguities. In such cases, parentheses are needed around the null-annotated type: + +```fsharp +// Unexpected symbol '|' (directly before 'null') in member definition +type DUField = N of string | null +``` + +Wrapping the same type into a pair of `( )` parentheses fixes the issue: + +```fsharp +type DUField = N of (string | null) +``` + +When used in pattern matching, `|` is used to separate different pattern matching clauses. + +```fsharp +match x with +| ?: string | null -> ... +``` + +This snippet is actually equivalent to code first doing a type test against the `string` type, and then having a separate clause for handling null: + +```fsharp +match x with +| ?: string +| null -> ... +``` + +> [!IMPORTANT] +> The extra null related capabilities were added to the language for the interoperability purposes. Using `| null` in F# type modeling is not considered idiomatic for denoting missing information - for that purpose, use options (as described above). Read more about null-related [conventions](../../style-guide/conventions.md#nulls-and-default-values) in the style guide. + ## See also - [Values](index.md) diff --git a/docs/fsharp/style-guide/component-design-guidelines.md b/docs/fsharp/style-guide/component-design-guidelines.md index f8ab19b497e16..ad0a369492aba 100644 --- a/docs/fsharp/style-guide/component-design-guidelines.md +++ b/docs/fsharp/style-guide/component-design-guidelines.md @@ -693,11 +693,51 @@ let checkNonNull argName (arg: obj) = | null -> nullArg argName | _ -> () -let checkNonNull` argName (arg: obj) = +let checkNonNull' argName (arg: obj) = if isNull arg then nullArg argName else () ``` +Starting with F# 9, you can leverage the new `| null` [syntax](../language-reference/values/null-values.md#null-values-starting-with-f-9) to make the compiler indicate possible null values and where they need handling: + +```fsharp +let checkNonNull argName (arg: obj | null) = + match arg with + | null -> nullArg argName + | _ -> () + +let checkNonNull' argName (arg: obj | null) = + if isNull arg then nullArg argName + else () +``` + +In F# 9, the compiler emits a warning when it detects that a possible null value is not handled: + +```fsharp +let printLineLength (s: string) = + printfn "%i" s.Length + +let readLineFromStream (sr: System.IO.StreamReader) = + // `ReadLine` may return null here - when the stream is finished + let line = sr.ReadLine() + // nullness warning: The types 'string' and 'string | null' + // do not have equivalent nullability + printLineLength line +``` + +These warnings should be addressed using F# [null pattern](../language-reference/pattern-matching.md#null-pattern) in matching: + +```fsharp +let printLineLength (s: string) = + printfn "%i" s.Length + +let readLineFromStream (sr: System.IO.StreamReader) = + let line = sr.ReadLine() + match line with + | null -> () + | s -> printLineLength s +``` + #### Avoid using tuples as return values Instead, prefer returning a named type holding the aggregate data, or using out parameters to return multiple values. Although tuples and struct tuples exist in .NET (including C# language support for struct tuples), they will most often not provide the ideal and expected API for .NET developers. diff --git a/docs/fsharp/style-guide/conventions.md b/docs/fsharp/style-guide/conventions.md index 61658bebff99a..ab4df74e63819 100644 --- a/docs/fsharp/style-guide/conventions.md +++ b/docs/fsharp/style-guide/conventions.md @@ -687,6 +687,54 @@ module Array = For legacy reasons some string functions in FSharp.Core still treat nulls as empty strings and do not fail on null arguments. However do not take this as guidance, and do not adopt coding patterns that attribute any semantic meaning to "null". +### Leverage F# 9 null syntax at the API boundaries + +F# 9 adds [syntax](../language-reference/values/null-values.md#null-values-starting-with-f-9) to explicitly state that a value can be null. It's designed to be used on the API boundaries, to make the compiler indicate the places where null handling is missing. + +Here is an example of the valid usage of the syntax: + +```fsharp +type CustomType(m1, m2) = + member _.M1 = m1 + member _.M2 = m2 + + override this.Equals(obj: obj | null) = + match obj with + | :? CustomType as other -> this.M1 = other.M1 && this.M2 = other.M2 + | _ -> false + + override this.GetHashCode() = + hash (this.M1, this.M2) +``` + +**Avoid** propagating nulls further down your F# code: + +```fsharp +let getLineFromStream (stream: System.IO.StreamReader) : string | null = + stream.ReadLine() +``` + +**Instead**, use idiomatic F# means (e.g., options): + +```fsharp +let getLineFromStream (stream: System.IO.StreamReader) = + stream.ReadLine() |> Option.ofObj +``` + +For raising null related exceptions you can use special `nullArgCheck` and `nonNull` functions. They're handy also because in case the value is not null, they [shadow](../language-reference/functions/index.md#scope) the argument with its sanitized value - the further code cannot access possible null pointers anymore. + +```fsharp +let inline processNullableList list = + let list = nullArgCheck (nameof list) list // throws `ArgumentNullException` + // 'list' is safe to use from now on + list |> List.distinct + +let inline processNullableList' list = + let list = nonNull list // throws `NullReferenceException` + // 'list' is safe to use from now on + list |> List.distinct +``` + ## Object programming F# has full support for objects and object-oriented (OO) concepts. Although many OO concepts are powerful and useful, not all of them are ideal to use. The following lists offer guidance on categories of OO features at a high level. diff --git a/docs/machine-learning/how-to-guides/install-gpu-model-builder.md b/docs/machine-learning/how-to-guides/install-gpu-model-builder.md index 6d2ef5092f79b..c3922a654ec90 100644 --- a/docs/machine-learning/how-to-guides/install-gpu-model-builder.md +++ b/docs/machine-learning/how-to-guides/install-gpu-model-builder.md @@ -14,8 +14,8 @@ Learn how to install the GPU drivers to use your GPU with Model Builder. ## Hardware requirements -- At least one CUDA compatible GPU. For a list of compatible GPUs, see [NVIDIA's guide](https://developer.nvidia.com/cuda-gpus). -- At least 6GB of dedicated GPU memory. +- At least one CUDA-compatible GPU. For a list of compatible GPUs, see [NVIDIA's guide](https://developer.nvidia.com/cuda-gpus). +- At least 6 GB of dedicated GPU memory. ## Prerequisites @@ -25,9 +25,9 @@ Learn how to install the GPU drivers to use your GPU with Model Builder. ### Image classification only - NVIDIA developer account. If you don't have one, [create a free account](https://developer.nvidia.com/developer-program). -- Install dependencies +- Install dependencies: - Install [CUDA v10.1](https://developer.nvidia.com/cuda-10.1-download-archive-update2). Make sure you install CUDA v10.1, not any other newer version. - - Install [cuDNN v7.6.4 for CUDA 10.1](https://developer.nvidia.com/rdp/cudnn-download). You cannot have multiple versions of cuDNN installed. After downloading cuDNN v7.6.4 zip file and unpacking it, copy `\cuda\bin\cudnn64_7.dll` to `\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin`. + - Install [cuDNN for CUDA 10.1](https://developer.nvidia.com/rdp/cudnn-download). (You can't have multiple versions of cuDNN installed.) ## Troubleshooting @@ -37,7 +37,7 @@ Deep learning scenarios tend to run faster on GPUs. Some scenarios like image classification support training on Azure GPU VMs. -However, if local GPUs or Azure are not an option for you, these scenarios also run on CPU. Note however that training times are significantly longer. +However, if local GPUs or Azure are not an option for you, these scenarios also run on CPU. However, training times are significantly longer. **How do I know what GPU I have?** @@ -46,25 +46,25 @@ However, if local GPUs or Azure are not an option for you, these scenarios also 1. Right-click on the Windows start menu icon and select **Settings**. 1. Select **Settings** > **System** 1. Select **Display** and scroll down to **Related settings**. -1. Select **Advanced display**. Your GPU’s make and model should be shown under **Display information**. +1. Select **Advanced display**. Your GPU's make and model are shown under **Display information**. ***Check GPU from Task Manager*** 1. Right-click on the Windows start menu icon and select **Task Manager**. 1. Select **Performance**. 1. In the last pane of the tab, choose **GPU**. If this option is available, it will likely be at the bottom of the list. -1. In the top right corner of the GPU selection, information about your computer’s GPU will be visible. +1. In the top right corner of the GPU selection, information about your computer's GPU is shown. **I don't see my GPU in Settings or Task Manager but I know I have an NVIDIA GPU.** -1. Open Device Manager -1. Look at Display adapters -1. Install appropriate [driver](https://www.nvidia.com/drivers) for your GPU. +1. Open Device Manager. +1. Look at Display adapters. +1. Install the appropriate [driver](https://www.nvidia.com/drivers) for your GPU. **How do I see what version of CUDA I have?** -1. Open a PowerShell or command line window -1. Type in `nvcc --version` +1. Open a PowerShell or command line window. +1. Run the command `nvcc --version`. **cuda is not available, please confirm you have a cuda-supported gpu** diff --git a/docs/navigate/devops-testing/toc.yml b/docs/navigate/devops-testing/toc.yml index 4a64586b2510c..53dc1493cd805 100644 --- a/docs/navigate/devops-testing/toc.yml +++ b/docs/navigate/devops-testing/toc.yml @@ -193,6 +193,10 @@ items: href: ../../core/testing/mstest-analyzers/mstest0037.md - name: MSTEST0038 href: ../../core/testing/mstest-analyzers/mstest0038.md + - name: MSTEST0039 + href: ../../core/testing/mstest-analyzers/mstest0039.md + - name: MSTEST0040 + href: ../../core/testing/mstest-analyzers/mstest0040.md - name: Microsoft Testing Platform items: - name: Overview diff --git a/samples/snippets/core/testing/unit-testing-vb-mstest/vb/PrimeService.Tests/PrimeService.Tests.vbproj b/samples/snippets/core/testing/unit-testing-vb-mstest/vb/PrimeService.Tests/PrimeService.Tests.vbproj index 97aa298c5042d..a605cf79806ad 100644 --- a/samples/snippets/core/testing/unit-testing-vb-mstest/vb/PrimeService.Tests/PrimeService.Tests.vbproj +++ b/samples/snippets/core/testing/unit-testing-vb-mstest/vb/PrimeService.Tests/PrimeService.Tests.vbproj @@ -8,8 +8,8 @@ - - + +