i am getting an error when I tried to create a QR code in Azure using Durable Functions.
“The type initializer for ‘Aspose.BarCode.Generation.BarcodeGenerator’ threw an exception.”
" at Aspose.BarCode.Generation.BarcodeGenerator…ctor(BaseEncodeType type, String codeText)\r\n at DurFunctionBarCodeTest.Function1.Run(TimerInfo myTimer, ILogger log) in C:\_mydata\_projects 2020\SGE_AZURE_POC\2021-05-26\Dev_Azure_Poc2\DurFunctionBarCodeTest\Function1.cs:line 19"
@tony.woods.bell.ca,
We have reviewed your issue and logged it into our database for a detailed analysis. You will be notified here once any update is ready for sharing.
This issue is logged as: BARCODENET-37913 - Aspose BarCode not working in Azure Durable Functions
When building an Azure Functions project, the build tools optimize the output so that only one copy of any assemblies that are shared with the functions runtime are preserved. It also ‘optimizes’ System.Text.Encoding.CodePages that is need for Aspose.Barcode library.
Solution is to preserve System.Text.Encoding.CodePages by adding this to your csproj: