Csproj InvariantGlobalization>true< leads to an overall error in generation

var layoutCollector = new LayoutCollector(asposeBuilder.Document);
currentPageNumber = layoutCollector.GetEndPageIndex(table.LastChild); // got error here

error: The type initializer for ‘Gg’ threw an exception.
more errors from stack-trace
TypeInitializationException: The type initializer for ‘Vu’ threw an exception.
CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode. See Globalization config settings - .NET | Microsoft Learn for more information. (Parameter ‘name’)
en-nz is an invalid culture identifier.

Is that possible to add InvariantGlobalization = true to a Words? It is very important cause of Linux adds not certified additions to support cultures, that can possibly be banned

Btw, there no issue in Cells for a almost similar document structure generation.

@bloodboilAaromatic

The error you’re encountering is related to the globalization settings in your .NET application. When you set InvariantGlobalization to true, it restricts the application to only use the invariant culture, which can lead to issues when your code tries to access specific culture identifiers like “en-nz”.

Aspose.Words does not have a built-in option to directly support InvariantGlobalization. However, you can work around this issue by ensuring that your application does not rely on culture-specific features when working with Aspose.Words.

Here are a few suggestions to mitigate the issue:

  1. Use Invariant Culture: Ensure that any culture-specific operations in your code are replaced with invariant culture operations. For example, when formatting dates or numbers, use CultureInfo.InvariantCulture.

  2. Catch Exceptions: Implement error handling around the code that interacts with Aspose.Words to gracefully handle any exceptions that may arise due to culture issues.

  3. Test on Different Environments: If possible, test your application in environments that do not have the invariant globalization setting to see if the issue persists.

If you need further assistance, consider reaching out to the Aspose support community for more specific guidance on handling globalization issues with Aspose.Words.

@bloodboilAaromatic You should specify the predefined cultures setting in order to use Aspose.Words under globalization invariant mode:

<PredefinedCulturesOnly>false</PredefinedCulturesOnly>

However, in fact Aspose.Words heavy depends on globalization feature it may behave incorrect in some cases.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-27235

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Exactly, exactly as anticipated, we already tested it on linux and all projections are clean. So, yeah, please do not close a ticket cause, still, cells doesn’t require something like that while words does.

@bloodboilAaromatic We consider to detect GIM and avoid initialization of specific locales. But, there is no public API for that (the proposal is not implemented).