-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[release/6.0] Backport Fix PerformanceCounter's when running with Globalization Invariant Mode #65537
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
Conversation
…Globalization Invariant Mode (PR dotnet#65414)
|
Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti, @safern Issue Detailsnull
|
|
Tagging subscribers to this area: @dotnet/area-system-diagnostics-performancecounter Issue DetailsBackport of #65414 to release/6.0 /cc @tarekgh Customer ImpactThis is a migration to .NET 6.0 blocker for users who enable Globalization Invariant Mode on their app and try to use the performance counter library. TestingThis change is already merged in .NET 7.0 and passing all regression and CI tests. Also, I added a new test for testing the library when enabling the Globalization Invariant Mode. RiskThe low as the change scoped to the performance counter library which is supported on Windows only and all the changes is changing the creation of the culture using the LCID to use the culture name instead which should be exact result anyway but will avoid the exception.
|
|
@tarekgh just noticed this change affects an OOB package. Per the servicing instructions, if the csproj has the You also need to add the Here are a couple of examples (we had to add the property on the next release because we forgot): #65523 #65733 Can you please add the change? |
|
@carlossanlop @ericstj could you please have a look at the last commit in this PR? Thanks! |
ericstj
left a comment
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.
LGTM
|
Failure is fixed by #66366 |
Fixes #65502
Backport of #65414 to release/6.0
/cc @tarekgh
Customer Impact
This is a migration to .NET 6.0 blocker for users who enable Globalization Invariant Mode on their app and try to use the performance counter library.
Performance counter library has old code which creating CultureInfo object using LCID. LCID is an obsolete concept, and it is recommended to always create a culture with the language tag names instead. When enabling the Globalization Invariant Mode, we don't support creating cultures using LCID at all as we don't depend on the underlying OS at all. This will cause the code in the performance counter library to throw an exception. That means there is no way to use this library when enabling the invariant mode.
Testing
This change is already merged in .NET 7.0 and passing all regression and CI tests. Also, I added a new test for testing the library when enabling the Globalization Invariant Mode.
Risk
Low as the change scoped to the performance counter library which is supported on Windows only and all the changes is changing the creation of the culture using the LCID to use the culture name instead which should be exact result anyway but will avoid the exception.