[release/7.0] Fix loading app-local ICU #77118
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #77065 to release/7.0
/cc @tarekgh
Customer Impact
Apps using the app-local feature will experience a crash when loading the app. This issue is reported by some user already.
Details
Early in .NET 7.0 cycle we have fixed an issue which was causing a hard build break. The build broke because ICU obsoleted one of the APIs and was generating compilation error if the code was using this API. We have fixed this by dynamically binding to the correct API at runtime (as we support different ICU versions). This fix works fine in the main scenario case but missed initialize this API pointer when apps opt-in using the app-local feature which causes the crash.
Testing
We have manually tested the fix using app-local feature and ensured the crash is gone and the apps behave correctly. We have added a completely new test to test the app-local feature to avoid such regressions in the future.
Risk
The risk is low because the change is only adding a call to the API pointer initialization in the app-local feature code path. Such initialization calls already existed and exercised in the mainstream cases when using the system ICU version.