<?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 Run ArcMap Application from .Net code in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/run-arcmap-application-from-net-code/m-p/1359148#M20623</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I want to run ArcMap from c# code and get a link to an extension(add-in) for ArcMap.&lt;BR /&gt;Then, I want to call the extension(add-in) method, wait for it to execute, and close ArcMap.&lt;/P&gt;&lt;P&gt;I do the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var doc = new MxDocumentClass();
var app = doc.Parent;
var iapp = app as IApplication;

var myExtClass = new ESRI.ArcGIS.esriSystem.UIDClass();
myExtClass.Value = "{666666d3-a999-55e5-777f-321321321326}";
var myExt = iapp.FindExtensionByCLSID(myExtClass);
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But an&amp;nbsp;error occurs during code execution: "new MxDocumentClass"&lt;BR /&gt;The error is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="err.png" style="width: 410px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/88626i5A202ECF9BC4CFEB/image-size/large?v=v2&amp;amp;px=999" role="button" title="err.png" alt="err.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I run the ArcMap application manually, there is no error.&lt;/P&gt;&lt;P&gt;Version: ArcGis Desktop Basic 10.5.&lt;/P&gt;&lt;P&gt;Tell me, please, what could be the problem?&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2023 09:59:49 GMT</pubDate>
    <dc:creator>vsevgu</dc:creator>
    <dc:date>2023-12-12T09:59:49Z</dc:date>
    <item>
      <title>Run ArcMap Application from .Net code</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/run-arcmap-application-from-net-code/m-p/1359148#M20623</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I want to run ArcMap from c# code and get a link to an extension(add-in) for ArcMap.&lt;BR /&gt;Then, I want to call the extension(add-in) method, wait for it to execute, and close ArcMap.&lt;/P&gt;&lt;P&gt;I do the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var doc = new MxDocumentClass();
var app = doc.Parent;
var iapp = app as IApplication;

var myExtClass = new ESRI.ArcGIS.esriSystem.UIDClass();
myExtClass.Value = "{666666d3-a999-55e5-777f-321321321326}";
var myExt = iapp.FindExtensionByCLSID(myExtClass);
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But an&amp;nbsp;error occurs during code execution: "new MxDocumentClass"&lt;BR /&gt;The error is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="err.png" style="width: 410px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/88626i5A202ECF9BC4CFEB/image-size/large?v=v2&amp;amp;px=999" role="button" title="err.png" alt="err.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I run the ArcMap application manually, there is no error.&lt;/P&gt;&lt;P&gt;Version: ArcGis Desktop Basic 10.5.&lt;/P&gt;&lt;P&gt;Tell me, please, what could be the problem?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 09:59:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/run-arcmap-application-from-net-code/m-p/1359148#M20623</guid>
      <dc:creator>vsevgu</dc:creator>
      <dc:date>2023-12-12T09:59:49Z</dc:date>
    </item>
  </channel>
</rss>

