System.TypeInitializationException when using Aspose.Words with ILMerge

Hello

We want to use Aspose.Words in a Dynamics CRM plugin. Dynamics CRM requires all dependent assemblies merged into one assembly using ILMerge.
Unfortunately, Aspose.Words.dll throws a TypeInitializationException when the Aspose.Words.dll is merged into the calling assembly.
Problem is easily reproducable: Create a class library which tries to save a Docx file using Pdf Save Options.
Merge Aspose.Words.dll into the Class Library.
Call the class library.

Exception details:
The type initializer for ‘Aspose.Words.Properties.BuiltInDocumentProperties’ threw an exception.

I’ve attached a solution which reproduces the behaviour. The same code runs without any problems when using Aspose with a normal reference.

Hi Rolf,


Thanks for your inquiry. I checked attached projects with visual studio 2012 and was not able to reproduce this exception on my end. Could you please download the attached project from forum again and double check if the error is still reproducible when using Aspose.Words 14.7.0?

Best regards,

Hi Awais

I double checked, the error still occurs. Please be aware that the exception is only thrown with ConsoleApplication1 (named ConsoleApplication.Problem in the solution). The other project, Console Application, named ConsoleApplicationWorking, is only attached as an example to proof the error only occurs when using Aspose in a merged library.

The ILMerge Tool is called in the Post Build Event of the AsposeTest Project. I included the ILMerge Tool in the project.

Maybe you're referencing the unmerged version of AsposeTest.dll when you're reproducing the error. This will work. I modified the project to ensure the correct (AsposeMerged.dll, not working) dll is referenced and attached it again.

I use Version 14.7.0.0 of Aspose.Words.dll.

Best regards

Rolf

Hi Rolf,


Thanks for the additional information. I tested the scenario and have managed to reproduce the same problem on my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-10704. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-10704) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.