Asp.net System.Runtime.Serialization.SerializationException消息:找不到程序集';Lucene.Net
在asp.net网站中的应用程序启动事件上运行以下代码:Asp.net System.Runtime.Serialization.SerializationException消息:找不到程序集';Lucene.Net,asp.net,c#-4.0,serialization,Asp.net,C# 4.0,Serialization,在asp.net网站中的应用程序启动事件上运行以下代码: public void CheckRebuildTasks() { try { var ts = _rebuildRepository.Source.unCompleteRoots(); if (ts.Any()) { var task = new Task(() => { int s = 30; string nameList
public void CheckRebuildTasks()
{
try
{
var ts = _rebuildRepository.Source.unCompleteRoots();
if (ts.Any())
{
var task = new Task(() =>
{
int s = 30;
string nameList = string.Empty;
try
{
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);
});
}
catch (Exception exc)
{
_log.Error(exc);
}
});
task.LogExceptions("CheckRebuildTasks");
task.Start();
}
}
catch (Exception exc)
{
_log.Error("CheckRebuildTasks", exc);
}
}
windows事件日志消息:
发生未处理的异常,进程终止。
应用程序ID:DefaultDomain
进程ID:19232
异常:System.Runtime.Serialization.SerializationException
消息:找不到程序集'Lucene.Net,版本=2.9.4.1,
文化=中性,PublicKeyToken=85089178b9ac3181'
StackTrace:在
System.Runtime.Serialization.Formatters.Binary.BinarySassemblyInfo.GetAssembly()
在
System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinarySassemblyInfo
assemblyInfo,字符串名称)位于
System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(字符串
objectName,String[]MemberName,BinaryTypeEnum[]binaryTypeEnumA,
对象[]类型信息A、Int32[]成员组件、ObjectReader
objectReader、Int32 objectId、BinarySassemblyInfo assemblyInfo、,
尺寸阵列组件(可组装)位于
System.Runtime.Serialization.Formatters.Binary.\u BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped
记录)在
System.Runtime.Serialization.Formatters.Binary.\u BinaryParser.Run()在 System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler 处理程序,\uuuu二进制解析器serParser,布尔fCheck,布尔 isCrossAppDomain,IMethodCallMessage methodCallMessage)位于 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(流) serializationStream,HeaderHandler处理程序,布尔fCheck,布尔 isCrossAppDomain,IMethodCallMessage methodCallMessage)位于 System.AppDomain.Deserialize(字节[]blob)位于 System.AppDomain.UnmarshalObject(字节[]blob)
注:已经参考了Lucene.Net,程序在本地pc上运行良好,因为它在本地pc上运行,我猜你的意思是它在另一台机器上坏了。那台机器的Lucene dll版本是否与您的完全相同?感谢您的回复,版本完全相同。此问题已经解决,当任务中出现未处理的异常时,会发生此错误。我有完全相同的问题。我们所有的代理和DTO都在同一个项目中,每隔一段时间我们就会收到完全相同的错误消息。