<?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 Unit Testing in Stand Alone CoreHost Pro Application in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unit-testing-in-stand-alone-corehost-pro/m-p/1311841#M10079</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We recently upgraded our stand alone app, built on the Pro SDK/API, from 2.9 to 3.1. In the past we were able to unit test our code that uses the Pro API by simply calling Host.Initialize() on AssemblyInitialize in a test class. That no longer works with the move to 3.1. We have unit testing working correctly in our add-ins, because we followed your instructions here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Regression-Testing" target="_blank"&gt;ProGuide Regression Testing · Esri/arcgis-pro-sdk Wiki · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, that seems to actually start up Pro in a background thread, which is NOT what we want to do with a stand alone application, which shouldn't need a ProApp reference and a UI thread, unless I am misunderstanding. So, how can we get unit testing running again in a 3.1 stand alone Pro app? Currently, when we call Host.Initialize() is waits for a few seconds and acts like it is doing something. It lets us start a QueuedWorker or a QueuedTask, but when we actually try to do something with the API, like get a table definition or something, we get the following error:&lt;/P&gt;&lt;P&gt;System.InvalidOperationException: Dependency resolution failed for component C:\PROGRAM FILES\ARCGIS\PRO\BIN\CoreInterop.dll with error code -2147450750. Detailed error: Hostpolicy must be initialized and corehost_main must have been called before calling corehost_resolve_component_dependencies.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Are there any examples of the unit testing being successfully done in a corehost/stand alone app?&lt;/P&gt;&lt;P&gt;Just trying to think of what other information might be important...we are not using nuget for the Pro libraries, we are using direct assembly references from Program Files.&lt;/P&gt;&lt;P&gt;Any ideas? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jul 2023 00:46:12 GMT</pubDate>
    <dc:creator>StephenDavis1</dc:creator>
    <dc:date>2023-07-26T00:46:12Z</dc:date>
    <item>
      <title>Unit Testing in Stand Alone CoreHost Pro Application</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unit-testing-in-stand-alone-corehost-pro/m-p/1311841#M10079</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We recently upgraded our stand alone app, built on the Pro SDK/API, from 2.9 to 3.1. In the past we were able to unit test our code that uses the Pro API by simply calling Host.Initialize() on AssemblyInitialize in a test class. That no longer works with the move to 3.1. We have unit testing working correctly in our add-ins, because we followed your instructions here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Regression-Testing" target="_blank"&gt;ProGuide Regression Testing · Esri/arcgis-pro-sdk Wiki · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, that seems to actually start up Pro in a background thread, which is NOT what we want to do with a stand alone application, which shouldn't need a ProApp reference and a UI thread, unless I am misunderstanding. So, how can we get unit testing running again in a 3.1 stand alone Pro app? Currently, when we call Host.Initialize() is waits for a few seconds and acts like it is doing something. It lets us start a QueuedWorker or a QueuedTask, but when we actually try to do something with the API, like get a table definition or something, we get the following error:&lt;/P&gt;&lt;P&gt;System.InvalidOperationException: Dependency resolution failed for component C:\PROGRAM FILES\ARCGIS\PRO\BIN\CoreInterop.dll with error code -2147450750. Detailed error: Hostpolicy must be initialized and corehost_main must have been called before calling corehost_resolve_component_dependencies.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Are there any examples of the unit testing being successfully done in a corehost/stand alone app?&lt;/P&gt;&lt;P&gt;Just trying to think of what other information might be important...we are not using nuget for the Pro libraries, we are using direct assembly references from Program Files.&lt;/P&gt;&lt;P&gt;Any ideas? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 00:46:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/unit-testing-in-stand-alone-corehost-pro/m-p/1311841#M10079</guid>
      <dc:creator>StephenDavis1</dc:creator>
      <dc:date>2023-07-26T00:46:12Z</dc:date>
    </item>
  </channel>
</rss>

