我有一个配置为 SingleCall 的远程托管对象。它是旧式 .Net 远程处理对象,配置为 RemotingConfiguration.Configure(remotingConfigPath, false)。该对象毫无问题地接收 DataSet 中的 DateTime 字段,并将其传递给标记为 [AutoComplete] 的 ServicedComponent (COM+) 方法。就调用而言,该字段很好。现在,只要 [AutoComplete] 方法接收到 DateTime,它就会移动 1 小时。它肯定是由 .Net 框架转移的。两者之间没有用户代码。我认为,这种转变发生在某些日期,即夏令时更改日期。
它必须是日期序列化的东西,它应该在它通过 AppDomain 时发生。Like Serviced 组件使用自己的时区并将接收到的日期转换为该时区。但奇怪的是,如果我直接调用 ServicedComponent 而不将其配置为 .Net 远程处理,则不会发生日期更改。ServicedComponent 正在处理中。客户端和服务器位于同一台机器上,客户端的 CurrentUICulture 和 CurrentCulture 的 TimeZone GMT+2 和区域设置设置为土耳其/土耳其语,.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);
}
}