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

InvariantGlobalization appears in ASP.NET Core WebAPI but is not stated in documentation #38438

Open
patr543a opened this issue Nov 27, 2023 · 5 comments
Labels
dotnet-fundamentals/svc Pri1 High priority, do before Pri2 and Pri3 ⌚ Not Triaged Not triaged

Comments

@patr543a
Copy link

Type of issue

Missing information

Description

The true is now included in the .csproj for ASP.NET Core WebAPI (Potentially others as well) which may break certain frameworks and it's not clear this is the cause (Took me 2 hours to find this was the problem personally), i belive if it was stated on the changes i might have noticed it

Page URL

https://learn.microsoft.com/en-us/dotnet/core/compatibility/8.0

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/compatibility/8.0.md

Document Version Independent Id

1dc7a986-52e6-3a88-0163-4a869afc75d3

Article author

gewarren

Metadata

  • ID: 250b5b35-569a-c5fa-2bf8-9d951bc1bdb7
  • Product: dotnet-fundamentals
@dalibormesaric
Copy link

I would also like to see docs explaining how to do this for the chiseled images.

@patr543a
Copy link
Author

I would also like to see docs explaining how to do this for the chiseled images.

What exactly are you talking about? This has nothing to do with images at all

@eerhardt
Copy link
Member

The true is now included in the .csproj for ASP.NET Core WebAPI (Potentially others as well) which may break certain frameworks

This wasn't intentional. InvariantGlobalization should only be enabled in the templates that target native AOT. The WebApi template doesn't support native AOT. Instead to get AOT support, there is a new template: dotnet new webapiaot, which sets InvariantGlobalization. We will fix the WebApi template to not set this by default.

I would also like to see docs explaining how to do this for the chiseled images.

The chiseled images don't contain ICU by default, and as such set DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true environment variable. See

@patr543a
Copy link
Author

The true is now included in the .csproj for ASP.NET Core WebAPI (Potentially others as well) which may break certain frameworks

This wasn't intentional. InvariantGlobalization should only be enabled in the templates that target native AOT. The WebApi template doesn't support native AOT. Instead to get AOT support, there is a new template: dotnet new webapiaot, which sets InvariantGlobalization. We will fix the WebApi template to not set this by default.

I would also like to see docs explaining how to do this for the chiseled images.

The chiseled images don't contain ICU by default, and as such set DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true environment variable. See

I was shown a PR saying it should be enabled as most API's don't need it so i was told to report it as a docs problem instead.

@eerhardt
Copy link
Member

I was shown a PR saying it should be enabled as most API's don't need it so i was told to report it as a docs problem instead.

That was the original intention with dotnet/aspnetcore#47066, but that decision was relaxed later to only set InvariantGlobalization when the project has native AOT enabled. See dotnet/aspnetcore#48238. We just missed a few places when relaxing this decision, which I'm fixing now. See dotnet/aspnetcore#52428.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet-fundamentals/svc Pri1 High priority, do before Pri2 and Pri3 ⌚ Not Triaged Not triaged
Projects
None yet
Development

No branches or pull requests

4 participants