亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

System.Runtime.Serialization.SerializationException Message: Unable to find assembly 'Lucene.Net

System.Runtime.Serialization.SerializationException Message: Unable to find assembly 'Lucene.Net

九州編程 2018-12-06 22:20:21
在站點Application_Start中執行如下代碼: public void CheckRebuildTasks() { try { var ts = _rebuildRepository.Source.unCompleteRoots(); if (ts.Any()) { Task.Factory.StartNew(() => { int s = 30; string nameList = string.Empty; ts.ToList().ForEach( t => nameList += string.Format("{0}[{1}]", t.AppName, t.AppContentName)); _log.Info(string.Format("Sleep {0}s to continue {1}", s, nameList)); System.Threading.Thread.Sleep(30*1000); ts.ToList().ForEach(t => { var appContent = _appContentRepository.GetBy(t.AppName, t. AppContentName); this.ClearRebuild(appContent.Name, appContent.ContentType); var si = new SmartIndexer(appContent, _zzkDocumentRepository, _rebuildRepository); si.Rebuild(t); }); }).LogExceptions("CheckRebuildTasks"); } } catch(Exception exc) { _log.Error("CheckRebuildTasks", exc); } } EventLog中的信息: An unhandled exception occurred and the process was terminated. Application ID: DefaultDomain Process ID: 43644 Exception: System.Runtime.Serialization.SerializationException Message: Unable to find assembly 'Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181'. 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.AppDomain.Deserialize(Byte[] blob) at System.AppDomain.UnmarshalObject(Byte[] blob) ? 注:已經引用Lucene.Net,程序能運行,但是每過一段時間后會被回收(不是合法的回收,會有錯誤)。
查看完整描述

2 回答

?
繁花如伊

TA貢獻2012條經驗 獲得超12個贊

回收是因為你的應用程序池回收了,可以設置IIS 把回收時間加長。序列化問題可能是你的某個文件用了較老版本的 lucene.net 生成,然后反序列化時又用了新版本的 lucene.net ,由于 binary serialize 時會把一些版本和類的信息寫到序列化的文件中,如果對不上,就可能失敗。

查看完整回答
反對 回復 2019-01-21
  • 2 回答
  • 0 關注
  • 664 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號