因此,我間歇性地收到了一個Exception,它寫出了我的服務器的事件日誌,它記錄了WCF中發生的不良事件。WCF服務中的間歇性序列化異常查找不正確的DLL版本
此異常發生在與客戶端異步回調的「System.TimeoutException」同時發生。我猜想序列化問題會導致超時問題,因爲調用並不是那麼長。
當客戶端從服務獲取其異步回答時,有時會記錄堆棧跟蹤,包括「服務器未提供有意義的回覆」。
因此,我的Web服務的「bin」文件夾包含My.Org.Core DLL的一個副本,其版本爲2.0.0.0,但堆棧跟蹤指的是版本1.8.0.0!我搜索了我的整個解決方案,提及這個舊的1.8.0.0,並且找不到它!請幫忙。
這裏是序列化問題:
An unhandled exception occurred and the process was terminated.
Application ID: DefaultDomain
Process ID: xxxx
Exception: System.Runtime.Serialization.SerializationException
Message: Unable to find assembly 'My.Org.Core, Version=1.8.0.0, Culture=neutral, PublicKeyToken=null'.
StackTrace:
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at 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.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
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.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.AppDomain.Deserialize(Byte[] blob)
at System.AppDomain.UnmarshalObject(Byte[] blob)
嘗試使用nuget的backback dll。因此,該特定版本的dll被刪除。請參閱https://stackoverflow.com/questions/10206090/how-to-install-an-older-version-of-package-via - 相應地改變並改變。 –