【发布时间】:2010-03-19 07:51:02
【问题描述】:
我正在使用 Visual Studio 2008 和第三方库开发 ASP.NET Web 应用程序。
我的开发环境一切正常。如果 Web 应用程序部署在 Debug 配置中,情况也很好。但是,在 Release 模式下部署时,SerializationExceptions 会间歇性出现,破坏其他功能。
在 Windows 事件日志中,可以看到以下错误:
“发生未处理的异常,进程终止。
应用程序 ID:默认域
进程 ID:3972
异常:System.Runtime.Serialization.SerializationException
消息:无法找到程序集“MyThirdPartyLibrary, Version=1.234.5.67, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89”。
StackTrace:在 System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly() 在 System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAsse mblyInfo assemblyInfo,字符串名称) 在 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 ) 在 System.Runtime.Serialization.Formatters.Binary.ObjectMap.Create(字符串名称,String[] memberNames,BinaryTypeEnum[] binaryTypeEnumA,Object[] typeInformationA,Int32[] memberAssemIds,ObjectReader objectReader,Int32 objectId,BinaryAssemblyInfo assemblyInfo,SizedArray assemIdToAssemblyTable) 在 System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped 记录) 在 System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum) 在 System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() 在 System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(标头处理程序处理程序,__BinaryParser serParser,布尔 fCheck,布尔 isCrossAppDomain,IMethodCallMessage methodCallMessage) 在 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(流序列化流,HeaderHandler 处理程序,布尔 fCheck,布尔 isCrossAppDomain,IMethodCallMessage methodCallMessage) 在 System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(我 moryStream stm) 在 System.AppDomain.Deserialize(字节 [] blob) 在 System.AppDomain.UnmarshalObject(Byte[] blob)
有关详细信息,请参阅帮助和支持中心http://go.microsoft.com/fwlink/events.asp。"
使用 FUSLOGVW.exe(即程序集绑定日志查看器),我可以看到问题是 IIS 尝试在目录 C:\windows\system32\inetsrv 中查找 MyThirdPartyLibrary。它拒绝查看 DLL 实际所在的 web 应用程序的 bin 文件夹。
有谁知道问题出在哪里?
谢谢,
卡尔文
【问题讨论】:
标签: asp.net exception serialization release