From bc5319463f0efbfcd877f18afd4dba727519ab01 Mon Sep 17 00:00:00 2001 From: Chris Wolfgang <210299580+Chris-Wolfgang@users.noreply.github.com> Date: Sun, 20 Sep 2026 16:28:31 -0400 Subject: [PATCH] build(analyzers): load PublicApiAnalyzers only in projects that track their API The template references Microsoft.CodeAnalysis.PublicApiAnalyzers with Condition="Exists('PublicAPI.Shipped.txt') or Exists('PublicAPI.Unshipped.txt')" so the analyzer only runs where the API files are. This repository's copy had lost the condition, so the analyzer loaded in every project - including tests, which track no API - and InspectCode reported RS0016/RS0037 for every public test type (the build hides them behind the blanket suggestion severity). Restores the condition; the AdditionalFiles items were already conditional. Co-Authored-By: Claude Opus 5 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 2377cb44..a7b9114d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -73,7 +73,7 @@ Library projects under src/ should opt in; test / example / benchmark projects should not. Per-repo enablement is tracked as a follow-up maintenance issue. --> - + all runtime; build; native; contentfiles; analyzers; buildtransitive