首页 新闻 会员 周边

请求帮助,Runtime.Serialization.SerializationException

0
悬赏园豆:100 [已关闭问题]

An unhandled exception occurred and the process was terminated.

Application ID: DefaultDomain

Process ID: 2564

Exception: System.Runtime.Serialization.SerializationException

Message: Unable to find assembly 'Lucene.Net, Version=2.3.1.2, 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.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)
   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)

有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。

 

这个问题怎么解决,有人碰到过吗?前段还好好的,现在突然出现了这个问题,看描述应是'Lucene.Net的问题,但是调试也找不到问题啊,知道的帮帮忙,多谢

adward的主页 adward | 初学一级 | 园豆:100
提问于:2008-11-27 22:39
< >
分享
其他回答(5)
0

http://www.cnblogs.com/mahope/archive/2006/09/19/85244.html?在园子里用google搜一下,好像有很多个遇见过这样的异常.

Astar | 园豆:40805 (高人七级) | 2008-11-27 22:55
0

注意这句:Message: Unable to find assembly 'Lucene.Net, Version=2.3.1.2, Culture=neutral, PublicKeyToken=null'.

可能是没有引用Lucene.Net程序集。

上不了岸的鱼 | 园豆:4613 (老鸟四级) | 2008-11-27 23:30
0

不知道是不是因为你要跨appdomain的类没有继承marshalobject

Fei He | 园豆:205 (菜鸟二级) | 2008-11-28 00:22
0

我看了你的异常信息,你的问题我估计是你在自己开启的 Appdomain中 进行了序列化操作,而序列化操作的对象类型中用到了 Lucene.Net 中的一个类,但你自己开启的Appdomain 并没有引用 Lucene.net 库,注意你的默认Appdomain引用了Lucene.net 是没有用的。所以这里就会出现一个现象就是你的程序可以编译通过,因为你静态引用了Lucene.net,但你的程序在Appdomain中却找不到Lucene.net, 于是报 Unable to find assembly 'Lucene.Net, Version=2.3.1.2, Culture=neutral, PublicKeyToken=null'.这个错误。

所以你只要在你的Appdomain 中动态引用一下 Lucene.net就可以了。

引用方法:

在你Appdomain中找到当前Assembly

然后 LoadFrom("Lucene.net.dll");就可以了。

 

 

eaglet | 园豆:17139 (专家六级) | 2008-11-28 07:05
0

学习了

Jared.Nie | 园豆:1940 (小虾三级) | 2008-11-28 13:03
0

类似问题的解决:http://q.cnblogs.com/q/34874/

today4king | 园豆:3499 (老鸟四级) | 2012-04-19 13:28
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册