Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResolveNuGetPackageAssets does not respect versioned analyzers #182

Closed
jaredpar opened this issue Apr 30, 2024 · 2 comments
Closed

ResolveNuGetPackageAssets does not respect versioned analyzers #182

jaredpar opened this issue Apr 30, 2024 · 2 comments

Comments

@jaredpar
Copy link
Member

jaredpar commented Apr 30, 2024

The behavior of ResolveNuGetPackageAssets has gotten out of sync with ResolvePackageAssets. A few years ago the ResolvePackageAssets task was updated to understand multi-targeted analyzers. That allows a NuPkg to deploy multiple versions of an analyzer targeted to different versions of the Roslyn API. Since then this behavior's been used in a number of high impact packages like System.Text.Json, Microsoft.Extensions.Logging.Abstractions, etc ...

That behavior was never replicated in ResolveNuGetPackageAssets. This means when a <PackageReference> to one of those NuPkg is done in an old style project it will end up resolving all of the analyzers in the NuPkg. Basically many different versions of the same analyzer. That essentially breaks the build as it can't be interpreted correctly by the compiler.

The NuPkg have tried to work around this by detecting unsuported scenarios and picking the most compatible analyzer. That is a band aid though. It removes one symptom of the problem while causing others. The real fix is getting these two asset resolutions back in sync with respect to features.

@jaredpar
Copy link
Member Author

@tmeschter FYI

@jaredpar
Copy link
Member Author

dupe of #152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant