Conversation
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
…yzers Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
|
@copilot Please update this PR to use a shared “analyzers from source + pack-only dependency” pattern so we keep NuGet dependency shape unchanged while avoiding duplicate analyzer inclusion. GoalFor Roslyn projects that currently depend on
Required implementation1) Add shared opt-in analyzer
|
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Implemented in aeb04bb. Changes made:
Validation notes:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This updates the repo to replace direct per-project
Microsoft.CodeAnalysis.Analyzerswiring with a shared analyzers-from-source + pack dependency preservation pattern.Centralized shared analyzer wiring
eng/targets/Settings.props:UseRoslynAnalyzersFromSource(defaultfalse)IncludeRoslynAnalyzersPackageDependency(defaultfalse)ProjectReferencelogic ineng/targets/Imports.targetswhenUseRoslynAnalyzersFromSource=true.src/RoslynAnalyzers/Microsoft.CodeAnalysis.Analyzers/Core/Microsoft.CodeAnalysis.Analyzers.csprojsrc/RoslynAnalyzers/Microsoft.CodeAnalysis.Analyzers/CSharp/Microsoft.CodeAnalysis.CSharp.Analyzers.csprojsrc/RoslynAnalyzers/Microsoft.CodeAnalysis.Analyzers/VisualBasic/Microsoft.CodeAnalysis.VisualBasic.Analyzers.vbprojReferenceOutputAssembly="false"OutputItemType="Analyzer"PrivateAssets="all"Preserve NuGet dependency shape without double analyzer consumption
PackageReference Include="Microsoft.CodeAnalysis.Analyzers"with analyzer/build assets excluded so analyzers come from source project outputs while dependency metadata is retained for packing.eng/Packages.propseng/Version.Details.propseng/Version.Details.xmlProject opt-in / scope
src/viasrc/Directory.Build.props(UseRoslynAnalyzersFromSource=truefor non-source-only builds).src/Compilers/Core/Portable/Microsoft.CodeAnalysis.csprojsrc/CodeStyle/Core/Analyzers/Microsoft.CodeAnalysis.CodeStyle.csprojsrc/Tools/Source/CompilerGeneratorTools/Source/CSharpSyntaxGenerator/CSharpSyntaxGenerator.csprojMicrosoft.CodeAnalysis.csprojMicrosoft.CodeAnalysis.CodeStyle.csprojCleanup of conflicting/duplicated wiring
Microsoft Reviewers: Open in CodeFlow
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.