<?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: Strange behavior when working with tasks in ArcGIS Pro and C# in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/strange-behavior-when-working-with-tasks-in-arcgis/m-p/854650#M4444</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carsten,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately this is a bug.&amp;nbsp; If you ensure you have the task pane open when you run this code, it should succeed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added an issue to our backlog to fix this&amp;nbsp;for the next release.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the inconvenience.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Narelle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Aug 2018 18:40:13 GMT</pubDate>
    <dc:creator>NarelleChedzey</dc:creator>
    <dc:date>2018-08-09T18:40:13Z</dc:date>
    <item>
      <title>Strange behavior when working with tasks in ArcGIS Pro and C#</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/strange-behavior-when-working-with-tasks-in-arcgis/m-p/854649#M4443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've noticed something strange when developing a C# add-in for ArcGIS Pro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created one task item with two task "inside".&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/418397_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;I want to iterate through the list of tasks, like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var taskItem = Project.Current.GetItems&amp;lt;TaskProjectItem&amp;gt;().FirstOrDefault();&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TaskItemInfo taskItemInfo = taskItem.GetTaskItemInfo(); // &amp;lt;-- This line is throwing the NullReferenceException&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;IEnumerable&amp;lt;TaskInfo&amp;gt; taskInfos = taskItemInfo.GetTasks();&lt;/P&gt;&lt;P&gt;foreach (TaskInfo taskInfo in taskInfos)&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// do something &lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the 2nd line is throwing an exception. I don't understand why. I've actually taken the code from&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic13023.html" title="http://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic13023.html"&gt;ArcGIS Pro 2.2 API Reference Guide&lt;/A&gt;&amp;nbsp;with the same result. I don't get it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 12:14:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/strange-behavior-when-working-with-tasks-in-arcgis/m-p/854649#M4443</guid>
      <dc:creator>CarstenAndersson</dc:creator>
      <dc:date>2018-08-09T12:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when working with tasks in ArcGIS Pro and C#</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/strange-behavior-when-working-with-tasks-in-arcgis/m-p/854650#M4444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carsten,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately this is a bug.&amp;nbsp; If you ensure you have the task pane open when you run this code, it should succeed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added an issue to our backlog to fix this&amp;nbsp;for the next release.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the inconvenience.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Narelle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 18:40:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/strange-behavior-when-working-with-tasks-in-arcgis/m-p/854650#M4444</guid>
      <dc:creator>NarelleChedzey</dc:creator>
      <dc:date>2018-08-09T18:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when working with tasks in ArcGIS Pro and C#</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/strange-behavior-when-working-with-tasks-in-arcgis/m-p/854651#M4445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Narelle.&lt;/P&gt;&lt;P&gt;Thanks a lot for the reply &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp;I will look forward to the fix.&lt;/P&gt;&lt;P&gt;Carsten&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 12:25:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/strange-behavior-when-working-with-tasks-in-arcgis/m-p/854651#M4445</guid>
      <dc:creator>CarstenAndersson</dc:creator>
      <dc:date>2018-08-13T12:25:33Z</dc:date>
    </item>
  </channel>
</rss>

