diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b276a9b7b0ff7..0e3e379164501 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -977,7 +977,7 @@ updates: patterns: - "*" # Prefer a single PR per project update. - package-ecosystem: "nuget" - directory: "/docs/core/diagnostics/snippets/exception-summary" #exception-summary.csproj + directory: "/docs/core/containers/snippets/Worker" #DotNet.ContainerImage.csproj schedule: interval: "weekly" day: "wednesday" @@ -988,7 +988,7 @@ updates: patterns: - "*" # Prefer a single PR per project update. - package-ecosystem: "nuget" - directory: "/docs/core/diagnostics/snippets/health-checks" #health-checks.csproj + directory: "/docs/core/diagnostics/snippets/exception-summary" #exception-summary.csproj schedule: interval: "weekly" day: "wednesday" @@ -999,7 +999,7 @@ updates: patterns: - "*" # Prefer a single PR per project update. - package-ecosystem: "nuget" - directory: "/docs/core/diagnostics/snippets/lifetime-health-checks" #lifetime-health-checks.csproj + directory: "/docs/core/diagnostics/snippets/health-checks" #health-checks.csproj schedule: interval: "weekly" day: "wednesday" @@ -1010,7 +1010,7 @@ updates: patterns: - "*" # Prefer a single PR per project update. - package-ecosystem: "nuget" - directory: "/docs/core/diagnostics/snippets/Metrics" #metric-instr.csproj + directory: "/docs/core/diagnostics/snippets/lifetime-health-checks" #lifetime-health-checks.csproj schedule: interval: "weekly" day: "wednesday" @@ -1021,7 +1021,7 @@ updates: patterns: - "*" # Prefer a single PR per project update. - package-ecosystem: "nuget" - directory: "/docs/core/diagnostics/snippets/Microsoft.Diagnostics.NETCore.Client/csharp" #Microsoft.Diagnostics.NETCore.Client.Samples.csproj + directory: "/docs/core/diagnostics/snippets/Metrics" #metric-instr.csproj schedule: interval: "weekly" day: "wednesday" @@ -1032,7 +1032,7 @@ updates: patterns: - "*" # Prefer a single PR per project update. - package-ecosystem: "nuget" - directory: "/docs/core/diagnostics/snippets/OTel-Prometheus-Grafana-Jaeger/csharp" #OTel-Prometheus-Grafana-Jaeger.csproj + directory: "/docs/core/diagnostics/snippets/Microsoft.Diagnostics.NETCore.Client/csharp" #Microsoft.Diagnostics.NETCore.Client.Samples.csproj schedule: interval: "weekly" day: "wednesday" @@ -1043,7 +1043,7 @@ updates: patterns: - "*" # Prefer a single PR per project update. - package-ecosystem: "nuget" - directory: "/docs/core/diagnostics/snippets/OTLP-Example/csharp" #OTLP-Example.csproj + directory: "/docs/core/diagnostics/snippets/OTel-Prometheus-Grafana-Jaeger/csharp" #OTel-Prometheus-Grafana-Jaeger.csproj schedule: interval: "weekly" day: "wednesday" @@ -1054,7 +1054,7 @@ updates: patterns: - "*" # Prefer a single PR per project update. - package-ecosystem: "nuget" - directory: "/docs/core/diagnostics/snippets/resource-monitoring" #resource-monitoring.csproj + directory: "/docs/core/diagnostics/snippets/OTLP-Example/csharp" #OTLP-Example.csproj schedule: interval: "weekly" day: "wednesday" @@ -1065,7 +1065,7 @@ updates: patterns: - "*" # Prefer a single PR per project update. - package-ecosystem: "nuget" - directory: "/docs/core/docker/snippets/8.0/Worker" #DotNet.ContainerImage.csproj + directory: "/docs/core/diagnostics/snippets/resource-monitoring" #resource-monitoring.csproj schedule: interval: "weekly" day: "wednesday" diff --git a/.github/workflows/cleanrepo-orphaned-articles.yml b/.github/workflows/cleanrepo-orphaned-articles.yml index 57763cbcd84be..319f0cf3ef9f6 100644 --- a/.github/workflows/cleanrepo-orphaned-articles.yml +++ b/.github/workflows/cleanrepo-orphaned-articles.yml @@ -35,7 +35,7 @@ jobs: # Create the PR for the work done by the "clean repo" tool - name: create-pull-request - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f + uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f with: branch: cleanrepo-orphaned-articles title: "Monthly chores: Delete orphaned articles" diff --git a/.github/workflows/cleanrepo-orphaned-images.yml b/.github/workflows/cleanrepo-orphaned-images.yml index 02e6176ace525..8337775ac4452 100644 --- a/.github/workflows/cleanrepo-orphaned-images.yml +++ b/.github/workflows/cleanrepo-orphaned-images.yml @@ -35,7 +35,7 @@ jobs: # Create the PR for the work done by the "clean repo" tool - name: create-pull-request - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f + uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f with: branch: cleanrepo-orphaned-images title: "Monthly chores: Delete orphaned images" diff --git a/.github/workflows/cleanrepo-orphaned-includes.yml b/.github/workflows/cleanrepo-orphaned-includes.yml index 562df7449b8af..463678cc5b296 100644 --- a/.github/workflows/cleanrepo-orphaned-includes.yml +++ b/.github/workflows/cleanrepo-orphaned-includes.yml @@ -35,7 +35,7 @@ jobs: # Create the PR for the work done by the "clean repo" tool - name: create-pull-request - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f + uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f with: branch: cleanrepo-orphaned-includes title: "Monthly chores: Delete orphaned include files" diff --git a/.github/workflows/cleanrepo-orphaned-snippets.yml b/.github/workflows/cleanrepo-orphaned-snippets.yml index 7f7105f6c99e5..5605d5ab2eb8c 100644 --- a/.github/workflows/cleanrepo-orphaned-snippets.yml +++ b/.github/workflows/cleanrepo-orphaned-snippets.yml @@ -35,7 +35,7 @@ jobs: # Create the PR for the work done by the "clean repo" tool - name: create-pull-request - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f + uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f with: branch: cleanrepo-orphaned-snippets title: "Monthly chores: Delete orphaned snippets" diff --git a/.github/workflows/cleanrepo-redirect-hops.yml b/.github/workflows/cleanrepo-redirect-hops.yml index 83c5899fa9d85..3612e84ac56ca 100644 --- a/.github/workflows/cleanrepo-redirect-hops.yml +++ b/.github/workflows/cleanrepo-redirect-hops.yml @@ -35,7 +35,7 @@ jobs: # Create the PR for the work done by the "clean repo" tool - name: create-pull-request - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f + uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f with: branch: cleanrepo-remove-hops title: "Monthly chores: Remove redirect hops" diff --git a/.github/workflows/cleanrepo-relative-links.yml b/.github/workflows/cleanrepo-relative-links.yml index 7ab2a2e3ef81d..8aeb9c0c4790b 100644 --- a/.github/workflows/cleanrepo-relative-links.yml +++ b/.github/workflows/cleanrepo-relative-links.yml @@ -35,7 +35,7 @@ jobs: # Create the PR for the work done by the "clean repo" tool - name: create-pull-request - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f + uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f with: branch: cleanrepo-relative-links title: "Monthly chores: Use relative links" diff --git a/.github/workflows/cleanrepo-replace-redirects.yml b/.github/workflows/cleanrepo-replace-redirects.yml index c7a10cd8cb542..cf8b11c1050f0 100644 --- a/.github/workflows/cleanrepo-replace-redirects.yml +++ b/.github/workflows/cleanrepo-replace-redirects.yml @@ -35,7 +35,7 @@ jobs: # Create the PR for the work done by the "clean repo" tool - name: create-pull-request - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f + uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f with: branch: cleanrepo-replace-redirects title: "Monthly chores: Replace redirect targets" diff --git a/.github/workflows/dependabot-bot.yml b/.github/workflows/dependabot-bot.yml index 0acb6a8548677..9ff17792b9692 100644 --- a/.github/workflows/dependabot-bot.yml +++ b/.github/workflows/dependabot-bot.yml @@ -52,7 +52,7 @@ jobs: dependabot-yml-path: ".github/dependabot.yml" - name: Create pull request if: github.event_name == 'workflow_dispatch' || github.repository_owner == 'dotnet' - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f + uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f with: branch: create-dependabotconfig-pull-request/patch title: "Update dependabot.yml - automatically." diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index 5ec79bb66b14d..8ac9e461f53c8 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -27,7 +27,7 @@ jobs: egress-policy: audit - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: DavidAnson/markdownlint-cli2-action@eb5ca3ab411449c66620fe7f1b3c9e10547144b0 # v18.0.0 + - uses: DavidAnson/markdownlint-cli2-action@a23dae216ce3fee4db69da41fed90d2a4af801cf # v19.0.0 with: config: ".markdownlint-cli2.jsonc" globs: "**/*.md" diff --git a/.github/workflows/profanity-filter.yml b/.github/workflows/profanity-filter.yml index 9172c457adbdb..8da8778ea11e1 100644 --- a/.github/workflows/profanity-filter.yml +++ b/.github/workflows/profanity-filter.yml @@ -25,7 +25,7 @@ jobs: - name: Profanity filter if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'github-actions[bot]' }} - uses: IEvangelist/profanity-filter@b51302be6fd09006f6b0a5ec4c573542fc8fa7bf # main + uses: IEvangelist/profanity-filter@e370e4ba671feb530a5481b4595413c7fd032b9b # main id: profanity-filter with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index f5d22e14594a4..89f9fc6759f75 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -71,6 +71,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9 + uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1 with: sarif_file: results.sarif diff --git a/.github/workflows/snippets5000.yml b/.github/workflows/snippets5000.yml index 9be589672927a..2b3133122d199 100644 --- a/.github/workflows/snippets5000.yml +++ b/.github/workflows/snippets5000.yml @@ -41,7 +41,7 @@ jobs: # Get the latest preview SDK (or sdk not installed by the runner) - name: Setup .NET if: ${{ env.DOTNET_DO_INSTALL == 'true' }} - uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 #@4.1.0 + uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 #@4.2.0 with: dotnet-version: ${{ env.DOTNET_VERSION }} dotnet-quality: ${{ env.DOTNET_QUALITY }} diff --git a/.github/workflows/whats-new.yml b/.github/workflows/whats-new.yml index 5913f622e4e72..7948deef825c5 100644 --- a/.github/workflows/whats-new.yml +++ b/.github/workflows/whats-new.yml @@ -52,7 +52,7 @@ jobs: savedir: './docs/whats-new' - name: create-pull-request - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f + uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f with: branch: create-whatsnew-pull-request/patch title: "What's new article" diff --git a/docs/azure/sdk/snippets/unit-testing/UnitTestingSampleApp.csproj b/docs/azure/sdk/snippets/unit-testing/UnitTestingSampleApp.csproj index 09653e0f98eee..5a4719a4a0133 100644 --- a/docs/azure/sdk/snippets/unit-testing/UnitTestingSampleApp.csproj +++ b/docs/azure/sdk/snippets/unit-testing/UnitTestingSampleApp.csproj @@ -15,8 +15,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/docs/core/extensions/artificial-intelligence.md b/docs/core/extensions/artificial-intelligence.md index e346df29d84ca..9943ab1c9775b 100644 --- a/docs/core/extensions/artificial-intelligence.md +++ b/docs/core/extensions/artificial-intelligence.md @@ -192,9 +192,10 @@ The consumer can then easily use this in their pipeline, for example: This example demonstrates [hosted scenario](generic-host.md), where the consumer relies on [dependency injection](dependency-injection.md) to provide the `RateLimiter` instance. The preceding extension methods demonstrate using a `Use` method on . The `ChatClientBuilder` also provides overloads that make it easier to write such delegating handlers. -- +- - -- +- +- For example, in the earlier `RateLimitingChatClient` example, the overrides of `CompleteAsync` and `CompleteStreamingAsync` only need to do work before and after delegating to the next client in the pipeline. To achieve the same thing without writing a custom class, you can use an overload of `Use` that accepts a delegate that's used for both `CompleteAsync` and `CompleteStreamingAsync`, reducing the boilerplate required: 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 0d1fb46ed2f34..d825789ebf68b 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,8 +9,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/docs/core/testing/snippets/order-unit-tests/csharp/NUnit.TestProject/NUnit.Project.csproj b/docs/core/testing/snippets/order-unit-tests/csharp/NUnit.TestProject/NUnit.Project.csproj index 49fe4265b2669..200ba5b952097 100644 --- a/docs/core/testing/snippets/order-unit-tests/csharp/NUnit.TestProject/NUnit.Project.csproj +++ b/docs/core/testing/snippets/order-unit-tests/csharp/NUnit.TestProject/NUnit.Project.csproj @@ -11,7 +11,7 @@ - + all runtime; build; native; contentfiles; analyzers 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 5b6befc320641..af13e3c5d6827 100644 --- a/docs/core/testing/snippets/order-unit-tests/csharp/XUnit.TestProject/XUnit.Project.csproj +++ b/docs/core/testing/snippets/order-unit-tests/csharp/XUnit.TestProject/XUnit.Project.csproj @@ -9,8 +9,8 @@ - - + + 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 06a1c35dd96f9..b4c7b3342fafb 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 f1ffb4c6eb93a..e7a04e7151de8 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,8 +8,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive 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 dfa11a94d5508..424113dc114a3 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,7 +7,7 @@ - + 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 76cbf0c3f31b8..75a8745eab277 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,8 +11,8 @@ - - + + 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 ba373ba818666..e1da2c70ecf15 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,8 +8,8 @@ - - + + diff --git a/docs/core/whats-new/dotnet-9/runtime.md b/docs/core/whats-new/dotnet-9/runtime.md index 2d870d305aedb..c23d90899ee93 100644 --- a/docs/core/whats-new/dotnet-9/runtime.md +++ b/docs/core/whats-new/dotnet-9/runtime.md @@ -24,7 +24,7 @@ Two new attributes make it possible to define [feature switches](https://github. [FeatureSwitchDefinition("Feature.IsSupported")] internal static bool IsSupported => AppContext.TryGetSwitch("Feature.IsSupported", out bool isEnabled) ? isEnabled : true; - internal static Implementation() => ...; + internal static void Implementation() => ...; } ``` @@ -48,7 +48,7 @@ Two new attributes make it possible to define [feature switches](https://github. internal static bool IsSupported => RuntimeFeature.IsDynamicCodeSupported; [RequiresDynamicCode("Feature requires dynamic code support.")] - internal static Implementation() => ...; // Uses dynamic code + internal static void Implementation() => ...; // Uses dynamic code } ``` 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 62058909ec6fa..346db5a69f871 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/csharp/asynchronous-programming/snippets/generate-consume-asynchronous-streams/finished/IssuePRreport.csproj b/docs/csharp/asynchronous-programming/snippets/generate-consume-asynchronous-streams/finished/IssuePRreport.csproj index 8e67172b9a43b..46376f06f1a38 100644 --- a/docs/csharp/asynchronous-programming/snippets/generate-consume-asynchronous-streams/finished/IssuePRreport.csproj +++ b/docs/csharp/asynchronous-programming/snippets/generate-consume-asynchronous-streams/finished/IssuePRreport.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/csharp/asynchronous-programming/snippets/generate-consume-asynchronous-streams/start/IssuePRreport.csproj b/docs/csharp/asynchronous-programming/snippets/generate-consume-asynchronous-streams/start/IssuePRreport.csproj index 8e67172b9a43b..46376f06f1a38 100644 --- a/docs/csharp/asynchronous-programming/snippets/generate-consume-asynchronous-streams/start/IssuePRreport.csproj +++ b/docs/csharp/asynchronous-programming/snippets/generate-consume-asynchronous-streams/start/IssuePRreport.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/csharp/language-reference/keywords/index.md b/docs/csharp/language-reference/keywords/index.md index 4d5245e3464c7..4f7d06539e43f 100644 --- a/docs/csharp/language-reference/keywords/index.md +++ b/docs/csharp/language-reference/keywords/index.md @@ -125,7 +125,7 @@ A contextual keyword is used to provide a specific meaning in the code, but it i [`equals`](equals.md) :::column-end::: :::column::: - [`field`](field.md) + [`field`](field.md) [`file`](file.md) [`from`](from-clause.md) [`get`](get.md) diff --git a/docs/csharp/language-reference/operators/snippets/shared/operators.csproj b/docs/csharp/language-reference/operators/snippets/shared/operators.csproj index 188edf8483cd2..d525383ec35b2 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/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 84620239008be..6cdce3b4ea3f8 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/style-guide/formatting.md b/docs/fsharp/style-guide/formatting.md index 17dea247a3e6f..40646fdd7c289 100644 --- a/docs/fsharp/style-guide/formatting.md +++ b/docs/fsharp/style-guide/formatting.md @@ -2103,13 +2103,14 @@ This section discusses formatting types and type annotations. This includes form F# allows both postfix style of writing generic types (for example, `int list`) and the prefix style (for example, `list`). Postfix style can only be used with a single type argument. -Always prefer the .NET style, except for five specific types: +Always prefer the .NET style, except for six specific types: 1. For F# Lists, use the postfix form: `int list` rather than `list`. 2. For F# Options, use the postfix form: `int option` rather than `option`. 3. For F# Value Options, use the postfix form: `int voption` rather than `voption`. 4. For F# arrays, use the postfix form: `int array` rather than `array` or `int[]`. 5. For Reference Cells, use `int ref` rather than `ref` or `Ref`. +6. For F# Sequences, use the postfix form: `int seq` rather than `seq`. For all other types, use the prefix form. diff --git a/docs/fundamentals/code-analysis/quality-rules/ca1802.md b/docs/fundamentals/code-analysis/quality-rules/ca1802.md index bd59f490aaa9f..e6e4971d28287 100644 --- a/docs/fundamentals/code-analysis/quality-rules/ca1802.md +++ b/docs/fundamentals/code-analysis/quality-rules/ca1802.md @@ -49,6 +49,12 @@ To fix a violation of this rule, replace the `static` and `readonly` modifiers w It is safe to suppress a warning from this rule, or disable the rule, if performance is not of concern. +> [!WARNING] +> For public or externally visible members, changing `static readonly` to `const` can lead to issues. `const` values are embedded in dependent assemblies at compile time, so changes in the library's value might not propagate, potentially causing errors. If the value of your member might change in the future, suppress this rule. + +> [!NOTE] +> Using `const` is safe for `private` members and generally safe for `internal` members unless exposed via `InternalsVisibleTo` or deployed separately. + ## Suppress a warning If you just want to suppress a single violation, add preprocessor directives to your source file to disable and then re-enable the rule. diff --git a/samples/snippets/core/testing/unit-testing-best-practices/csharp/after/unit-testing-best-practices-after.csproj b/samples/snippets/core/testing/unit-testing-best-practices/csharp/after/unit-testing-best-practices-after.csproj index bc36f5852515a..4aab5d9ae3c7c 100644 --- a/samples/snippets/core/testing/unit-testing-best-practices/csharp/after/unit-testing-best-practices-after.csproj +++ b/samples/snippets/core/testing/unit-testing-best-practices/csharp/after/unit-testing-best-practices-after.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/samples/snippets/core/testing/unit-testing-best-practices/csharp/before/unit-testing-best-practices-before.csproj b/samples/snippets/core/testing/unit-testing-best-practices/csharp/before/unit-testing-best-practices-before.csproj index bc36f5852515a..4aab5d9ae3c7c 100644 --- a/samples/snippets/core/testing/unit-testing-best-practices/csharp/before/unit-testing-best-practices-before.csproj +++ b/samples/snippets/core/testing/unit-testing-best-practices/csharp/before/unit-testing-best-practices-before.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/samples/snippets/core/testing/unit-testing-using-dotnet-test/csharp/PrimeService.Tests/PrimeService.Tests.csproj b/samples/snippets/core/testing/unit-testing-using-dotnet-test/csharp/PrimeService.Tests/PrimeService.Tests.csproj index 589f489f449fa..ee956a34f086e 100644 --- a/samples/snippets/core/testing/unit-testing-using-dotnet-test/csharp/PrimeService.Tests/PrimeService.Tests.csproj +++ b/samples/snippets/core/testing/unit-testing-using-dotnet-test/csharp/PrimeService.Tests/PrimeService.Tests.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/samples/snippets/core/testing/unit-testing-using-nunit/csharp/PrimeService.Tests/PrimeService.Tests.csproj b/samples/snippets/core/testing/unit-testing-using-nunit/csharp/PrimeService.Tests/PrimeService.Tests.csproj index 6090342746f33..838c456fc0ba4 100644 --- a/samples/snippets/core/testing/unit-testing-using-nunit/csharp/PrimeService.Tests/PrimeService.Tests.csproj +++ b/samples/snippets/core/testing/unit-testing-using-nunit/csharp/PrimeService.Tests/PrimeService.Tests.csproj @@ -12,7 +12,7 @@ - + all runtime; build; native; contentfiles; analyzers 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 ec21e2b0ac103..97aa298c5042d 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 @@ - - + +