我刚刚将Kentico CMS升级到了最新的修补程序。推到产品服务器后,我在两台服务器上都收到以下错误。

还有其他人可以解决此错误吗?我认为这与缓存有关,但我无法在此处指出问题。

我们正在使用


用于会话状态的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会话状态下不会发生,因为升级完成后站点重新启动会清除它。

10-01 18:32