none
CloudTable.ExecuteQuery<T> throws NullReferenceExceptio if TableRequestOptions is passed

    Question

  • It seems all my table queries are failing when I try to specify TableRequestOptions in the CloudTable.ExecuteQuery method.

    I use the request options to specify EncryptionPolicy, because I have marked some of the properties as [EncryptetProperty].

    I can Retrieve<T> entities, specifying PK and RK, but I can not query.

    What do I need to do in order to get these queries to work?

    varquery = newTableQuery<T>();

    return_table.ExecuteQuery<T>(query, _tableRequestOptions);

    System.NullReferenceException: Object reference not set to an instance of an object.

    Result StackTrace: 
    at Microsoft.WindowsAzure.Storage.Table.TableQuery`1.QueryImpl[T,RESULT_TYPE](TableQuery`1 query, TableContinuationToken token, CloudTableClient client, CloudTable table, EntityResolver`1 resolver, TableRequestOptions requestOptions)
       at Microsoft.WindowsAzure.Storage.Table.TableQuery`1.BeginExecuteQuerySegmentedInternal(TableContinuationToken token, CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext, AsyncCallback callback, Object state)
       at Microsoft.WindowsAzure.Storage.Table.CloudTable.BeginExecuteQuerySegmented[TElement](TableQuery`1 query, TableContinuationToken token, TableRequestOptions requestOptions, OperationContext operationContext, AsyncCallback callback, Object state)
       at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.TaskFromApm[T1,T2,T3,T4,TResult](Func`7 beginMethod, Func`2 endMethod, T1 arg1, T2 arg2, T3 arg3, T4 arg4, CancellationToken cancellationToken)
       at Microsoft.WindowsAzure.Storage.Table.CloudTable.ExecuteQuerySegmentedAsync[TElement](TableQuery`1 query, TableContinuationToken token, TableRequestOptions requestOptions, OperationContext operationContext, CancellationToken cancellationToken)
       at Microsoft.WindowsAzure.Storage.Table.CloudTable.ExecuteQuerySegmentedAsync[TElement](TableQuery`1 query, TableContinuationToken token, TableRequestOptions requestOptions, OperationContext operationContext)
       at CloudTableStorage.TableProxy`1.<GetChangesAsync>d__13.MoveNext() in ...

    Saturday, June 13, 2015 8:48 PM

Answers

All replies