Issue after upgrading ZATCA SDK to version 238-R3.4.6 – ConfigurationManager exception when generating invoice hash

Hello everyone,

I’m currently facing an issue after updating the ZATCA E-Invoice SDK from a previous version to 238-R3.4.6.

Previously, I was generating the invoice hash using this code snippet:

HashResult hashResult = new EInvoiceHashGenerator().GenerateEInvoiceHashing(document);

It was working perfectly fine.
However, after the SDK upgrade, I started getting the following error:

The type initializer for 'ZATCA.EInvoice.SDK.Utilities.ConfigurationManager' threw an exception.

I’ve already tried cleaning and rebuilding the project, but the issue persists.
It seems related to how the SDK initializes its internal configuration or loads resources, but I couldn’t find updated documentation for version R3.4.6.

Has anyone faced this issue before?
Any guidance or workaround to fix the ConfigurationManager initialization error would be greatly appreciated.

Thanks in advance for your help! :folded_hands:

You need to make sure that the Rules/schematrons directory is copied to the output directory. I had the same issue and copying the Rules/schematrons to the output directory solve the issue when running on a Windows VM, but I encountered the same problem again on Linux, even though the Rules/schematrons folder was correctly copied to the output directory after publishing.