Skip to content

Commit 60d5093

Browse files
.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 dotnet/sdk#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 (dotnet/sdk#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>
1 parent d3f0c33 commit 60d5093

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

.github/workflows/dotnet-format.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,10 @@ jobs:
8686
run: docker pull mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet }}
8787

8888
# This step will run dotnet format on each of the unique csproj files and fail if any changes are made
89-
# exclude-diagnostics should be removed after fixes for IL2026 and IL3050 are out: https://github.com/dotnet/sdk/issues/51136
9089
- name: Run dotnet format
9190
if: steps.find-csproj.outputs.csproj_files != ''
9291
run: |
9392
for csproj in ${{ steps.find-csproj.outputs.csproj_files }}; do
9493
echo "Running dotnet format on $csproj"
95-
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"
94+
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"
9695
done

dotnet/global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "10.0.100",
3+
"version": "10.0.200",
44
"rollForward": "minor",
55
"allowPrerelease": false
66
},

0 commit comments

Comments
 (0)