From 4049158aae82ceb1f504fe860be09fcd1119c564 Mon Sep 17 00:00:00 2001 From: Chris Wolfgang <210299580+Chris-Wolfgang@users.noreply.github.com> Date: Sat, 25 Apr 2026 12:20:41 -0400 Subject: [PATCH] Move analyzer package references from Directory.Build.props to src csproj Analyzer packages (Roslynator, AsyncFixer, Microsoft.VisualStudio.Threading, BannedApiAnalyzers, Meziantou, SonarAnalyzer) and the BannedSymbols.txt AdditionalFiles entry now live in the source library project's csproj instead of being inherited by every project in the repo. Behavior change: tests, benchmarks, and examples no longer get analyzer warnings/errors. Only the shipped library code (Wolfgang.TryPattern) is subject to analyzer enforcement. Directory.Build.props retains the property settings (LangVersion, EnableNETAnalyzers, AnalysisLevel, EnforceCodeStyleInBuild, TreatWarningsAsErrors) which still apply repo-wide. Verified: dotnet build succeeds with 0 warnings, all 96 tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) --- Directory.Build.props | 47 +------------------ .../Wolfgang.TryPattern.csproj | 43 +++++++++++++++++ 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 1e556b8..5e35560 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,54 +6,11 @@ true latest true - + <_SkipUpgradeNetAnalyzersNuGetWarning>true - + true - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - diff --git a/src/Wolfgang.TryPattern/Wolfgang.TryPattern.csproj b/src/Wolfgang.TryPattern/Wolfgang.TryPattern.csproj index 1d692c6..6b36787 100644 --- a/src/Wolfgang.TryPattern/Wolfgang.TryPattern.csproj +++ b/src/Wolfgang.TryPattern/Wolfgang.TryPattern.csproj @@ -37,4 +37,47 @@ + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + +