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

Free Support Forum - aspose.com

License file error

I have read the posts and documentation on the license file, but I cannot get it to work correctly in SharePoint. It works for a while, but in a high volume multi-threaded environment, once it starts throwing the following error, it will throw the error repeatedly:

- Error: System.NullReferenceException: Object reference not set to an instance of an object. at .†.(Stream stream) at Aspose.Slides.License.SetLicense(Stream stream)


We are using Aspose controls within a SharePoint event receiver, so unfortunately we must initialize the license over and over. We initially put the license file on the file system and pointed to it. This worked fine in development and testing, but in production we load tens of thousands of documents that must be converted. The license initialization works in the beginning, but once it starts failing it will fail every time.

To avoid locks we put the license XML in the SharePoint Property Bag. This worked and gave much better performance. With our initial load, it ran for 4 hours initializing the license and converting documents. But once again, after failing the first time it would fail every time.

How can we get around this problem?


Thanks for your request. I think, you can resolve the problem by setting the license only once per application domain. For example you can set the license in static constructor of the class that performs operations with documents. Please follow the link for more information:


This will avoid redundant calls of SetLicense. Hope this helps.

Best regards,