Gerald Hughes
Gerald Hughes

Reputation: 6159

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

After I upgraded the reference Elasticsearch.Net from 1.0.0 to 5.3.0, I keeping getting this error:

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

I'm not sure where it comes from, I tried to change the code for connection to elasticsearch just like here https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/connecting.html

It crashes in the controller. When in debug I doesnt actually get to GetServicesStatus(), I guess it only initialize StatsFacade. And the problem is the connection settings etc.

Any ideas why this is happening?

[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);
        //...
        //...
    }
}

It crashes on ElasticClient initialization ElasticClient client = new ElasticClient(settings);

Upvotes: 2

Views: 1700

Answers (1)

Gerald Hughes
Gerald Hughes

Reputation: 6159

The Elasticsearch.NET library was updated but not the NEST library, and this caused the issue.

Upvotes: 8

Related Questions