How do I enable .Net Core Globalization Invariant Mode?

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.

Thanks, logged as bugs://81530

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.

bugs://81530 got closed with status fixed.

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
    }
  }
}

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

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