<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic System.Collections.Generic.KeyNotFoundException on FeatureLayer.SaveEdits() in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/system-collections-generic-keynotfoundexception-on/m-p/586679#M15020</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm getting the following exception when I call FeatureLayer.SaveEdits(). My layer has DisableClientCaching set. This only happens on some layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.&amp;nbsp; at System.Collections.Generic.Dictionary`2.get_Item(TKey key)&amp;nbsp; at ESRI.ArcGIS.Client.Tasks.ServiceException.CreateFromJSON(String json)&amp;nbsp; at ESRI.ArcGIS.Client.Tasks.TaskBase.CheckForServiceError(RequestEventArgs e)&amp;nbsp; at ESRI.ArcGIS.Client.Tasks.TaskBase.request_Completed(Object sender, RequestEventArgs e)&amp;nbsp; at ESRI.ArcGIS.Client.WebRequest.OnComplete(RequestEventArgs args)&amp;nbsp; at ESRI.ArcGIS.Client.WebRequest.uploadStringCompleted(Object sender, UploadStringCompletedEventArgs e)&amp;nbsp; at System.Net.WebClient.OnUploadStringCompleted(UploadStringCompletedEventArgs e)&amp;nbsp; at System.Net.WebClient.UploadStringOperationCompleted(Object arg)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;None of my try/catch will catch this exception - not around the SaveEdits() call, nor in the EndSaveEdits or SaveEditsFailed event handlers. I suppose that means the exception happens in some private portion of the API after SaveEdits() returns but before those events are raised. I can see in Fiddler that the applyEdits request is sent, but I'm not clear if a response is received (Fiddler noob, I can't seem to find responses to anything)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, MC&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Aug 2013 22:42:54 GMT</pubDate>
    <dc:creator>markcheyne</dc:creator>
    <dc:date>2013-08-22T22:42:54Z</dc:date>
    <item>
      <title>System.Collections.Generic.KeyNotFoundException on FeatureLayer.SaveEdits()</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/system-collections-generic-keynotfoundexception-on/m-p/586679#M15020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm getting the following exception when I call FeatureLayer.SaveEdits(). My layer has DisableClientCaching set. This only happens on some layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.&amp;nbsp; at System.Collections.Generic.Dictionary`2.get_Item(TKey key)&amp;nbsp; at ESRI.ArcGIS.Client.Tasks.ServiceException.CreateFromJSON(String json)&amp;nbsp; at ESRI.ArcGIS.Client.Tasks.TaskBase.CheckForServiceError(RequestEventArgs e)&amp;nbsp; at ESRI.ArcGIS.Client.Tasks.TaskBase.request_Completed(Object sender, RequestEventArgs e)&amp;nbsp; at ESRI.ArcGIS.Client.WebRequest.OnComplete(RequestEventArgs args)&amp;nbsp; at ESRI.ArcGIS.Client.WebRequest.uploadStringCompleted(Object sender, UploadStringCompletedEventArgs e)&amp;nbsp; at System.Net.WebClient.OnUploadStringCompleted(UploadStringCompletedEventArgs e)&amp;nbsp; at System.Net.WebClient.UploadStringOperationCompleted(Object arg)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;None of my try/catch will catch this exception - not around the SaveEdits() call, nor in the EndSaveEdits or SaveEditsFailed event handlers. I suppose that means the exception happens in some private portion of the API after SaveEdits() returns but before those events are raised. I can see in Fiddler that the applyEdits request is sent, but I'm not clear if a response is received (Fiddler noob, I can't seem to find responses to anything)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, MC&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2013 22:42:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/system-collections-generic-keynotfoundexception-on/m-p/586679#M15020</guid>
      <dc:creator>markcheyne</dc:creator>
      <dc:date>2013-08-22T22:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: System.Collections.Generic.KeyNotFoundException on FeatureLayer.SaveEdits()</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/system-collections-generic-keynotfoundexception-on/m-p/586680#M15021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Turns out that I wasn't populating attributes on the graphic for a few non-nullable columns. Although ArcGIS Server gave a meaningful error message to that effect, it appears to nevertheless cause an exception inside the API. By pasting the 'adds' text from the applyEdits request as snagged via Fiddler into the ApplyEdits page of the relevent feature layer using a web browser, I was able to see the response and set myself straight.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 17:55:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/system-collections-generic-keynotfoundexception-on/m-p/586680#M15021</guid>
      <dc:creator>markcheyne</dc:creator>
      <dc:date>2013-08-23T17:55:29Z</dc:date>
    </item>
  </channel>
</rss>

