简体   繁体   English

分享2个应用:Session State ASP.Net MVC反序列化错误

[英]Sharing 2 Applications: Session State Deserialization Error for ASP.Net MVC

I'm hosting two applications under one website on IIS.我在 IIS 的一个网站下托管两个应用程序。 The main application creates a session state when the user logs in. I am able to share the session between the two applications, but when I try to access the specific session variable I get a deserialization error seen below. The main application creates a session state when the user logs in. I am able to share the session between the two applications, but when I try to access the specific session variable I get a deserialization error seen below. On my second application, I load the dll (in Global.asax during start up) that it claims is missing.在我的第二个应用程序中,我加载了它声称丢失的 dll(在启动期间位于 Global.asax 中)。 I even confirm that it has been loaded before accessing the session and it still throws an error.我什至确认它在访问 session 之前已经加载,它仍然会抛出错误。 The library that's loaded is from the same directory and has the same exact assembly string that it's complaining about.加载的库来自同一个目录,并且具有它所抱怨的完全相同的汇编字符串。

Perhaps it's loading it to a different domain of the application?也许它将它加载到应用程序的不同域? Does anybody know why it's still not working?有谁知道为什么它仍然不起作用? Any suggestions would be great.任何建议都会很棒。

(Unable to find binary) (找不到二进制文件) 在此处输入图像描述

(Confirmed that the DLL is properly loaded upon startup for the second app) (确认 DLL 在第二个应用程序启动时正确加载) 在此处输入图像描述

>     [SerializationException: Unable to find assembly 'Jenzabar.Portal.Framework, Version=0.0.0.0, Culture=neutral,
> PublicKeyToken=null'.]
>        System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
> +4491385
>        System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo
> assemblyInfo, String name) +14472268
>        System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String
> objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA,
> Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader
> objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo,
> SizedArray assemIdToAssemblyTable) +179
>        System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped
> record) +278
>        System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
> +914
>        System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler
> handler, __BinaryParser serParser, Boolean fCheck, Boolean
> isCrossAppDomain, IMethodCallMessage methodCallMessage) +169
>        System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
> serializationStream, HeaderHandler handler, Boolean fCheck, Boolean
> isCrossAppDomain, IMethodCallMessage methodCallMessage) +288
>        System.Web.Util.AltSerialization.ReadValueFromStream(BinaryReader
> reader) +1064
>        System.Web.SessionState.SessionStateItemCollection.ReadValueFromStreamWithAssert()
> +68
>        System.Web.SessionState.SessionStateItemCollection.DeserializeItem(String
> name, Boolean check) +256
>        System.Web.SessionState.SessionStateItemCollection.get_Item(String
> name) +29
>        ASP._Page_Views_Account_Login_cshtml.Execute() in C:\inetpub\wwwroot\auxtest\Views\Account\Login.cshtml:25
>        System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
>        System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
>        System.Web.WebPages.StartPage.ExecutePageHierarchy() +86
>        System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext
> pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
>        System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
>        System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1
> filters, Int32 filterIndex, ResultExecutingContext preContext,
> ControllerContext controllerContext, ActionResult actionResult) +88
>        System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1
> filters, Int32 filterIndex, ResultExecutingContext preContext,
> ControllerContext controllerContext, ActionResult actionResult) +775
>        System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext
> controllerContext, IList`1 filters, ActionResult actionResult) +81
>        System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__5(IAsyncResult
> asyncResult) +188
>        System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult
> asyncResult) +38
>        System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +26
>        System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult
> asyncResult) +68
>        System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
>        System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult
> asyncResult) +39
>        System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
>        System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +40
>        System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult
> asyncResult) +68
>        System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
>        System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
> +602
>        System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
>        System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128

This looks like a dependency issue, yes the file is there, but maybe some other file it depends on is not there.这看起来像一个依赖问题,是的文件在那里,但也许它依赖的其他文件不在那里。 The error message could be a bit misleading错误消息可能有点误导

This is a issue with type-based serializer, please refer to this post here ArrayTypeMismatch Exception in Session这是基于类型的序列化程序的问题,请参阅此处的这篇文章ArrayTypeMismatch Exception in Session

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM