今天我将我的nest包更新为1.2.0。现在,当我使用
时var connectionSettings = new ConnectionSettings(connectionPool);
connectionSettings.EnableTrace(true); //no problem when trace not enabled
var cli = new ElasticClient(connectionSettings);
cli.IndexExists(i => i.Index(indexName)).Exists; //throw when trace enabled
然后尝试检查索引是否存在,我得到
System.NullReferenceException: Object reference not set to an instance of an object at
Elasticsearch.Net.Connection.RequestState.TransportRequestState`1.Dispose()
in c:\Users\gmarz\code\elasticsearch-net\src\
Elasticsearch.Net\Connection\RequestState\TransportRequestState.cs: line 181
所以我有两个问题:
查看代码后,transportRequestState的dispose方法抛出,因为秒表对象未初始化。 (TransportRequestState.ce ln184)。如果我确实激活了指标,或者有人在登录之前测试了_stopwatch obvject,那么它将起作用