I have a remotely hosted object which is configured as SingleCall. It is the old style .Net remoting object which is configured as RemotingConfiguration.Configure(remotingConfigPath, false). That object receives a DateTime field in DataSet without issues and passes that to a ServicedComponent's (COM+) method which is marked as [AutoComplete]. To the point of the call the field is fine. Now as soon as that [AutoComplete] method receives the DateTime it is shifted by 1 hour. It is certainly shifted by .Net framework. There is no user code in between. The shift occurs for certain dates which are the daylight time change dates, I think.

It must be something with the date's serialization which should occur when it passes AppDomain's. Like Serviced component uses its own time zone and converts the received date to that zone. But weird thing is that if I call ServicedComponent directly without configuring it for .Net remoting no date changes occur. The ServicedComponent is in process. The client and server are in the same machine with TimeZone GMT+2 and Regional settings set to Turkey/Turkish and .net culture set to tr-TR for both CurrentUICulture and CurrentCulture in the client side. Please help to resolve the issue Thanks in advance

  public class ProfileSystem : MarshalByRefObject
 {
     public void SaveProfile(Guid sessionId, HotelAToZ.SystemTypes.Profile2.ProfileData data) 
    {
         //This is in remoting object DateTime is received  normally here
         //Header is a property which just returns the first row of DataSet. Actually only one row in dataset
        //throw new ApplicationException(data.Header.BirthDay.ToString());
        new Reservation.ReservationSC().SaveProfile(sessionId, data);
    }
}

 [Transaction(TransactionOption.Required)]
 public class ReservationSC : ServicedComponent
 {
 //This is in ServicedComponent
  [AutoComplete]
    public void SaveProfile(Guid sessionId, HotelAToZ.SystemTypes.Profile2.ProfileData data) 
    {
         //data.Header.BirthDay is shifted here
         //throw new ApplicationException(data.Header.BirthDay.ToString());
        new HotelAToZ.DataAccess.Profile2.ProfileAccess().SaveProfile(sessionId, data);
    }
 }
1

There are 1 answers

0
Kishi Bala On

The problem was caused by the bug described in a similar problem: http://social.msdn.microsoft.com/Forums/en-US/19706927-ab22-44ee-ad89-9d005f7ea29f/binary-serialization-of-datasets-bug-with-datetimecolumns?forum=adodotnetdataproviders

So setting DateTimeMode property of DataColumn to DataSetDateTime.Unspecified solved it.