Repository navigation
chore: explicit usings on every TFM (no implicit/global usings in multi-TFM projects) - #656
Merged
Merged
Conversation
…ti-TFM projects) Disable ImplicitUsings and drop the global `<Using Include="Xunit" />` in the two multi-target unit test projects (Abstractions.Tests.Unit, ErrorPolicies.Tests.Unit), and add the explicit using directives each file needs. With implicit usings on, the modern TFM slices got System/System.Linq/etc. globally, so single-slice analysis (InspectCode) flagged the usings net462/netstandard need as redundant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Rule: a project that targets multiple TFMs must not use implicit or global usings; every file states its own
usingdirectives.With
<ImplicitUsings>enable</ImplicitUsings>, the net8.0+ slices getSystem,System.Linq,System.Threading.Tasksetc. globally. InspectCode analyses one modern TFM slice, so it flags usings that net462 / netstandard genuinely need asRedundantUsingDirective, which produced false-positive code-scanning alerts. With implicit usings off, each file's usings are required on every TFM.Changes
Multi-TFM projects that had implicit/global usings (the
srcprojects and the other multi-TFM test projects already had them off):tests/Wolfgang.Etl.Abstractions.Tests.Unit/Wolfgang.Etl.Abstractions.Tests.Unit.csproj:ImplicitUsingsset todisable, global<Using Include="Xunit" />removedtests/Wolfgang.Etl.ErrorPolicies.Tests.Unit/Wolfgang.Etl.ErrorPolicies.Tests.Unit.csproj: sameExplicit
usingdirectives added to the 55.csfiles in those projects (System-first order). A temporary IDE0005-as-warning build across all 11 TFMs (not committed) was used to drop any added using that was unnecessary on every TFM. Changelog fragment:internal.No behaviour or public API change; no protected files touched.
Verified locally
dotnet build ETL-Abstractions.sln -c Release: 0 warnings, 0 errorsscripts/build-pr.ps1: all checks passed (13630/13630 test executions passed across TFMs, coverage gate passed)🤖 Generated with Claude Code