We’re using Aspose.Cells 19.11.0 for .NET in a .NET Core 3.1 application. When reading any XLS file, a CultureNotFoundException is thrown with the following message:
Culture is not supported. (Parameter 'culture') 1043 (0x0413) is an invalid culture identifier.
Here are the exception details:
System.Globalization.CultureNotFoundException HResult=0x80070057 Message=Culture is not supported. Source=System.Private.CoreLib StackTrace: at System.Globalization.CultureData.GetCultureData(Int32 culture, Boolean bUseUserOverride) at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride) at .(Int16 ) at .(CountryCode ) at .(CountryCode ) at Aspose.Cells.WorkbookSettings.set_Region(CountryCode value) at . ( ) at . ( ) at . (Stream ) at .( , Stream ) at .( , Stream ) at .( , String ) at .() at .(String , Stream , LoadOptions ) at Aspose.Cells.Workbook.(String , LoadOptions ) at Aspose.Cells.Workbook..ctor(String file) at Tools.IO.ExcelConverter.ConvertToXlsxStream(String fullPath)
Interestingly this exception is not thrown if we directly read an XLS file via a .NET Core console application. But in our .NET Core Web API project, this exception occurs. We tried to set the current culture to invariant or ‘en-US’ in many different ways, but nothing solves this error.
Any ideas how to fix this? So that we can use Aspose.Cells in our API project?