1

注意:这是一个已解决的问题,但我在这个问题上只花了4个小时,所以我想分享解决方案。


当我尝试访问 WCF 服务时,该服务从不响应,并且事件日志显示以下内容:

发生未处理的异常,进程终止。

应用程序 ID:默认域

进程号:3180

异常:System.Runtime.Serialization.SerializationException

消息:找不到程序集“System.Data.SQLite,版本=1.0.66.0,文化=中性,PublicKeyToken=db937bc2d44ff139”。

StackTrace:在 System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name) 在 System.Runtime.Serialization.Formatters.Binary 的 System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()。 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 ._ BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped 记录) 在 System.Runtime.Serialization.Formatters.Binary。_BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum) 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) 在 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) 在 System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm) 在System.AppDomain.Deserialize(Byte[] blob) 在 System.AppDomain.UnmarshalObject(Byte[] blob)


解决方案 在我的情况下,问题最终是一个简单的不正确的数据库路径。但是,错误消息绝不反映实际原因,所以 YMMV。

“错误的连接字符串”异常没有出现在事件日志中的原因似乎与这篇知识库文章有关。如果连接字符串不是您的问题,那么您最好的方法可能是按照本文中的步骤进行操作,这将导致 IIS 将异常写入事件日志。

4

0 回答 0