Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Jun 03, 2021 3:44 pm

Hello,

We're having some issues larger word doc files, specifically when deployed to an Azure App Service. The code and doc we're using works perfectly fine when run on a local instance, however when deployed to Azure we get the following error (the rest of the stack trace varies between attempts, but the last 5 calls are always the same):

Code: Select all
System.NullReferenceException: Object reference not set to an instance of an object.
   at spr℅.ᜀ(FontStyle A_0)
   at sprᝥ.ᜀ(spr℅ A_0, Single A_1, FontStyle A_2)
   at sprᝥ.ᜀ(String A_0, Single A_1, FontStyle A_2)
   at Spire.Doc.Formatting.CharacterFormat.ᜀ()
   at Spire.Doc.Formatting.CharacterFormat.set_FontName(String value)
   ...
   at sprἊ.ᜀ(Stream A_0, Document A_1, sprᶅ A_2)
   at Spire.Doc.Document.᜕(Stream A_0)
   at Spire.Doc.Document.LoadFromStream(Stream stream, FileFormat fileFormat, String password)


The behavior we're seeing is that the longer the document, the more likely we'll get the error. For short documents, the LoadFromStream call works with no problem. For medium documents we were seeing it work around a third of the time. We've also confirmed that the data being loaded into the stream is correct by simply sticking the LoadFromStream call in a loop and trying again if it fails. This would result in a few errors being thrown, but then it would work. Once the document gets long enough though, it always fails.

The app service tier we are using is P1V2, though we also tried bumping up to P2V2 to see if resources were the issue but saw the same error happening. We've also tried saving the data from the stream to the remote instance first and loading it from LoadFromFile, but were met with the same results.

We're using Spire.Doc 9.4.18. I'll also send the document we're using to the support email.

mike.woolsoncroft
 
Posts: 14
Joined: Tue May 05, 2020 2:11 pm

Fri Jun 04, 2021 12:56 pm

Hello,

Thanks for your inquiry.
I created a web application and deployed it to an Azure App Service to test, but I did not encounter any issue. I have tested your case with both Spire.Doc v9.4.18 and the latest Spire.Doc v9.6. I also tried to simulate a larger word document, but still did not reproduce your problem. I sent you my test project via email, please run it directly on your side to see if the issue occurs. Looking forward to your test results.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Tue Jun 08, 2021 7:54 pm

Hi Brian,

Thanks for looking into this. We did figure out the problem and it turned out to be environmental rather than an issue with the LoadFromStream function.

In case anyone else runs into a similar issue, the problem we had was that the Azure instance had been created as a 32bit platform instead of a 64bit. So despite increasing the tier for more memory, we were still capped at 2GB which resulted in the stream becoming corrupted when trying to be read into memory. Switching to 64bit solved the issue.

mike.woolsoncroft
 
Posts: 14
Joined: Tue May 05, 2020 2:11 pm

Wed Jun 09, 2021 1:19 am

Hello,

Thanks for your feedback.
I am very glad to hear your issue has been solved. And thank you very much for sharing your solution.
If you encounter any issues related to our products in the future, please feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Doc

cron