[Mono-dev] TimeZone and CurrentTimeZone (updated)

Chris Micacchi mono at kinitos.com
Tue Sep 13 16:42:33 EDT 2005


Slight correction.  The deserialization error I get isn't coming from 
DateTime, but directly from the class with a member of type TimeZone.

An example:

On Mono:
class MyClass {
	System.TimeZone  _TimeZone = System.TimeZone.CurrentTimeZone;
	
	MyClass()
	{
		// Constructor
	}
}

Attempting to serialize that will fail with the first exception ("Type 
System.CurrentTimeZone is not marked as Serializable."), even though 
System.TimeZone is Serializable.

If you change the class so that CurrentTimeZone is serializable and 
rebuild mono, then the class above serializes just fine, but if the 
deserializing end is .Net, it will get an exception since (apparently) 
.Net doesn't have any such internal class as CurrentTimeZone.

--
Chris

Chris Micacchi wrote:
> Hello everyone,
> 
> I'm getting an exception trying to send an object of type DateTime from
> a Linux machine running Mono to a Windows one running .Net.  The 
> exception is "Type System.CurrentTimeZone is not marked as 
> Serializable."  System.TimeZone is supposedly serializable, but called 
> System.TimeZone.CurrentTimeZone returns something that isn't serializable.
> 
> Interestingly enough, when I went in and marked the type as 
> [Serializable] and rebuild mono, I get an error deserializing the 
> DateTime object on Windows (it doesn't recognize the type of the 
> CurrentTimeZone object).
> 
> What's the status of this class?  Is this currently an expected issue?
> 
> Thanks for any info,
> 
> Chris
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list