Set Analyzer Dependencies as PrivateAssets to Prevent Consumer Warnings #13
+3
−1
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.
Thank you for creating and maintaining such a great library! We are active users of this project, and it has been very helpful in our development.
Recently, after updating to the latest version, we noticed that analyzers were added as dependencies, which resulted in new warnings being reported in our own codebases.
As these analyzers are only needed for the implementation of this library itself and have no impact on the consumers, setting them as PrivateAssets ensures that they are not included in downstream projects. This prevents users from unintentionally receiving analyzer warnings originating from this library.
We initially tried to work around this by using the ExcludeAssets option, but due to dotnet/sdk#1212 — which is still unresolved — analyzers are still included even when excluded in the project file.
This change properly ensures that consumers will not have analyzers from this library included by default.