Documentation culture does not respect DOTNET_SYSTEM_GLOBALIZATION_INVARIANT
See original GitHub issueNormally, you want to enforce culture-invariant builds to not risk affecting the build output by the culture of the build agent or (worse) workstation.
To resolve this, we run all builds with DOTNET_SYSTEM_GLOBALIZATION_INVARIANT
. This crashes some documentation rules because these are newing up a CultureInfo with the hard coded default of “en-US”.
As a workaround we can add a config setting the “documentationCulture” to “” (which means the invariant culture).
This is needed because it seems the behaviour of this mode was changed in .NET 6.0, previously setting it meant that all cultures were treated as the invariant culture, as documented here https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md#cultures-and-culture-data
With .net 6 it appears it instead throws an exception, so this is possibly to be treated as a .net 6 compatibility issue in this library.
(Note that there are many ways to enable the global invariant mode, so checking for the environment variable is not sufficient)
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
Globalization invariant mode is not necessarily something exotic that can only happen when the user manually overrides the behavior of the runtime. It is for example enabled in official .Net Docker Alpine images: https://github.com/dotnet/dotnet-docker/blob/65ebd21a6e8f574aaaa80bd53a073ed8e9923e4a/src/runtime-deps/3.1/alpine3.14/amd64/Dockerfile#L20
Excatly, I ended here because we are upgrading to .Net 6 and changing our CI/CD to arm64 and during the build we saw a lot of this errors