Pretty stuck here. No matter what I do, after publishing the project to IIS the invariant globalization is always set to true. I’ve confirmed the runtime template does update items, but even if I have the value set to false in the template it still ignores it and sets it to true. When running locally it is false. This is only an issue after publishing.
Publish settings:
Config: release
Target Framework: net8.0
Deployment Mode: Framework-dependent
Target Runtime: win-x64
I’ve done a few things..
- I’ve set
<InvariantGlobalization>false</InvariantGlobalization>
in my project file - I’ve tried setting this:
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="false" />
- I’ve tried setting the environment variable in my web config:
<environmentVariable name="DOTNET_SYSTEM_GLOBALIZATION_INVARIANT" value="false" />
- I’ve tried setting invariant globalization to false in the runtimeconfig.template.json
{
"configProperties": {
"System.Globalization.Invariant": true
}
}
I’ve even ran a post-publish powershell script and logs confirm it does set it to false, but I don’t know if it’s permission issues or what. After it hits the server and I inspect the file, I can see that it’s still true. The only resolution I have at this point is manually updating the app.runtimeconfig.json on the server itself after every time I publish.