我在IIS托管的WCF服务中进行了服务调用,该服务通过HTTP调用同一IIS实例中的另一个WCF服务。通常,如果第二个服务返回FaultException,则会将其转发给第一个服务的调用方。但是,就在最近,iis服务在收到序列化异常后偶尔会关闭。
Type 'System.ServiceModel.Channels.ReceivedFault' in Assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.
System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(System.RuntimeType)
System.Runtime.Serialization.FormatterServices.GetSerializableMembers(System.Type, System.Runtime.Serialization.StreamingContext)
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(System.Object, System.Runtime.Serialization.ISurrogateSelector, System.Runtime.Serialization.StreamingContext, System.Runtime.Serialization.Formatters.Binary.SerObjectInfoInit, System.Runtime.Serialization.IFormatterConverter, System.Runtime.Serialization.Formatters.Binary.ObjectWriter, System.Runtime.Serialization.SerializationBinder)
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo, System.Runtime.Serialization.Formatters.Binary.NameInfo, System.Runtime.Serialization.Formatters.Binary.NameInfo)
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(System.Object, System.Runtime.Remoting.Messaging.Header[], System.Runtime.Serialization.Formatters.Binary.__BinaryWriter, Boolean)
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(System.IO.Stream, System.Object, System.Runtime.Remoting.Messaging.Header[], Boolean)
System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeObject(System.Object, System.IO.MemoryStream)
System.AppDomain.Serialize(System.Object)
System.AppDomain.MarshalObject(System.Object)
IIS应用程序只有一个appdomain,所以我不确定这个CrossAppDomainSerializer在哪里发挥作用。