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.