From 60d50934215042ac5dfd74d4ccab6ec2858ee798 Mon Sep 17 00:00:00 2001 From: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com> Date: Wed, 11 Mar 2026 10:47:08 +0000 Subject: [PATCH] .NET: SDK Patch Bump (10.0.200) - Address false positive trigger of IL2026/IL3050 diagnostics in hosting projects (#4586) * Suppress IL2026/IL3050 with targeted pragmas on affected methods Add #pragma warning disable/restore for IL2026 and IL3050 only around the specific methods where dotnet format incorrectly adds [RequiresUnreferencedCode] and [RequiresDynamicCode] attributes despite proper interceptors configuration in the csproj. See https://github.com/dotnet/sdk/issues/51136 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Upgrade to .NET SDK 10.0.200 and remove IL2026/IL3050 workarounds Bump global.json to SDK 10.0.200 which fixes the dotnet format bug that incorrectly added [RequiresUnreferencedCode] and [RequiresDynamicCode] attributes (https://github.com/dotnet/sdk/issues/51136). Remove all #pragma warning disable IL2026/IL3050 workarounds from source files and the --exclude-diagnostics flag from the CI format workflow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/dotnet-format.yml | 3 +-- dotnet/global.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet-format.yml b/.github/workflows/dotnet-format.yml index 8d7c9febb7..8bdaeba8a3 100644 --- a/.github/workflows/dotnet-format.yml +++ b/.github/workflows/dotnet-format.yml @@ -86,11 +86,10 @@ jobs: run: docker pull mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet }} # This step will run dotnet format on each of the unique csproj files and fail if any changes are made - # exclude-diagnostics should be removed after fixes for IL2026 and IL3050 are out: https://github.com/dotnet/sdk/issues/51136 - name: Run dotnet format if: steps.find-csproj.outputs.csproj_files != '' run: | for csproj in ${{ steps.find-csproj.outputs.csproj_files }}; do echo "Running dotnet format on $csproj" - docker run --rm -v $(pwd):/app -w /app mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet }} /bin/sh -c "dotnet format $csproj --verify-no-changes --verbosity diagnostic --exclude-diagnostics IL2026 IL3050" + docker run --rm -v $(pwd):/app -w /app mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet }} /bin/sh -c "dotnet format $csproj --verify-no-changes --verbosity diagnostic" done diff --git a/dotnet/global.json b/dotnet/global.json index 482aa6b8d3..42bb8863a3 100644 --- a/dotnet/global.json +++ b/dotnet/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.100", + "version": "10.0.200", "rollForward": "minor", "allowPrerelease": false },