
Hello,
I have a problem with generating the correct QR code on the report. Dynamics365 FO version - Platform 8.1.2 Update 22.
In the previous version of the system (platform 7.3 update 12) I used the method below
Microsoft.Dynamics.ApplicationSuite.QRCode.Encoder qrCode = new Microsoft.Dynamics.ApplicationSuite.QRCode.Encoder();
System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
System.Drawing.Bitmap bitmap;
container imageContainer;
System.String url = '1w23e4r5t67';
bitmap = qrCode.Encode(url);
bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat::Png);
imageContainer = Binary::constructFromMemoryStream(memoryStream).getContainer();
And it worked, every phone with the camera and the readings for reading QR codes could read the code correctly, but after upgrading the system to version 8.1.2 the method stopped working, generates the code, but when trying to read him using the application receives the message "Unknown Encoding". Now the qr code appears on the report as before, but I can not read it:
Do you have any idea why this is happening? Somebody can help? Maybe you have a contact to someone who know how to resolve this?
Information for people who search for causes and solve the problem with the correct generation of the QR code:
I replaced the dll file (Microsoft.Dynamics.ApplicationSuite.QrCode.dll) on the virtual machine (ver 8.1.2) with an older version of this file from the virtual machine (ver 7.3) and the problem disappeared, the code is generated correctly and I am able to read on every device.
At this point, I do not know yet whether replacing the file causes some errors in other places. In my code the compiler did not return any errors, did not return any errors while compiling the ApplicationSuite model. At this moment everything works.
Now I can use this code:
Microsoft.Dynamics.ApplicationSuite.QRCode.Encoder qrCode = new Microsoft.Dynamics.ApplicationSuite.QRCode.Encoder();
System.Drawing.Bitmap bitmap;
container imageContainer;
str url="abcdefghijklmnopqrstuvwxyz";
System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
bitmap = qrCode.Encode(url);
bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat::Png);
imageContainer = Binary::constructFromMemoryStream(memoryStream).getContainer();