<?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 Unable to add rasters to programmatically created maps while debugging in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805334#M2154</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've encountered a strange issue and I wonder if anyone else has had this problem.&amp;nbsp; I'm using Visual Studio 2015 and ArcGIS Pro 2.5 (although I had the same problem in 2.4.3 and maybe earlier).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code creates a map programmatically as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Map myMap = MapFactory.Instance.CreateMap("My Map");&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then opens the map in Pro like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;await QueuedTask.Run(async () =&amp;gt;&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; await ProApp.Panes.CreateMapPaneAsync(myMap, myMapExtent);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;All of this works fine.&amp;nbsp; However if I'm running from VS,&amp;nbsp;once the new map has been created, if I try to manually add a raster to the map, I get an error saying "Failed to add data, unsupported data type."&amp;nbsp; In addition, if I then (while in the same debugging session) try to add a raster to ANY map, even if I create a new project and manually add a map, I get the same error.&amp;nbsp; I've tried both .img and .tif rasters and gotten the same result.&amp;nbsp; I have to close and reopen&amp;nbsp;Pro to make adding rasters work correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/482600_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, if while running from VS I&amp;nbsp;add a new map manually before having my code create a map programmatically, and manually add a raster to that map (again before my code creates a map), then I can add rasters with no problem to my programmatically created map!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, if I rebuild my solution in VS and then open Pro separately (i.e., not from VS, so not debugging) I'm able to add rasters to my programmatically created maps with no problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I wonder if this is&amp;nbsp;a problem with Pro or with VS&amp;nbsp;or maybe something in my particular setup.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Feb 2020 00:48:03 GMT</pubDate>
    <dc:creator>KarenMeinstein</dc:creator>
    <dc:date>2020-02-19T00:48:03Z</dc:date>
    <item>
      <title>Unable to add rasters to programmatically created maps while debugging</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805334#M2154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've encountered a strange issue and I wonder if anyone else has had this problem.&amp;nbsp; I'm using Visual Studio 2015 and ArcGIS Pro 2.5 (although I had the same problem in 2.4.3 and maybe earlier).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code creates a map programmatically as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Map myMap = MapFactory.Instance.CreateMap("My Map");&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then opens the map in Pro like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;await QueuedTask.Run(async () =&amp;gt;&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; await ProApp.Panes.CreateMapPaneAsync(myMap, myMapExtent);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;All of this works fine.&amp;nbsp; However if I'm running from VS,&amp;nbsp;once the new map has been created, if I try to manually add a raster to the map, I get an error saying "Failed to add data, unsupported data type."&amp;nbsp; In addition, if I then (while in the same debugging session) try to add a raster to ANY map, even if I create a new project and manually add a map, I get the same error.&amp;nbsp; I've tried both .img and .tif rasters and gotten the same result.&amp;nbsp; I have to close and reopen&amp;nbsp;Pro to make adding rasters work correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/482600_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, if while running from VS I&amp;nbsp;add a new map manually before having my code create a map programmatically, and manually add a raster to that map (again before my code creates a map), then I can add rasters with no problem to my programmatically created map!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, if I rebuild my solution in VS and then open Pro separately (i.e., not from VS, so not debugging) I'm able to add rasters to my programmatically created maps with no problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I wonder if this is&amp;nbsp;a problem with Pro or with VS&amp;nbsp;or maybe something in my particular setup.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2020 00:48:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805334#M2154</guid>
      <dc:creator>KarenMeinstein</dc:creator>
      <dc:date>2020-02-19T00:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add rasters to programmatically created maps while debugging</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805335#M2155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Karen&lt;/P&gt;&lt;P&gt;I am not seeing this issue&amp;nbsp; - I am testing this on Pro version 2.4. Is there a small sample raster file you could share?&lt;/P&gt;&lt;P&gt;I am creating a map and opening the Map pane in one button click like the code below. Is this similar to what you are doing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;//Button's OnClick method&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;protected&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;override&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;OnClick&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; QueuedTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Run&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; MapFactory&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Instance&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateMap&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"MyMap"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; basemap&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; Basemap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ProjectDefault&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; ProApp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Panes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateMapPaneAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; MapViewingMode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

            &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:23:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805335#M2155</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2021-12-12T09:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add rasters to programmatically created maps while debugging</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805336#M2156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uma,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response.&amp;nbsp; Yes, that's what I'm doing.&amp;nbsp; I even created a new button with just your code in it, and tried it and still had the same problem.&amp;nbsp; I'm tempted to go back to 2.4 and see if this still happens.&amp;nbsp; I'm happy to share a raster with you, but I don't see anyplace to add an attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Karen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2020 20:21:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805336#M2156</guid>
      <dc:creator>KarenMeinstein</dc:creator>
      <dc:date>2020-02-19T20:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add rasters to programmatically created maps while debugging</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805337#M2157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Karen&lt;/P&gt;&lt;P&gt;I am afraid the Attach button is a hidden feature &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp;I see it if I click the "Use Advanced editor" button at the top.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/482750_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2020 20:34:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805337#M2157</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2020-02-19T20:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add rasters to programmatically created maps while debugging</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805338#M2158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a raster to try, but I don't think it will make a difference.&amp;nbsp; I'm starting to think there is something weird in my visual studio setup.&amp;nbsp; I went back to Pro 2.4 and I was still having the problem.&amp;nbsp; Thanks for your help with this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2020 21:05:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805338#M2158</guid>
      <dc:creator>KarenMeinstein</dc:creator>
      <dc:date>2020-02-19T21:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add rasters to programmatically created maps while debugging</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805339#M2159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried with 2.4.3 also - I couldn't see the issue with the attached data.&amp;nbsp; Also FYI - Pro version 2.4 onward, Pro SDK supports Visual Studio 2017 and 2019 only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2020 21:18:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805339#M2159</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2020-02-19T21:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add rasters to programmatically created maps while debugging</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805340#M2160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, I didn't know that!&amp;nbsp; I bet if I upgrade VS the problem will stop happening!&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Feb 2020 16:20:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/unable-to-add-rasters-to-programmatically-created/m-p/805340#M2160</guid>
      <dc:creator>KarenMeinstein</dc:creator>
      <dc:date>2020-02-20T16:20:19Z</dc:date>
    </item>
  </channel>
</rss>

