Currently you have to reference the analyzer with PrivateAssets="All" to prevent the analyzer from flowing to referencing projects. However, this means referencing projects don't reference the Attributes package, which can cause issues with runtime reflection.
PrivateAssets="analyzers" would be the preferred solution but needs NuGet/Home#6279 to be resolved.
One workaround is to reference the Attributes package directly in projects that need it.
Currently you have to reference the analyzer with PrivateAssets="All" to prevent the analyzer from flowing to referencing projects. However, this means referencing projects don't reference the Attributes package, which can cause issues with runtime reflection.
PrivateAssets="analyzers" would be the preferred solution but needs NuGet/Home#6279 to be resolved.
One workaround is to reference the Attributes package directly in projects that need it.