System.TypeInitializationException: 'The type initializer for 'XSharp.ConversionHelpers' threw an exception.'
Posted: Mon Oct 02, 2023 2:25 pm
Hi, I've recently hit that exception when working on a asp.net core implementation of our webservices.
The culprit is
but also happens in NTrim function for example.
The xsharp lib referenced by the asp.net core website has been compiled using an sdk project type targeting .net8 as well.
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'XSharp.ConversionHelpers' threw an exception.
Source=XSharp.RT
StackTrace:
at XSharp.RT.Functions._VOVal(String cNumber)
at XSharp.RT.Functions.Val(String cNumber)
at PIniFile.ReadReal8(String cEntry, Double nDefault) in REDACTED
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')
en-US is an invalid culture identifier.
Any hint ?
Regards.
The culprit is
Code: Select all
nValue := Val( "100.00" )
The xsharp lib referenced by the asp.net core website has been compiled using an sdk project type targeting .net8 as well.
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'XSharp.ConversionHelpers' threw an exception.
Source=XSharp.RT
StackTrace:
at XSharp.RT.Functions._VOVal(String cNumber)
at XSharp.RT.Functions.Val(String cNumber)
at PIniFile.ReadReal8(String cEntry, Double nDefault) in REDACTED
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')
en-US is an invalid culture identifier.
Any hint ?
Regards.