solr getinstance is null
本文关键字:null is getinstance solr | 更新日期: 2023-09-27 18:26:09
我使用solr在文档上创建索引。从我的visual studio运行web应用程序时,一切都很好。但在生产服务器上,我得到了一个错误:
Object reference not set to an instance of an object
这是堆栈跟踪
at Microsoft.Practices.ServiceLocation.ServiceLocator.get_Current() in
c:'Home'Chris'Projects'CommonServiceLocator'main'Microsoft.Practices.ServiceLocation'ServiceLocator.cs:line 17
at Fusion.Search.IndexManagerBase`1.GetSolrOperations() in C:'code'src'Fusion.Search'IndexManagerBase.cs:line 42
at Fusion.Search.IndexManagerBase`1.AddFile(String fileName, Stream file, T doc, Boolean commit) in C:'code'src'Fusion.Search'IndexManagerBase.cs:line 97
at Fusion.Search.IndexManagerBase`1.AddFile(String fileName, Stream file, T doc) in C:'code'src'Fusion.Search'IndexManagerBase.cs:line 92
at Fusion.Search.Recruitment.CVStore.AddCV(String fileName, Stream cv, CVDocument doc) in C:'code'src'Fusion.Search'Recruitment'CVStore.cs:line 56
发生错误的代码
public ISolrOperations<T> GetSolrOperations()
{
return ServiceLocator.Current.GetInstance<ISolrOperations<T>>();
}
关于
我发布了"项目中的所有文件"选项,现在似乎可以工作了,有些文件可能没有发布。不过,我不会找出哪个文件,我在这个上浪费了足够的时间