首页 > 解决方案 > Microsoft.OData.Client.ClientEdmModel.GetOrCreateEdmType:System.IndexOutOfRangeException:索引超出了数组的范围

问题描述

我们的服务使用 ODataV4 调用其他服务。我们偶尔会在生产中看到以下异常。我们正在进行 GET 调用。您能否建议我们应该验证/检查什么是导致此错误的根本原因?我们使用的是 6.16 版本的 OData.Client

System.IndexOutOfRangeException:索引超出了数组的范围。在 System.Collections.Generic.List 1.Enumerator.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 源,Func2 predicate) at Microsoft.OData.Client.ClientEdmModel.GetOrCreateEdmTypeInternal(IEdmStructuredType edmBaseType, Type type, PropertyInfo[] keyProperties, Boolean isEntity, Nullable1 hasProperties) 在 Microsoft.OData.Client.ClientEdmModel.GetOrCreateEdmType(Type type) 在 Microsoft.OData.Client.Materialization.ODataMaterializer.CreateMaterializerForMessage(IODataResponseMessage responseMessage, ResponseInfo responseInfo,在 Microsoft.OData.Client.MaterializeAtom..ctor(ResponseInfo responseInfo, QueryComponents queryComponents, ProjectionPlan plan, IODataResponseMessage responseMessage, ODataPayloadKind payloadKind) 在 Microsoft.OData.Client.QueryResult.CreateMaterializer( Microsoft.OData.Client.QueryResult.ProcessResult[TElement] 上的 ProjectionPlan 计划,ODataPayloadKind payloadKind)(Microsoft.OData.Client 上的 ProjectionPlan 计划)。Microsoft.Management.Services.OData.Client.ODataServiceContextV4 中 Microsoft.OData.Client.DataServiceContext.EndExecute[TElement](IAsyncResult asyncResult) 中的 DataServiceRequest.EndExecute[TElement](对象源、DataServiceContext 上下文、字符串方法、IAsyncResult asyncResult)。< >c__DisplayClass45_0`1.b__1(IAsyncResult 结果)

标签: odata

解决方案


推荐阅读