How do I enable .Net Core Globalization Invariant Mode?


(Philip Munts) #1

I need to build my .Net Core applications with Globalization Invariant Mode (https://github.com/dotnet/corefx/blob/master/Documentation/architecture/globalization-invariant-mode.md) set, which ultimately means that:

"configProperties": {
  "System.Globalization.Invariant": true
}

gets added to the .runtimeconfig.json file. With Microsoft tools I can accomplish this automatically by adding:

<ItemGroup>
    <RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
</ItemGroup>

to the .csproj file. But that doesn’t work in Elements.


(RemObjects) #2

Thanks, logged as bugs://81530


(marc hoffman) #3

Thanx for reporting this. i was not aware of this oprion yet, i’ll add support for RuntimeHostConfigurationOption for next weeks build — should be an easy fix once i’m back in the office.


(RemObjects) #4

bugs://81530 got closed with status fixed.


(marc hoffman) #5

Fixed:

<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
<RuntimeHostConfigurationOption Include="Foo" Value="false" />
<RuntimeHostConfigurationOption Include="Bar" Value="xxx" />  
<RuntimeHostConfigurationOption Include="Baz" Value="35" />  
{
  "runtimeOptions": {
    "tfm": ".NETCoreApp,Version=v2.1",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "2.1.2"
    },
    "runtimeOptions": {
      "System.Globalization.Invariant": true,
      "Foo": false,
      "Bar": "xxx",
      "Baz": 35
    }
  }
}

(Philip Munts) #6

Very close: But System.Globalization.Invariant needs to be inside configProperties, not runtimeOptions.


(marc hoffman) #7

Oops, of course, yes. that’s a typo/copy-paste error. fixed.