<?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 Standa-alone .exe: Cannot run CoreHost sample, &amp;quot;External component has thrown an exception.&amp;quot; in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/standa-alone-exe-cannot-run-corehost-sample-quot/m-p/1522311#M11958</link>
    <description>&lt;P&gt;I'm trying to build a stand-alone WinForms exe application. My code ran into trouble when trying to connect to an Enterprise Geodatabase (Oracle), so I tried connecting to a File Geodatabase and got the same error messages. To troubleshoot, I downloaded this Sample:&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/CoreHost/CoreHostSample" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/CoreHost/CoreHostSample&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I double clicked the&amp;nbsp;CoreHostSample.sln file to open the project (I didn't create a fresh project and import the code).&lt;/P&gt;&lt;P&gt;I also downloaded the sample FGDB and put it in the specified location:&amp;nbsp;C:\Data\SDK.gdb. I got the same error when I try to connect to that FGDB on line 84:&amp;nbsp;"External component has thrown an exception.".&amp;nbsp; The VS output window shows this:&amp;nbsp;'System.Runtime.InteropServices.SEHException' in ArcGIS.Core.dll&lt;/P&gt;&lt;P&gt;I stepped into the line with Host.Initialize(); (that's line 77) and no issues seemed to arise.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added&amp;nbsp;C:\Program Files\ArcGIS\Pro\bin to the system PATH variable.&lt;/P&gt;&lt;P&gt;I tried setting&amp;nbsp;ArcGIS.Core.dll and&amp;nbsp;ArcGIS.CoreHost.dll to "Copy Local"&lt;/P&gt;&lt;P&gt;I've ensured that the four conditions under the "Initialize sequence" section of &lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/proconcepts-CoreHost" target="_self"&gt;this article&lt;/A&gt; are met.&lt;/P&gt;&lt;P&gt;After calling Host.Initialize(), I've looped through the available licenses using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;foreach (LicenseCodes lc in Enum.GetValues(typeof(LicenseCodes)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It spits out that Network Analyst, Analyst 3D and Spatial Analyst are all available (with non of the other extension licenses being available). The below returns "License level: Advanced"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;LicenseLevels ll = LicenseInformation.Level;
string ll_str = Enum.GetName(typeof(LicenseLevels), ll);
printMore += "License level: " + ll_str + "\n";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ArcGIS Pro SDK is installed. I'm on Pro 3.0.3 (we reportedly can't upgrade to do incompatibilities with the current (out-dated) version of ArcGIS Server our county uses).&lt;/P&gt;&lt;P&gt;I copied the entire block starting with line 84 into an VS 2022 Pro add-in project and I could connect to the FGDB with no errors thrown. So I think it has something to do with this stand alone exe.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want my application to &lt;EM&gt;not&lt;/EM&gt; be an add-in because 90% of it has nothing to do with GIS - I just need to make a few spatial queries. And developing a Pro add-in gets a bit frustrating because you have to re-launch Pro and then open a project every time you want to start a debug process (if there's a way around that, please let me know!).&lt;/P&gt;&lt;P&gt;Any help would be appreciated! Thanks!&lt;/P&gt;&lt;P&gt;Secondary question: can I use the Pro SDK in a Windows "Forms" application (not console, not WPF)? &lt;A href="https://www.esri.com/content/dam/esrisites/en-us/events/conferences/2020/developer-summit/beginning-pro-customization-showing-pro-extensibility-patterns-of-the-sdk.pdf?srsltid=AfmBOorFRlJZuCgLFnRKdGparwtdcMPfJhAMl619Qa334hAgz57jslVx" target="_self"&gt;This&lt;/A&gt; suggests that I can't. As mentioned, this is not an add-in and I will not be using any type of ArcGIS 'controls' on my forms. I just need to 1) connect to our Enterprise GeoDatabase, 2) select a polygon, 3) Buffer that polygon, 4) select the parcels that intersect the buffer, 5) loop through the parcels and extract attributes. Even if I can't use WinForms, I still can't get the console app to run....&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Aug 2024 17:35:36 GMT</pubDate>
    <dc:creator>AZendel</dc:creator>
    <dc:date>2024-08-15T17:35:36Z</dc:date>
    <item>
      <title>Standa-alone .exe: Cannot run CoreHost sample, "External component has thrown an exception."</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/standa-alone-exe-cannot-run-corehost-sample-quot/m-p/1522311#M11958</link>
      <description>&lt;P&gt;I'm trying to build a stand-alone WinForms exe application. My code ran into trouble when trying to connect to an Enterprise Geodatabase (Oracle), so I tried connecting to a File Geodatabase and got the same error messages. To troubleshoot, I downloaded this Sample:&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/CoreHost/CoreHostSample" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/CoreHost/CoreHostSample&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I double clicked the&amp;nbsp;CoreHostSample.sln file to open the project (I didn't create a fresh project and import the code).&lt;/P&gt;&lt;P&gt;I also downloaded the sample FGDB and put it in the specified location:&amp;nbsp;C:\Data\SDK.gdb. I got the same error when I try to connect to that FGDB on line 84:&amp;nbsp;"External component has thrown an exception.".&amp;nbsp; The VS output window shows this:&amp;nbsp;'System.Runtime.InteropServices.SEHException' in ArcGIS.Core.dll&lt;/P&gt;&lt;P&gt;I stepped into the line with Host.Initialize(); (that's line 77) and no issues seemed to arise.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added&amp;nbsp;C:\Program Files\ArcGIS\Pro\bin to the system PATH variable.&lt;/P&gt;&lt;P&gt;I tried setting&amp;nbsp;ArcGIS.Core.dll and&amp;nbsp;ArcGIS.CoreHost.dll to "Copy Local"&lt;/P&gt;&lt;P&gt;I've ensured that the four conditions under the "Initialize sequence" section of &lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/proconcepts-CoreHost" target="_self"&gt;this article&lt;/A&gt; are met.&lt;/P&gt;&lt;P&gt;After calling Host.Initialize(), I've looped through the available licenses using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;foreach (LicenseCodes lc in Enum.GetValues(typeof(LicenseCodes)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It spits out that Network Analyst, Analyst 3D and Spatial Analyst are all available (with non of the other extension licenses being available). The below returns "License level: Advanced"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;LicenseLevels ll = LicenseInformation.Level;
string ll_str = Enum.GetName(typeof(LicenseLevels), ll);
printMore += "License level: " + ll_str + "\n";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ArcGIS Pro SDK is installed. I'm on Pro 3.0.3 (we reportedly can't upgrade to do incompatibilities with the current (out-dated) version of ArcGIS Server our county uses).&lt;/P&gt;&lt;P&gt;I copied the entire block starting with line 84 into an VS 2022 Pro add-in project and I could connect to the FGDB with no errors thrown. So I think it has something to do with this stand alone exe.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want my application to &lt;EM&gt;not&lt;/EM&gt; be an add-in because 90% of it has nothing to do with GIS - I just need to make a few spatial queries. And developing a Pro add-in gets a bit frustrating because you have to re-launch Pro and then open a project every time you want to start a debug process (if there's a way around that, please let me know!).&lt;/P&gt;&lt;P&gt;Any help would be appreciated! Thanks!&lt;/P&gt;&lt;P&gt;Secondary question: can I use the Pro SDK in a Windows "Forms" application (not console, not WPF)? &lt;A href="https://www.esri.com/content/dam/esrisites/en-us/events/conferences/2020/developer-summit/beginning-pro-customization-showing-pro-extensibility-patterns-of-the-sdk.pdf?srsltid=AfmBOorFRlJZuCgLFnRKdGparwtdcMPfJhAMl619Qa334hAgz57jslVx" target="_self"&gt;This&lt;/A&gt; suggests that I can't. As mentioned, this is not an add-in and I will not be using any type of ArcGIS 'controls' on my forms. I just need to 1) connect to our Enterprise GeoDatabase, 2) select a polygon, 3) Buffer that polygon, 4) select the parcels that intersect the buffer, 5) loop through the parcels and extract attributes. Even if I can't use WinForms, I still can't get the console app to run....&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 17:35:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/standa-alone-exe-cannot-run-corehost-sample-quot/m-p/1522311#M11958</guid>
      <dc:creator>AZendel</dc:creator>
      <dc:date>2024-08-15T17:35:36Z</dc:date>
    </item>
  </channel>
</rss>

