Bug 29871 - ReadElementContentAsBase64 from XmlReader is not decoding correctly
Summary: ReadElementContentAsBase64 from XmlReader is not decoding correctly
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.XML ()
Version: 4.0.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-05-08 07:16 UTC by blitzillu
Modified: 2015-09-14 03:46 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Sample project demonstrating the issue (48 bytes, text/plain)
2015-05-08 07:20 UTC, blitzillu
Sample project demonstrating the issue (2.38 MB, application/force-download)
2015-08-17 03:03 UTC, blitzillu

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description blitzillu 2015-05-08 07:16:31 UTC
I'm using the latest Xamarin Studio 5.9 on Mac. If you are using the method ReadElementContentAsBase64 from XmlReader the decoded file is defective.

I've attached a sample project which demonstrates this. The conversion is slow and the resulting image is mainly black. On Xamarin Studio for Windows and in Visual Studio it is working fine.
Comment 2 blitzillu 2015-05-08 07:20:45 UTC
Created attachment 11127 [details]
Sample project demonstrating the issue
Comment 3 Marek Safar 2015-05-25 08:52:13 UTC
I cannot reproduce it as the project is missing files which it depends on (some.xml and test.jpg)
Comment 4 blitzillu 2015-05-26 02:47:27 UTC
Hi Marek. Thanks for looking into this issue. test.jpg is the output file. You only have to adapt the output path from


to e.g.


some.xml can be found in the Resources folder and is ready to go. If the image would be decoded correctly you would see a surfer.
Comment 5 Marek Safar 2015-05-26 09:04:13 UTC
Already fixed in master
Comment 6 mitchell balsam 2015-05-26 18:02:25 UTC
Will this be added to next release for IOS? Any guess on when?
Comment 7 Marek Safar 2015-05-27 03:35:18 UTC
Yes, this should be in next release based on Mono 4.2
Comment 8 mitchell balsam 2015-05-27 14:12:03 UTC
Since current release of mono is 4.0.1.  I hope its 4.0.2 not 4.2?
Comment 9 blitzillu 2015-06-17 08:32:40 UTC
If I look into the release notes (http://www.mono-project.com/docs/about-mono/releases/4.0.2/) then this bug isn't mentioned. In which mono version will this bug be included? When can I reckon to get this bugfix?
Comment 10 Udham Singh 2015-08-11 10:38:52 UTC
I have tried to get the sample project attached in comment 2 and observed that the attached project has been removed now.

Screencast : http://www.screencast.com/t/McQbyAZql3

Could you please provide the sample project that demonstrate this issue? so that I can reproduce and verify this issue efficiently at my end.

Comment 11 blitzillu 2015-08-17 03:03:54 UTC
Created attachment 12528 [details]
Sample project demonstrating the issue

As requested by another user.
Comment 12 Udham Singh 2015-08-17 08:32:43 UTC
Thank you very much for the sample project.

I have checked this issue with the help of sample app attached in comment 11 with latest stable xamarin builds, and below are my observations.

1. When I run the project using VS 2013 on windows, application is getting launched on simulator and displaying a black screen.
2. If I run the project from XS on Mac, application is getting launched on simulator and displaying white screen.

Could you please confirm that you are also getting the same behaviour?

Comment 13 blitzillu 2015-08-19 14:27:51 UTC
I can only test XS on Mac, because I don't have currently access to VS on Windows. On Mac it is the behavior you described, but it is not important what the simulator shows. It is important what the output file is (e.g. test.jpg). I tested it on VS on Windows and here the app runs as expected, but not on Mac.
Comment 14 blitzillu 2015-09-14 03:23:59 UTC
Mono 4.2.0 is available in the alpha channel (25 Aug 2015), but currently I don't see this bug listed. Will this bug be resolved in the beta or the official release?
Comment 15 Marek Safar 2015-09-14 03:46:29 UTC
Yes, any 4.2 based produced will have it fixed