I have been writing an analyzer and using .NET Standard 2.0 so that I could target .NET Framework 4.7.2, which I was using in the VSIX version of the analyzer. Soon however I chose to drop it as supporting it was not beneficial. Ever since I have wanted to upgrade the supported framework to .NET 5.0 to also get the new language features along the path.
How would that affect the end users that would include the analyzer to their projects through the released NuGet package? Should I also keep supporting the older framework versions?
You can't use anything other than .NET Standard 2.0, because VS runs under .Net Framework 4.* and the csc Roslyn compiler runs under .Net 5/6. The common ground is .NET Standard 2.0, nothing else will work.
This is still the case with VS 2022, it is still a .Net Framework application, the only difference is that it's now a 64-bit process, which means that your analyzer needs to be Any CPU to work in both.