We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

The type initializer for 'Aspose.Words.Properties.BuiltInDocumentProperties' threw an exception

Hi Aspose,

I am using Aspose word component to generate PDF document.

Actually i am working on CRM plugin where i am generating some document using this Aspose word component, and merging this with my plugin and publishing to CRM.

When i run the code to generate document and it is throwing error in creating the object of document.
Document doc = new Document();

followings are the 2 different error messages i am getting:

“The type initializer for ‘Aspose.Words.Properties.BuiltInDocumentProperties’ threw an exception. Inner Except: Object reference not set to an instance of an object.”

"The type initializer for ‘Aspose.Words.Properties.BuiltInDocumentProperties’ threw an exception. Inner Exception: Non-negative number required.\nParameter name: value"

Do you have any other methods to merge with my assembly ?

please suggest me over this and help me to solve my issue.

And one more thing i have run the same code outside the CRM context it is fine.

Thanks in advance,
Veeresh Radder.

Hi Veeresh,

Thanks for your inquiry.

Please note that Aspose.Words is a CLS compliant .NET assembly, written entirely in C# and it will work under the Partial Trust in case you use it to generate, modify or convert documents in any format
except PDF or XPS. You need to run your application under Full Trust because Aspose.Words needs to enumerate.

Please see the following link to learn more about Aspose.Words features:

It would be great if you please share some more detail about your scenario. We will then provide you more information about your query.