c# - 'Lucene.Net.Store.FSDirectory' 的类型初始值设定项抛出异常

标签 c# asp.net asp.net-core-2.0

我正在尝试在我的 Asp.Net Core 2.0 项目上实现“Lucene 搜索”。

 var dir = FSDirectory.Open(new DirectoryInfo(@"C:/test_lucene"));

我遇到了错误

"The type initializer for 'Lucene.Net.Store.FSDirectory' threw an exception and File not Found Exception".

在 Asp 上。 Net Framework 它没有给出任何错误。

在 Asp.Net Core 中有其他选择吗?

最佳答案

您需要将 nuget 包 System.Configuration.ConfigurationManager 安装到您的项目中。

关于c# - 'Lucene.Net.Store.FSDirectory' 的类型初始值设定项抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51820311/

相关文章:

c# - DatatemplateSelector,列表框拉伸(stretch)

c# - 使用 Web API 执行对象副本时使用的 RESTFull HTTP 方法

c# - 如何在 Service Fabric ASP.NET Core 2 中使用 WebListenerCommunicationListener

c# - RSI vs Wilder 的 RSI 计算问题

C# 运算符重载 == 和 pragma 警告 660 & 661 在不相关时不覆盖 Equals 和 GetHashCode

c# - C# 中高数字的 System.DivideByZeroException

c# - 必填字段验证器在下拉列表回发时消失

.net - 生成 PDF - 如何预先创建分页 HTML 内容?

logging - ASP.NET 核心 2.2 + IIS : Where can I see logs (ILogger) for my app in IIS on server?

postgresql - 如何在 ASP.NET Boilerplate Core 2.0 模板中使用 Npgsql?