serialize . serializationexception: Member 'LastUpdated&
本文关键字:LastUpdated Member serializationexception serialize | 更新日期: 2023-09-27 18:11:14
我最近刚刚将我们的Kentico CMS升级到最新的hotfix。推送到prod服务器后,我在两个服务器上都得到以下错误。
有其他人解决了这个错误吗?我认为这必须做一些事情与缓存,但我不能在这里点的问题。
我们正在使用
- SQL server的会话状态。
- 两个服务器都是虚拟机
- 两个服务器都是最新的-补丁等
现在kentico建议在两个服务器上重新安装。net,因为他们认为这是环境相关的问题。
Elmah选择了这个错误并将其发送给我。通过这个错误,站点显示得很好。
System.Runtime.Serialization.SerializationException: Member 'LastUpdated' was not found.
Generated: Tue, 01 Jul 2014 23:11:07 GMT
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.Serialization.SerializationException: Member 'LastUpdated' was not found.
at System.Runtime.Serialization.SerializationInfo.GetElement(String name, Type& foundType)
at System.Runtime.Serialization.SerializationInfo.GetValue(String name, Type type)
at CMS.SettingsProvider.BaseInfo..ctor(SerializationInfo info, StreamingContext context, TypeInfo[] typeInfos)
at CMS.DataEngine.AbstractInfo`1..ctor(SerializationInfo info, StreamingContext context, TypeInfo[] typeInfos)
at CMS.SiteProvider.UserInfo..ctor(SerializationInfo info, StreamingContext context)
at CMS.CMSHelper.CurrentUserInfo..ctor(SerializationInfo info, StreamingContext context)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.SerializationInvoke(IRuntimeMethodInfo method, Object target, SerializationInfo info, StreamingContext& context)
at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Web.Util.AltSerialization.ReadValueFromStream(BinaryReader reader)
at System.Web.SessionState.SessionStateItemCollection.ReadValueFromStreamWithAssert()
at System.Web.SessionState.SessionStateItemCollection.DeserializeItem(String name, Boolean check)
at System.Web.SessionState.SessionStateItemCollection.get_Item(String name)
at System.Web.SessionState.HttpSessionStateContainer.get_Item(String name)
at CMS.GlobalHelper.SessionHelper.GetValue(String key)
at CMS.CMSHelper.ContextData.GetCurrentUser(Boolean& loadUserData, Boolean cacheResult)
at CMS.CMSHelper.ContextData.get_CurrentUser()
at CMS.UIControls.DocumentBase.get_CurrentUser()
at CMS.UIControls.DocumentBase.SetCulture()
at CMS.UIControls.DocumentBase.PreInit()
at CMS.UIControls.ContentPage.OnPreInit(EventArgs e)
at CMSPages_PortalTemplate.OnPreInit(EventArgs e) in d:'inetpub'NrccuaWeb'Cms20140701-KU'CMSPages'PortalTemplate.aspx.cs:line 142
at System.Web.UI.Page.PerformPreInit()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.cmspages_portaltemplate_aspx.ProcessRequest(HttpContext context) in c:'Windows'Microsoft.NET'Framework'v4.0.30319'Temporary ASP.NET Files'cms'3bfbd4f3'28ac498a'App_Web_portaltemplate.aspx.67ab7734.p3gr9fmc.0.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
谢谢。
有点老问题,但因为我刚刚遇到这个,所以我将为下一个人发布解决方案。
当您使用SQL Server存储会话状态时,可能会发生这种情况。
Kentico在会话中存储userinfo对象,所以在您升级之前的某个时候,您登录到Kentico站点,并且userinfo对象被序列化到SQL Server会话数据库。
升级后,当您访问站点时,保存在会话数据库中的userinfo对象被反序列化,因为该对象被升级更改了,因此抛出序列化异常。
你可以等待你的会话过期,清除你的会话cookie,或者如果你想避免你网站的任何用户的问题,清除SQL Server会话数据库中的ASPStateTempSessions表
这只发生在默认的inProc会话状态下,因为它在升级完成后被站点重新启动清除。