附加信息:未找到方法:'Elasticsearch.Net.IApiCallDetails Elasticsearch.Net.IBodyWithApiCallDetails.get_CallDetails()'

Additional information: Method not found: 'Elasticsearch.Net.IApiCallDetails Elasticsearch.Net.IBodyWithApiCallDetails.get_CallDetails()'

将参考 Elasticsearch.Net 从 1.0.0 升级到 5.3.0 后,我一直收到此错误:

Additional information: Method not found: 'Elasticsearch.Net.IApiCallDetails Elasticsearch.Net.IBodyWithApiCallDetails.get_CallDetails()'.

我不确定它来自哪里,我尝试像这里一样更改连接到elasticsearch的代码https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/connecting.html

它在控制器中崩溃。在调试时我实际上并没有到达 GetServicesStatus(),我猜它只初始化 StatsFacade。问题是连接设置等

知道为什么会这样吗?

[HttpGet]
[Route("servicesState")]
public HttpResponseMessage GetServicesState()
{
    var servicesState = StatsFacade.GetServicesStatus();
    return servicesState;
}



public class StatsFacade : BaseFacade
{
    public const int DefaultDaysRange = 10;

    static SingleNodeConnectionPool connectionPool = new SingleNodeConnectionPool(new Uri(ConfigurationManager.AppSettings["Stats:ConnectionString"]));

    static ConnectionSettings _apiCallsSettings = new ConnectionSettings(connectionPool, new InMemoryConnection())
                                                    .DefaultIndex(ConfigurationManager.AppSettings["Stats:DefaultIndex"])
                                                    .BasicAuthentication(ConfigurationManager.AppSettings["Es:User"], ConfigurationManager.AppSettings["Es:Password"])
                                                    .DisableDirectStreaming();

    public static HttpResponseMessage GetServicesStatus()
    {
        ElasticClient client = new ElasticClient(_apiCallsSettings);
        //...
        //...
    }
}

它在 ElasticClient 初始化时崩溃 ElasticClient client = new ElasticClient(settings);

Elasticsearch.NET 库已更新,但 NEST 库未更新,这导致了问题。