<?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 Re: How to resolve TaskCancelledException in mscorlib.dll? in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-resolve-taskcancelledexception-in-mscorlib/m-p/618796#M7593</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TaskCanceledException is expected when SketchEditor.StartAsync is called while it has not yet completed. Perhaps your edit cancels draw that is also triggered by MouseDown? Where you call &lt;SPAN&gt;SketchEditor.StartAsync, you can surround this with try-catch TaskCanceledException, you can check here SketchEditor properties&amp;nbsp;and possibly determine if you were in the middle of draw or edit? Or perhaps add a check in your MouseDown event handler if SketchEditor is active `if(SketchEditor.Geometry != null) return`. There can only be one active sketch in your MapView, so you can either cancel or suspend one before starting the other; otherwise, the active sketch will be canceled.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Aug 2018 17:15:44 GMT</pubDate>
    <dc:creator>JenniferNery</dc:creator>
    <dc:date>2018-08-06T17:15:44Z</dc:date>
    <item>
      <title>How to resolve TaskCancelledException in mscorlib.dll?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-resolve-taskcancelledexception-in-mscorlib/m-p/618795#M7592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to explore the SketchEditor feature. I am trying to use the sketch editor in my application using MVVM pattern. The code of&amp;nbsp;&lt;STRONG&gt;DRAW&amp;nbsp;&lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;EDIT&lt;/STRONG&gt; , is written in ViewModel Class, whereas the&amp;nbsp;&lt;STRONG&gt;COMPLETE&amp;nbsp;&lt;/STRONG&gt;button is binded to the &lt;STRONG&gt;CompleteCommand&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;of SketchEditor. DRAW operation works absolutely fine on MouseDownEvent, but when I go for Edit , I get &lt;STRONG&gt;TaskCancelled Exception&amp;nbsp;&lt;/STRONG&gt;on line&amp;nbsp;&lt;BR /&gt; &lt;STRONG&gt;var mapPoint = (MapPoint)await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Point, false);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am unable to understand why such problem is coming ??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;The code runs absoultely fine , If I write everything in the code behind file ..&lt;/P&gt;&lt;P&gt;Can anyone help me with this issue ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Aug 2018 10:45:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-resolve-taskcancelledexception-in-mscorlib/m-p/618795#M7592</guid>
      <dc:creator>VijitWadhwa</dc:creator>
      <dc:date>2018-08-04T10:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to resolve TaskCancelledException in mscorlib.dll?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-resolve-taskcancelledexception-in-mscorlib/m-p/618796#M7593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TaskCanceledException is expected when SketchEditor.StartAsync is called while it has not yet completed. Perhaps your edit cancels draw that is also triggered by MouseDown? Where you call &lt;SPAN&gt;SketchEditor.StartAsync, you can surround this with try-catch TaskCanceledException, you can check here SketchEditor properties&amp;nbsp;and possibly determine if you were in the middle of draw or edit? Or perhaps add a check in your MouseDown event handler if SketchEditor is active `if(SketchEditor.Geometry != null) return`. There can only be one active sketch in your MapView, so you can either cancel or suspend one before starting the other; otherwise, the active sketch will be canceled.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 17:15:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-resolve-taskcancelledexception-in-mscorlib/m-p/618796#M7593</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2018-08-06T17:15:44Z</dc:date>
    </item>
  </channel>
</rss>

