Background
The compile time SDK can have significant impact on the resulting library. The global.json doesn't need to have definitive exact information, plus it's just optional.
With compiler flags we can get more precise info (based on research of top 150 nugets ~ 21% of those do not have the new verion of compiler flag, while exposing their sources - so it seems we can rely on compiler flags in substantial share of reconstructable packages).
Motivation
To notify user about possible resulting binary differences due to using mismatched SDK. Possibly offering to install and use matching SDK
Technical details
Background
The compile time SDK can have significant impact on the resulting library. The
global.jsondoesn't need to have definitive exact information, plus it's just optional.With compiler flags we can get more precise info (based on research of top 150 nugets ~ 21% of those do not have the new verion of compiler flag, while exposing their sources - so it seems we can rely on compiler flags in substantial share of reconstructable packages).
Motivation
To notify user about possible resulting binary differences due to using mismatched SDK. Possibly offering to install and use matching SDK
Technical details
NugetPackageExplorrercode (https://github.com/NuGetPackageExplorer/NuGetPackageExplorer/blob/main/Core/SymbolValidation/SymbolValidator.cs#L145), or possibly the Roslyn code (mostly internal though, https://github.com/dotnet/roslyn/blob/main/src/Tools/BuildValidator/Program.cs)