2016-11-29 9 views
0

現在、NEST 5.0.0-rc3を使用していますが、実行するクエリを取得できませんでした。NEST 5.x NEST 2.xへの依存?

var client = new Nest.ElasticClient(connectionSettings); 
var searchResponse = client.Search<Page>(s => s 
    .MatchAll() 
    .From(0) 
    .Size(10) 
    .Source(f => f.Includes(i => i.Field(x => x.Id))) 
); 

(ごめんフォーマットは一種のラフである)次の.NET例外を生成します:

<Error> 
<Message>An error has occurred.</Message> 
<ExceptionMessage> 
Could not load file or assembly 'Nest, Version=2.0.0.0, Culture=neutral, PublicKeyToken=96c599bbe3e70f5d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 
</ExceptionMessage> 
<ExceptionType>System.IO.FileLoadException</ExceptionType> 
<StackTrace> 
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) at System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 attributeCtorToken, Boolean mustBeInheritable) at System.Reflection.CustomAttribute.IsDefined(RuntimePropertyInfo property, RuntimeType caType) at System.Reflection.RuntimePropertyInfo.IsDefined(Type attributeType, Boolean inherit) at Newtonsoft.Json.Serialization.DefaultContractResolver.GetSerializableMembers(Type objectType) at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateProperties(Type type, MemberSerialization memberSerialization) at Nest.ElasticContractResolver.CreateProperties(Type type, MemberSerialization memberSerialization) in C:\Users\russ\source\elasticsearch-net-5.x\src\Nest\CommonAbstractions\SerializationBehavior\ElasticContractResolver.cs:line 119 at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(Type objectType) at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType) at Nest.ElasticContractResolver.<CreateContract>b__12_0(Type o) in C:\Users\russ\source\elasticsearch-net-5.x\src\Nest\CommonAbstractions\SerializationBehavior\ElasticContractResolver.cs:line 41 at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) at Nest.ElasticContractResolver.CreateContract(Type objectType) in C:\Users\russ\source\elasticsearch-net-5.x\src\Nest\CommonAbstractions\SerializationBehavior\ElasticContractResolver.cs:line 39 at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.GetContractSafe(Type type) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Populate(JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerProxy.PopulateInternal(JsonReader reader, Object target) at Newtonsoft.Json.JsonSerializer.Populate(JsonReader reader, Object target) at Nest.ConcreteTypeConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in C:\Users\russ\source\elasticsearch-net-5.x\src\Nest\CommonAbstractions\SerializationBehavior\StatefulDeserialization\ConcreteTypeConverter.cs:line 67 at Nest.DefaultHitJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in C:\Users\russ\source\elasticsearch-net-5.x\src\Nest\CommonAbstractions\SerializationBehavior\StatefulDeserialization\ConcreteTypeConverter.cs:line 32 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType) at Nest.JsonNetSerializer.Deserialize[T](Stream stream) in C:\Users\russ\source\elasticsearch-net-5.x\src\Nest\CommonAbstractions\SerializationBehavior\JsonNetSerializer.cs:line 114 at Elasticsearch.Net.ResponseBuilder`1.SetBody(ElasticsearchResponse`1 response, Stream stream) in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Transport\Pipeline\ResponseBuilder.cs:line 79 at Elasticsearch.Net.ResponseBuilder`1.ToResponse() in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Transport\Pipeline\ResponseBuilder.cs:line 33 at Elasticsearch.Net.HttpConnection.Request[TReturn](RequestData requestData) in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection.cs:line 155 at Elasticsearch.Net.RequestPipeline.CallElasticsearch[TReturn](RequestData requestData) in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:line 411 at Elasticsearch.Net.Transport`1.Request[TReturn](HttpMethod method, String path, PostData`1 data, IRequestParameters requestParameters) in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Transport\Transport.cs:line 69 
</StackTrace> 
</Error> 

はいます/私はを参照してプルする必要がある必要がありますたとえば、このクエリは

巣の2.x版も同様に?

答えて

1

NEST 5.xによるNEST 2.xへの依存性はありません。これは、あなたが5.xに対して参照/コンパイルしなければならないNEST 2.xに対して/参照してコンパイルされた何かを持っているように思えます。

関連する問題