Bug 6489 - Mono implementation of SoapFormatter behaves differently from .Net implementation
Summary: Mono implementation of SoapFormatter behaves differently from .Net implementa...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Martin Baulig
URL:
Depends on:
Blocks:
 
Reported: 2012-08-09 11:30 UTC by mrblonds
Modified: 2012-09-17 21:03 UTC (History)
2 users (show)

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


Attachments
Test case (2.75 KB, application/octet-stream)
2012-08-09 11:30 UTC, mrblonds
Details


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:
Status:
RESOLVED FIXED

Description mrblonds 2012-08-09 11:30:07 UTC
Created attachment 2333 [details]
Test case

The implementation of the SoapFormatter in Mono 2.10.6 (tested also on a 2.11 version compiled recently) behaves differently from the .Net implementation regarding the use of the System.Globalization.CultureInfo associated to the thread in execution.

During the deserialization the CultureInfo of the thread changes to "en-US" and the original culture is restored once the deserialization is completed. The implementation of .Net mantains the original culture (forced to "it-IT" in the test).

The output of the test on both Mono and .Net is the following

Mono :
Test failed (different cultures)
Culture of the Main method (initialized at the start) : it-IT
Culture of the ResolveHandler method (initialized during the AssemblyResolve) : en-US

.Net :
Test passed (same culture)
Culture of the Main method (initialized at the start) : it-IT
Culture of the ResolveHandler method (initialized during the AssemblyResolve) : it-IT

Since System.Runtime.Serialization.Formatters.Soap.dll is used in the test case in order to compile it "mcs Program.cs -r:System.Runtime.Serialization.Formatters.Soap.dll" has to be used.
Comment 2 Martin Baulig 2012-09-17 21:03:49 UTC
Fixed; master commit 61bcffb, mono-2-10 9d52a8c