2010-03-19 81 views
2

我正在使用Visual Studio 2008和第三方庫處理ASP.NET Web應用程序。SerializationException僅在發佈模式下發生

事情在我的開發環境中很好。如果Web應用程序部署在Debug配置中,情況也很好。但是,在Release模式下部署時,SerializationException會間歇性出現,從而導致其他功能失效。

在Windows事件日誌,下面的誤差可以看出:

「未處理的異常發生,並且處理被終止

應用程序ID:默認域

進程ID:3972

異常:System.Runtime.Serialization.SerializationException

消息:無法找到程序集' MyThirdPartyLibrary,Version = 1.234.5.67,Culture = neutral,PublicKeyToken = 3d67ed1f87d44c89'。

堆棧跟蹤:在System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly() 在System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAsse mblyInfo集信息,字符串名稱) 在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) at System .Runtime.Serialization.Formatters.Binary.ObjectMap.Create(String name,String [] memberNames,BinaryTypeEnum [] binaryTypeEnumA,Object [] typeInformationA,Int32 [] memberAssemIds,ObjectReader objectReader,Int32 objectId,BinaryAssemblyInfo assemblyInfo,Si zedArray assemIdToAssemblyTable) 在System.Runtime.Serialization.Formatters.Binary .__ BinaryParser.ReadObjectWithMa pTyped(BinaryObjectWithMapTyped記錄) 在System.Runtime.Serialization.Formatters.Binary .__ BinaryParser.ReadObjectWithMa pTyped(BinaryHeaderEnum binaryHeaderEnum) 在System.Runtime.Serialization .Formatters.Binary .__ BinaryParser.Run() at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(Header Handler handler,__BinaryParser serParser,Boolean fCheck,Boolean isCrossAppDomain,IMethodCallMessage methodCallMessage) at System.Runtime.Serialization。 Formatters.Binary.BinaryFormatter.Deserialize(Str eam serializationStream,HeaderHandler處理程序,布爾fCheck,布爾isCrossAppDomain,IMethodCallMessage methodCallMessage) at System.Runtime.Remoting.Channels.CrossAp pDomainSerializer.DeserializeObject(我moryStream STM) 在System.AppDomain.Deserialize(字節[] BLOB) 在System.AppDomain.UnmarshalObject(字節[] BLOB)

有關詳細信息,請參閱幫助和http://go.microsoft.com/fwlink/events.asp支持中心。 「

使用FUSLOGVW.exe(即程序集綁定日誌查看器),我可以看到問題是IIS嘗試在目錄C:\ windows \ system32 \ inetsrv中查找MyThirdPartyLibrary。它拒絕查看DLL實際位於的Web應用程序的bin文件夾。

有誰知道問題是什麼?

感謝,

卡爾文

回答

相關問題