Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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
Developer Community or GitHub 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.
Created attachment 6202 [details]
When the iOS device is in the German Region, DataContractJsonSerializer.ReadObject returns an invalid double result.
The attached test project shows a value of "1234" on the screen, but it should read the double value from the json string as "12,34". This works as expected in Xamarin.iOS 7.0.6.
Not working in
Version: 184.108.40.206 (Business Edition)
Build date: 2014-17-02 17:43:23-0500
There not a big delta  between 7.0.6 and 7.0.7 - but there's a change wrt DataContractJsonSerializer, it was the fix for #16744 .
The diff for 21cb413 looks globalization safe - but the readon of Single/Double/Decimal were replaceed by code that might not be.
@John is that code yours ? or the customer ?
If so I'll convert it into a unit test and commit it along the fix (in the mono repo).
The fix itself is rather simple:
diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationReader.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationReader.cs
index 1ca5792..29e3cfa 100644
@@ -189,7 +189,7 @@ namespace System.Runtime.Serialization.Json
object ReadValueType (Type type, bool nullable)
string s = reader.ReadElementContentAsString ();
- return nullable && s.Trim ().Length == 0 ? null : Convert.ChangeType (s, type, null);
+ return nullable && s.Trim ().Length == 0 ? null : Convert.ChangeType (s, type, CultureInfo.InvariantCulture);
@John, let me know if I can reuse the sample (otherwise I'll create a unit test from scratch) and commit everything.
I created my own test.
Fixed in mono/master 56d406876f3455a13db8f71418d1cbf256889975