locked
NullReferenceException in Microsoft.Data.Services RRS feed

  • Question

  • The June and October CTPs throw the following exception when any property in the model does not have a public getter or setter.  I've changed my model, but it took me quite a while to zero in on in by trial and error.  Hopefully this will be fixed in the final release, or at least someone else can benefit from my efforts.

     

    System.NullReferenceException occurred

      Message=Object reference not set to an instance of an object.

      Source=Microsoft.Data.Services

      StackTrace:

           at System.Data.Services.Providers.ObjectContextServiceProvider.PopulateMemberMetadata(ResourceType resourceType, IProviderMetadata workspace, IDictionary`2 knownTypes, PrimitiveResourceTypeMap primitiveResourceTypeMap)

      InnerException:

     

     

    >                Microsoft.Data.Services.dll!System.Data.Services.Providers.ObjectContextServiceProvider.PopulateMemberMetadata(System.Data.Services.Providers.ResourceType resourceType, System.Data.Services.Providers.IProviderMetadata workspace, System.Collections.Generic.IDictionary<System.Type,System.Data.Services.Providers.ResourceType> knownTypes, System.Data.Services.Providers.PrimitiveResourceTypeMap primitiveResourceTypeMap) + 0xb4 bytes               

                     Microsoft.Data.Services.dll!System.Data.Services.Providers.ObjectContextServiceProvider.PopulateMetadata(System.Collections.Generic.IDictionary<System.Type,System.Data.Services.Providers.ResourceType> knownTypes, System.Collections.Generic.IDictionary<System.Data.Services.Providers.ResourceType,System.Collections.Generic.List<System.Data.Services.Providers.ResourceType>> childTypes, System.Collections.Generic.IDictionary<string,System.Data.Services.Providers.ResourceSet> entitySets) + 0x3b8 bytes       

                    Microsoft.Data.Services.dll!System.Data.Services.Providers.BaseServiceProvider.PopulateMetadata() + 0x1b bytes               

                    Microsoft.Data.Services.dll!System.Data.Services.Providers.BaseServiceProvider.LoadMetadata() + 0x65 bytes               

                     Microsoft.Data.Services.dll!System.Data.Services.DataService<Tgw.Wcs.Orders.Data.OrdersContext>.CreateMetadataAndQueryProviders(out System.Data.Services.Providers.IDataServiceMetadataProvider metadataProviderInstance, out System.Data.Services.Providers.IDataServiceQueryProvider queryProviderInstance, out System.Data.Services.Providers.BaseServiceProvider builtInProvider, out object dataSourceInstance) + 0x205 bytes     

                     Microsoft.Data.Services.dll!System.Data.Services.DataService<Tgw.Wcs.Orders.Data.OrdersContext>.CreateProvider() + 0x38 bytes      

                     Microsoft.Data.Services.dll!System.Data.Services.DataService<Tgw.Wcs.Orders.Data.OrdersContext>.HandleRequest() + 0x39 bytes      

                     Microsoft.Data.Services.dll!System.Data.Services.DataService<Tgw.Wcs.Orders.Data.OrdersContext>.ProcessRequestForMessage(System.IO.Stream messageBody) + 0x89 bytes       

                    [Lightweight Function] 

                    System.ServiceModel.dll!System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(object instance, object[] inputs, out object[] outputs) + 0x33f bytes         

                    System.ServiceModel.dll!System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x137 bytes           

                    System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x5e bytes             

                    System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x6c bytes              

                    System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x89 bytes             

                    System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x59 bytes             

                    System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x3b bytes             

                    System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x4e bytes             

                    System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x125 bytes           

                    System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x34 bytes             

                    System.ServiceModel.dll!System.ServiceModel.Dispatcher.MessageRpc.Process(bool isOperationContextSet) + 0xff bytes           

                     System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(System.ServiceModel.Channels.RequestContext request, bool cleanThread, System.ServiceModel.OperationContext currentOperationContext) + 0x44b bytes 

                     System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(System.ServiceModel.Channels.RequestContext request, System.ServiceModel.OperationContext currentOperationContext) + 0x127 bytes       

                     System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(System.IAsyncResult result) + 0x43 bytes       

                     System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(System.IAsyncResult result) + 0x44 bytes       

                     System.Runtime.DurableInstancing.dll!System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(System.IAsyncResult result) + 0x32 bytes       

                    System.Runtime.DurableInstancing.dll!System.Runtime.AsyncResult.Complete(bool completedSynchronously) + 0xfd bytes          

                     System.Runtime.DurableInstancing.dll!System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.AsyncQueueReader.Set(System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.Item item) + 0x44 bytes          

                     System.Runtime.DurableInstancing.dll!System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.EnqueueAndDispatch(System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.Item item, bool canDispatchOnThisThread) + 0x1aa bytes      

     

                     System.Runtime.DurableInstancing.dll!System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.EnqueueAndDispatch(System.ServiceModel.Channels.RequestContext item, System.Action dequeuedCallback, bool canDispatchOnThisThread) + 0x5e bytes  

                     System.ServiceModel.dll!System.ServiceModel.Channels.SingletonChannelAcceptor<System.ServiceModel.Channels.IReplyChannel,System.ServiceModel.Channels.ReplyChannel,System.ServiceModel.Channels.RequestContext>.Enqueue(System.ServiceModel.Channels.RequestContext item, System.Action dequeuedCallback, bool canDispatchOnThisThread) + 0x6b bytes  

                     System.ServiceModel.dll!System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(System.ServiceModel.Channels.HttpRequestContext context, System.Action callback) + 0x1b4 bytes

                     System.ServiceModel.Activation.dll!System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(System.ServiceModel.Activation.HostedHttpRequestAsyncResult result) + 0xd6 bytes       

                     System.ServiceModel.Activation.dll!System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() + 0x232 bytes   

                     System.ServiceModel.Activation.dll!System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() + 0x27 bytes      

                     System.ServiceModel.Activation.dll!System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(object state) + 0x49 bytes         

                     System.ServiceModel.Activation.dll!System.ServiceModel.AspNetPartialTrustHelpers.PartialTrustInvoke(System.Threading.ContextCallback callback, object state) + 0x35 bytes         

                     System.ServiceModel.Activation.dll!System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequestWithFlow(object state) + 0x7a bytes         

                    System.Runtime.DurableInstancing.dll!System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(uint errorCode, uint numBytes, System.Threading.NativeOverlapped* nativeOverlapped) + 0x78 bytes        

                    System.Runtime.DurableInstancing.dll!System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(uint error, uint bytesRead, System.Threading.NativeOverlapped* nativeOverlapped) + 0x39 bytes  

                    mscorlib.dll!System.Threading._IOCompletionCallback.PerformIOCompletionCallback(uint errorCode, uint numBytes, System.Threading.NativeOverlapped* pOVERLAP) + 0x74 bytes       

                    [Native to Managed Transition]

                    [Appdomain Transition]               

                    [Native to Managed Transition]

    Wednesday, November 16, 2011 7:31 PM

All replies

  • Thanks for reporting the problem. I was able to repro this.

    I don't think WCF DS will support models with non-public properties, but it should not fail with NullReferenceException.

    Thanks,


    Vitek Karas [MSFT]
    Thursday, November 17, 2011 8:34 AM
    Moderator