-
Notifications
You must be signed in to change notification settings - Fork 470
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
Trim leading v from TargetFrameworkVersion #7544
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -285,8 +285,7 @@ private static bool PlatformAnalysisAllowed(AnalyzerOptions options, Compilation | |
string tfmVersion = options.GetMSBuildPropertyValue(MSBuildPropertyOptionNames.TargetFrameworkVersion, compilation) ?? ""; | ||
|
||
if (tfmIdentifier.Equals(NetCoreAppIdentifier, StringComparison.OrdinalIgnoreCase) && | ||
tfmVersion.StartsWith("v", StringComparison.OrdinalIgnoreCase) && | ||
Version.TryParse(tfmVersion[1..], out var version) && | ||
Version.TryParse(tfmVersion.TrimStart(['v', 'V']), out var version) && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Worth noting that the reason this is Since we're .NET Standard 2.0, there is no |
||
version.Major >= 5) | ||
{ | ||
// We want to only support cases we know are well-formed by default | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An interesting "quirk" of this is that technically
vvvvvvvv5.0
is also valid (and the SDK appears to "support" it as well since they also justTrimStart("vV")
); but I don't think that's worth adding an explicit test around 😄