locked
The exception message is 'The given key was not present in the dictionary.' RRS feed

  • Question

  • Hi,

     

    I am using Astoria over Entity Framework and connecting to a Sql Server Database. The Database has schema's. I have been getting the following error while trying to access the Astoria DataService.

     

    The server encountered an error processing the request. The exception message is 'The given key was not present in the dictionary.'. See server logs for more details. The exception stack trace is:

    at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at System.Data.Services.Providers.ObjectContextServiceProvider.PopulateMemberMetadata(ResourceType resourceType, MetadataWorkspace workspace, IDictionary`2 entitySets, IDictionary`2 knownTypes) at System.Data.Services.Providers.ObjectContextServiceProvider.PopulateMetadata(IDictionary`2 knownTypes, IDictionary`2 entitySets) at System.Data.Services.Providers.BaseServiceProvider.PopulateMetadata() at System.Data.Services.DataService`1.CreateProvider(Type dataServiceType, Object dataSourceInstance, DataServiceConfiguration& configuration) at System.Data.Services.DataService`1.EnsureProviderAndConfigForRequest() at System.Data.Services.DataService`1.ProcessRequestForMessage(Stream messageBody) at SyncInvokeProcessRequestForMessage(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

     

    Can someone please help me figure out what this error is or how I can debug this.

     

    Thanks and Regards,

    NJP

    Wednesday, June 25, 2008 7:02 PM

All replies

  •  

    Hi NitishJp,
     What does your service metadata look like ?

    Navigate to the url : ServiceEndPoint/$metadata and copy the output here .

    Monday, June 30, 2008 3:34 AM
    Moderator
  • Phani,

     

    I tried doing this http://.../DataService.svc/ServiceEndPoint/$metadata but I got the error that I had above.

     

    Regards,

    NJP

     

    Wednesday, July 2, 2008 5:49 PM
  •  

    Can you please tell us what version of astoria are you using - beta1 or something? Also, it would be nice if you could send us the csdl document describing the EF model?

     

    Thanks

    Pratik

     

     

    Wednesday, July 2, 2008 8:09 PM
    Moderator
  • Pratik,

     

    Is it possible for me to send the csdl to an email address for privacy reasons. I am using the VS 2008 sp1 beta version.

     

    Thanks and Regards,

    NJP

     

    Monday, July 7, 2008 2:38 PM
  • Sure. Please email me at pratikp@microsoft.com.donotspam (please remove donotspam from the end).

     

    Thanks

    Pratik

    Monday, July 7, 2008 4:30 PM
    Moderator
  • Hi Pratik,

     

    I have sent you an email with the csdl attached. I hope you have recieved it.

     

    Looking forward to hearing from you.

     

    Thanks and Regards,

    NJP

    Friday, July 11, 2008 2:07 PM
  • Can you please send this to me again? I haven't got any email from you. Again my email id is pratikp@microsoft.com.donotspam (remove .donotspam from the end).

     

    Thanks

    Pratik

     

    Monday, July 14, 2008 5:05 PM
    Moderator
  •  

    I have sent it again Pratik. My email address is nitish_paulus@hotmail.com.donotspam (remove .donotspam from the end).

     

    Regards,

    Nitish

    Wednesday, July 16, 2008 3:28 PM
  • For everyone looking at this thread, here is the response :-

     

     

    Hi Nitish,

     

    I talked to my release management, and I was told that I cannot send latest bits out until there is a official release or something. Given this restriction, there is not much I can do. You will have to wait for the official SP1 bits to come out, which should be hopefully sometime soon.

     

    Thanks

    Pratik

     

    Subject: RE: ADO.NET Data Services (Pre-Release) > The exception message is 'The given key was not present in the dictionary.'

     

    Thanks Pratik. I Look forward to your mail.

    Nitish



    Subject: RE: ADO.NET Data Services (Pre-Release) > The exception message is 'The given key was not present in the dictionary.'

    Sorry for the late response. I looked at the edmx you sent me and it looked fine to me. I tried loading it with the current Astoria bits and it seems to be working fine. Let me try and find out if I can send you the latest bits so that you can give it a try. I will definitely mail you later today or early tomorrow.

     

    Thanks

    Pratik

     

    ubject: ADO.NET Data Services (Pre-Release) » The exception message is 'The given key was not present in the dictionary.'

     

    Hi Pratik,
     
    Please find the csdl attached. I am using VS2008 sp1 beta.
     
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3536242&SiteID=1
     
    Thanks for your help.
     
    Looking forward to hearing from you soon.
     
    Regards,
    Nitish

     

    Thursday, July 31, 2008 2:00 PM