SingleCall として構成されているリモートでホストされているオブジェクトがあります。RemotingConfiguration.Configure(remotingConfigPath, false) として構成されている古いスタイルの .Net リモーティング オブジェクトです。そのオブジェクトは問題なく DataSet の DateTime フィールドを受け取り、それを [AutoComplete] としてマークされている ServicedComponent の (COM+) メソッドに渡します。呼び出しの時点まで、フィールドは問題ありません。[AutoComplete] メソッドが DateTime を受け取るとすぐに、1 時間シフトされます。.Net フレームワークによって確実に移行されます。間にユーザーコードはありません。シフトは、夏時間の変更日である特定の日付で発生すると思います。
AppDomain を通過するときに発生する日付のシリアル化を伴うものでなければなりません。Like Serviced コンポーネントは独自のタイム ゾーンを使用し、受信した日付をそのゾーンに変換します。しかし奇妙なことに、.Net リモート処理用に構成せずに ServicedComponent を直接呼び出すと、日付の変更は発生しません。ServicedComponent は処理中です。クライアントとサーバーは同じマシンにあり、TimeZone GMT+2 と地域設定がトルコ/トルコに設定され、クライアント側の CurrentUICulture と CurrentCulture の両方で .net カルチャが tr-TR に設定されています。問題の解決にご協力ください よろしくお願いします
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);
}
}