-
Notifications
You must be signed in to change notification settings - Fork 29
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
Option to make a single package version support multiple versions of Roslyn #416
Comments
@jnm2 I have used this approach for my company analyzer and it works for switching between 3.x and 4.0 version. |
I'd have to look through MSBuild Structured Log Viewer for candidates, but I'm pretty sure I've seen the SDK version itself as a properly and the major versions line up in parallel if all else fails. |
I think it would be good to have. If also supporting 2.x is too hard, then I think we should leave it behind. Looking at the download number from nuget we have 584 downloads of version 2.x and 252K downloads of version 3.x. So very few use the analyzers in VS 2017. |
@mikkelbu I will be working on this. Can you assign it to me (or give me assign limited rights in this repository)? |
Thanks @manfred-brands. I've assigned the issue to you and I will look into giving you more rights in this repo as you have been the main driving force the last couple of years 👍 |
StrongInject is gaining the ability to build for both Roslyn 3.8 and 4.0 in the same package: YairHalberstadt/stronginject#181. Another package that does the same thing is https://github.com/reactiveui/refit.
A similar (but not exactly identical) approach could be used to build for both Roslyn 2.x and 3.x (and even 4.x) in one package if you were interested.
The .NET SDK starting with v6 (= VS2022) natively understands how to properly load from .nupkg structures such as
analyzers/dotnet/roslyn3.8/cs/nunit.analyzers.dll
, and a package .targets file can fill in the gap for earlier versions.Besides the package file structure, this is the entirety of the .targets file needed in order to simultaneously support both Roslyn 3.8 and 4.0. It would need a few tweaks to work for 2.x and 3.x simultaneously:
For more on package .targets and .props files:
The text was updated successfully, but these errors were encountered: