<?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: Project.OpenAsync throws an exception in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/project-openasync-throws-an-exception/m-p/1534307#M12027</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would recommend adding dependency to config.daml file to ADCore where esri_core_projectDockPane resides:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;dependencies&amp;gt;
    &amp;lt;dependency name="ADCore.daml" /&amp;gt;
&amp;lt;/dependencies&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Sep 2024 10:47:25 GMT</pubDate>
    <dc:creator>GKmieliauskas</dc:creator>
    <dc:date>2024-09-03T10:47:25Z</dc:date>
    <item>
      <title>Project.OpenAsync throws an exception</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/project-openasync-throws-an-exception/m-p/1534291#M12026</link>
      <description>&lt;P&gt;I have a ArcGIS Pro Managed Configuration project in Visual Studio 2022. I want to open a .aprx file, when the application is ready. I override the&amp;nbsp;OnApplicationReady method in the&amp;nbsp;ConfigurationManager, so when the application is ready I call the Project.OpenAsync method with the desired project file. It throws the "Could not find Project Dock Pane".&lt;/P&gt;&lt;P&gt;I'm&amp;nbsp;&lt;SPAN&gt;stumped&amp;nbsp;on what to do to be able to open the project.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 09:32:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/project-openasync-throws-an-exception/m-p/1534291#M12026</guid>
      <dc:creator>CarstenAndersson</dc:creator>
      <dc:date>2024-09-03T09:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Project.OpenAsync throws an exception</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/project-openasync-throws-an-exception/m-p/1534307#M12027</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would recommend adding dependency to config.daml file to ADCore where esri_core_projectDockPane resides:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;dependencies&amp;gt;
    &amp;lt;dependency name="ADCore.daml" /&amp;gt;
&amp;lt;/dependencies&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 10:47:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/project-openasync-throws-an-exception/m-p/1534307#M12027</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2024-09-03T10:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Project.OpenAsync throws an exception</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/project-openasync-throws-an-exception/m-p/1534518#M12031</link>
      <description>&lt;P&gt;try:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var window = Project.GetCatalogPane(true);
if (window != null)
{
 Project.OpenAsync(@"path_to_your_project");
}&lt;/LI-CODE&gt;&lt;P&gt;In your application ready.&amp;nbsp; However, I dont quite follow the workflow. Your start page is being shown/ refreshing (asynchronously) for the purpose of selecting a project when u trigger opening of another project "underneath" it?&lt;/P&gt;&lt;P&gt;Anyway, this is probably a timing issue in that the application is refreshing the start page UI when u call OpenAsync.&amp;nbsp; If GetCatalogPane returns null u cld try building in a delay before invoking OpenAsync to allow the UI to complete its refresh. Something like "Task.Delay(500).Wait()" or whatever.&lt;/P&gt;&lt;P&gt;That said, the preferred way to open a project without selecting a project from the start page is to specify the project on the command line - as the last argument (ie after the "/config:xxxxxxx"). This will skip showing the start page entirely.&lt;/P&gt;&lt;P&gt;If u need to determine the project URI programmatically, and so cant use the cmd line, id suggest building in an event in your start page view model to fire after it&amp;nbsp; (ie the start page user control) is loaded - and have that event do the OpenAsync.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 17:31:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/project-openasync-throws-an-exception/m-p/1534518#M12031</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2024-09-03T17:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Project.OpenAsync throws an exception</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/project-openasync-throws-an-exception/m-p/1534822#M12033</link>
      <description>&lt;P&gt;Thanks for the reply Charles.&lt;/P&gt;&lt;P&gt;The end user is not shown the start page. The system should automatically open a predetermined .aprx file. I suspect, just like you, that this could be a timing issue, even though I tried waiting for 5 seconds, but only to get the same result. Anyway, I got it to work by calling Project.OpenAsync synchronously (without await) - strange. Not sure why this is the case, but thanks for the reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 05:46:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/project-openasync-throws-an-exception/m-p/1534822#M12033</guid>
      <dc:creator>CarstenAndersson</dc:creator>
      <dc:date>2024-09-04T05:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Project.OpenAsync throws an exception</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/project-openasync-throws-an-exception/m-p/1534823#M12034</link>
      <description>&lt;P&gt;Hi &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I tried it, but with the same result. But, I got it to work by calling Project.OpenAsync synchronously. Not sure why an async method should be called without await, but it works so I will go on from here. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 05:48:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/project-openasync-throws-an-exception/m-p/1534823#M12034</guid>
      <dc:creator>CarstenAndersson</dc:creator>
      <dc:date>2024-09-04T05:48:09Z</dc:date>
    </item>
  </channel>
</rss>

