C# 从Azure SDK 2.5升级到Azure SDK2.8.1
我在运行时收到一个异常, 我该怎么做才能修好它 我把所有东西都升级到了最新版本C# 从Azure SDK 2.5升级到Azure SDK2.8.1,c#,exception,upgrade,azure-sdk-.net,C#,Exception,Upgrade,Azure Sdk .net,我在运行时收到一个异常, 我该怎么做才能修好它 我把所有东西都升级到了最新版本 var query = q as System.Data.Services.Client.DataServiceQuery<T>; if (continuationToken != null) { query = query.AddQueryOption("NextPartit
var query = q as System.Data.Services.Client.DataServiceQuery<T>;
if (continuationToken != null)
{
query = query.AddQueryOption("NextPartitionKey", continuationToken.PartitionKey);
if (continuationToken.RowKey != null)
{
query = query.AddQueryOption("NextRowKey", continuationToken.RowKey);
}
}
// i fall here with the concrete exception I mentioned above
var response = (System.Data.Services.Client.QueryOperationResponse<T>) query.Execute();
result = result.Union(response.ToList<T>());
Exception thrown: 'System.InvalidCastException' in Microsoft.Data.Services.Client.dll
Additional information: Unable to cast object of type 'System.Data.Services.Client.Providers.EdmEntityTypeWithDelayLoadedProperties' to type 'Microsoft.Data.Edm.IEdmComplexType'.
at System.Data.Services.Client.ClientEdmModel.GetOrCreateEdmTypeInternal(IEdmStructuredType edmBaseType, Type type, PropertyInfo[] keyProperties, Boolean isEntity, Nullable`1 hasProperties)
at System.Data.Services.Client.ClientEdmModel.GetOrCreateEdmTypeInternal(Type type)
at System.Data.Services.Client.ClientEdmModel.GetOrCreateEdmType(Type type)
at System.Data.Services.Client.TypeResolver.ResolveExpectedTypeForReading(Type clientClrType)
at System.Data.Services.Client.Materialization.ODataMaterializer.CreateMaterializerForMessage(IODataResponseMessage responseMessage, ResponseInfo responseInfo, Type materializerType, QueryComponents queryComponents, ProjectionPlan plan, ODataPayloadKind payloadKind)
at System.Data.Services.Client.MaterializeAtom..ctor(ResponseInfo responseInfo, QueryComponents queryComponents, ProjectionPlan plan, IODataResponseMessage responseMessage, ODataPayloadKind payloadKind)
at System.Data.Services.Client.QueryResult.CreateMaterializer(ProjectionPlan plan, ODataPayloadKind payloadKind)
at System.Data.Services.Client.QueryResult.ProcessResult[TElement](ProjectionPlan plan)
at System.Data.Services.Client.DataServiceRequest.Execute[TElement](DataServiceContext context, QueryComponents queryComponents)
at xxx.Data.TableService`1.Select(IQueryable`1 q, Boolean useCache, String cacheKey) in C:\dev\xxx\Development\Platform\xxx.Data\Tables\TableService.cs:line 194