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

Fix server info error on .NET 4.8 #6201

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

bdukes
Copy link
Contributor

@bdukes bdukes commented Nov 7, 2024

When a Version only has two parts (e.g. new Version("4.8")), it throws an exception when calling .ToString(3). This PR adds a string FormattedNetFrameworkVersion property to Globals (to complement Version Globals.NETFrameworkVersion) and replaces all usages of Globals.NETFrameworkVersion.ToString with Globals.FormattedNetFrameworkVersion. This property uses Globals.FormatVersion to do the formatting, which has logic to replace a -1 from a two-digit version with a 0 to make a three-digit version.

I also added a few tests for Globals.FormatVersion to verify its behavior and documented that only the verbose overload has that logic and that Globals.FormatVersion(new Version("4.8")) will output "04.00.-01".

Fixes #6200

@bdukes bdukes added this to the 9.13.6 milestone Nov 7, 2024
Copy link
Contributor

@valadas valadas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome

@valadas
Copy link
Contributor

valadas commented Nov 7, 2024

@bdukes looks like one test is failing here:

image

@bdukes
Copy link
Contributor Author

bdukes commented Nov 7, 2024

@bdukes looks like one test is failing here:

image

🤦🏻‍♂️ thanks, fix pushed

@valadas
Copy link
Contributor

valadas commented Nov 7, 2024

@bdukes Awesome, thanks!

@valadas valadas merged commit 7a31fdc into dnnsoftware:develop Nov 7, 2024
3 checks passed
@bdukes bdukes deleted the fix-server-info-version branch November 19, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Dnn.PersonaBar.UI.Services.ServerSummaryController.GetServerInfo() ToString fieldCount Net 4.8
3 participants