Document conversion application deployment on Azure in .NET

Hi,

I am facing a strange scenario with GroupDocs.Conversion. Every now and then, when we redeploy our solution to Azure Function, there is a 1 in 10 chance that it will start throwing exceptions. We have tried two different versions but the problem is there in both. I have added some sample exceptions below. These exceptions go away when we re-deploy our solution, but we are getting tired of having to keep an eye out for this.

Platform: Azure Functions - Queue Trigger .NET Framework 4.6
Versions Tested: GroupDocs.Conversion 19.1.0.0 and 18.5.0.0
Libraries referenced by the solution:
Aspose.Words 19.2.0
Aspose.Pdf 19.2.0
GroupDocs.Conversion 19.1.0

Since we have used both GroupDocs.Conversion and Aspose.Pdf/Aspose.Words in the same project, could this be a type/assembly version conflict? Please help!

Regards,
Zeeshan

==================
Exception 1

Could not load type ‘Aspose.Pdf.Document’ from assembly ‘Aspose.PDF, Version=18.4.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’.

System.TypeLoadException: at . (GroupDocs.Conversion, Version=18.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=18.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=18.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=18.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=18.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at undefined (GroupDocs.Conversion, Version=18.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=18.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=18.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at GroupDocs.Conversion.Handler.ConversionHandler. (GroupDocs.Conversion, Version=18.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at GroupDocs.Conversion.Handler.ConversionHandler.Convert (GroupDocs.Conversion, Version=18.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at BoardPro.Functions.Pdf.Business.Conversion.DocumentToPdfProvider.ConvertToPdfDocument (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) at BoardPro.Functions.Pdf.Business.Conversion.DocumentToPdfProvider.LoadPdfFromDocument (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) at BoardPro.Functions.Pdf.Business.Conversion.PdfConversionHandler.ConvertToPdfFile (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)

==================
Exception 2

Bad IL range. Bad IL range.

Aspose.Slides.PptxReadException: at Aspose.Slides. . (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides.Presentation. (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides.Presentation. (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides.Presentation. (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides.Presentation…ctor (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at GroupDocs.Conversion.Handler.ConversionHandler.Convert (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at BoardPro.Functions.Pdf.Business.Conversion.DocumentToPdfProvider.ConvertToPdfDocument (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) at BoardPro.Functions.Pdf.Business.Conversion.DocumentToPdfProvider.LoadPdfFromDocument (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) at BoardPro.Functions.Pdf.Business.Conversion.PdfConversionHandler.ConvertToPdfFile (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) Inner exception System.BadImageFormatException handled at Aspose.Slides. .: at Aspose.Slides. ​ . (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides.​ . (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides.​ .83ugfqaran7zgs2qub4m6eltqdmbhmlf (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. .83ugfqaran7zgs2qub4m6eltqdmbhmlf (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. .83ugfqaran7zgs2qub4m6eltqdmbhmlf (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. .83ugfqaran7zgs2qub4m6eltqdmbhmlf (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. .83ugfqaran7zgs2qub4m6eltqdmbhmlf (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. .83ugfqaran7zgs2qub4m6eltqdmbhmlf (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. .83ugfqaran7zgs2qub4m6eltqdmbhmlf (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. .83ugfqaran7zgs2qub4m6eltqdmbhmlf (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. .83ugfqaran7zgs2qub4m6eltqdmbhmlf (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. .83ugfqaran7zgs2qub4m6eltqdmbhmlf (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. .83ugfqaran7zgs2qub4m6eltqdmbhmlf (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. .83ugfqaran7zgs2qub4m6eltqdmbhmlf (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. ​ .83ugfqaran7zgs2qub4m6eltqdmbhmlf (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. . (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides.​ . (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. . (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Slides. . (Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

==================
Exception 3

Could not load type ‘Aspose.Slides.Presentation’ from assembly ‘Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’.

System.TypeLoadException: at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at GroupDocs.Conversion.Handler.ConversionHandler.Convert (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at BoardPro.Functions.Pdf.Business.Conversion.DocumentToPdfProvider.ConvertToPdfDocument (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) at BoardPro.Functions.Pdf.Business.Conversion.DocumentToPdfProvider.LoadPdfFromDocument (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) at BoardPro.Functions.Pdf.Business.Conversion.PdfConversionHandler.ConvertToPdfFile (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)

@zeeshan1,

Thank you for your inquiry.
We are investigating this scenario at our end. Your investigation ticket ID is CONVERSIONNET-2921. We’ll let you know as we have any further update.

A few more examples for the benefit of your team

Exception 1

Bad binary signature. (Exception from HRESULT: 0x80131192)

System.BadImageFormatException

System.BadImageFormatException: at .#=zFUap$r_GT$Vl (Aspose.PDF, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at .#=zJVkvIn4= (Aspose.PDF, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at .#=zJVkvIn4= (Aspose.PDF, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at .#=zJVkvIn4= (Aspose.PDF, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at .#=zJVkvIn4= (Aspose.PDF, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Pdf.Document. (Aspose.PDF, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at Aspose.Pdf.Document. (Aspose.PDF, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at GroupDocs.Conversion.Handler.ConvertedDocument.Save (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at BoardPro.Functions.Pdf.Business.Conversion.DocumentToPdfProvider.ConvertToPdfDocument (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) at BoardPro.Functions.Pdf.Business.Conversion.DocumentToPdfProvider.LoadPdfFromDocument (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) at BoardPro.Functions.Pdf.Business.Conversion.PdfConversionHandler.ConvertToPdfFile (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)

Exception 2:

Could not load type ‘Aspose.Slides.Presentation’ from assembly ‘Aspose.Slides, Version=18.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’.

System.TypeLoadException: at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at . (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at GroupDocs.Conversion.Handler.ConversionHandler.Convert (GroupDocs.Conversion, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) at BoardPro.Functions.Pdf.Business.Conversion.DocumentToPdfProvider.ConvertToPdfDocument (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) at BoardPro.Functions.Pdf.Business.Conversion.DocumentToPdfProvider.LoadPdfFromDocument (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) at BoardPro.Functions.Pdf.Business.Conversion.PdfConversionHandler.ConvertToPdfFile (BoardPro.Functions.Pdf.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)

1 Like

@zeeshan1,

Thanks for sharing further details.
Can you please also confirm if you face same issue in a simple console application?

No, this problem doesn not occur when I run it locally. But running it locally does show some warning, perhaps its related? See the attached screenshot image.png (63.2 KB)

@zeeshan1,

Yes, it’ll be helpful. We appreciate your cooperation. You’ll be notified as we have any further update on it.

Is there an update on this? We are struggling with frustrated customers and no workaround other than to keep redeploying.

@zeeshan1,

Sorry for the inconvenience you are facing.
We have updates regarding CONVERSIONNET-2921.
This issue is not reproduced with any combination of GroupDocs.Conversion and Aspose.Pdf/Aspose.Slides/Aspose.Words in a simple console application.
However, for further investigation we need following details from you:

  • Can you provide a sample project using that issue could be reproduced?
  • Do you have difference between local and azure setup related to the target platform (x86/x64)?