<?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: My.Arcmap.Application Not Recognized in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/my-arcmap-application-not-recognized/m-p/743869#M19796</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OP, I would quickly assume that they did not add their .net developer kit and use the Template to create their addin...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My is the Namespace created when created using the Developer Template addin CLASS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(Your addin solution)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Namespace My will contain the Friend Module ThisAddin and pass any XML information to the Solution project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Friend Module ArcMap
&amp;nbsp; Private s_app As ESRI.ArcGIS.Framework.IApplication
&amp;nbsp; Private s_docEvent As ESRI.ArcGIS.ArcMapUI.IDocumentEvents_Event

&amp;nbsp; Public ReadOnly Property Application() As ESRI.ArcGIS.Framework.IApplication
&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If s_app Is Nothing Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_app = TryCast(Internal.AddInStartupObject.GetHook(Of ESRI.ArcGIS.ArcMapUI.IMxApplication)(), ESRI.ArcGIS.Framework.IApplication)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return s_app
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp; End Property

&amp;nbsp; Public ReadOnly Property Document() As ESRI.ArcGIS.ArcMapUI.IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Application IsNot Nothing Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return TryCast(Application.Document, ESRI.ArcGIS.ArcMapUI.IMxDocument)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp; End Property
&amp;nbsp; Public ReadOnly Property ThisApplication() As ESRI.ArcGIS.ArcMapUI.IMxApplication
&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return TryCast(Application, ESRI.ArcGIS.ArcMapUI.IMxApplication)
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp; End Property
&amp;nbsp; Public ReadOnly Property DockableWindowManager() As ESRI.ArcGIS.Framework.IDockableWindowManager
&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return TryCast(Application, ESRI.ArcGIS.Framework.IDockableWindowManager)
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp; End Property

&amp;nbsp; Public ReadOnly Property Events() As ESRI.ArcGIS.ArcMapUI.IDocumentEvents_Event
&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_docEvent = TryCast(Document, ESRI.ArcGIS.ArcMapUI.IDocumentEvents_Event)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return s_docEvent
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp; End Property
End Module&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you can use My namespace and get ArcMap.Application&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rhalko:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why should ESRI document how to use XML?&amp;nbsp; We all know special characters in different codes require attention.&amp;nbsp; Hopefully your afternoon gets better now that you found what was wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references" rel="nofollow noopener noreferrer" target="_blank"&gt;XML characters&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to use &amp;amp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;amp;amp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g. &amp;lt;company&amp;gt;AT&amp;amp;amp;T&amp;lt;/company&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 07:39:30 GMT</pubDate>
    <dc:creator>MichaelRobb</dc:creator>
    <dc:date>2021-12-12T07:39:30Z</dc:date>
    <item>
      <title>My.Arcmap.Application Not Recognized</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/my-arcmap-application-not-recognized/m-p/743867#M19794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to use Visual Basic Express to implement the Visual Basic.NET version of the Zoom to Layer add-in sample located here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/ZoomToLayerButton/00480000024t000000/"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/ZoomToLayerButton/00480000024t000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I copied and pasted the code into the IDE and activated all the references listed in the import statements.&amp;nbsp; My problem is that all instances of My.ArcMap.Application&amp;nbsp; in the code register as errors.&amp;nbsp; For example, the IDE identifies My.ArcMap.Application in the following statement as an error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enabled = My.ArcMap.Application IsNot Nothing&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error message says, "Arcmap is not a member of My."&amp;nbsp; At this point, I've exhausted all my ideas for fixing the problem.&amp;nbsp; I appreciate any help you can provide.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Brad&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jan 2011 18:41:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/my-arcmap-application-not-recognized/m-p/743867#M19794</guid>
      <dc:creator>BradAllen</dc:creator>
      <dc:date>2011-01-06T18:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: My.Arcmap.Application Not Recognized</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/my-arcmap-application-not-recognized/m-p/743868#M19795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Brad,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure if you found a solution yet, but I had to deal with this frustrating issue today. In my case it was because I used the '&amp;amp;' character in the Company info when creating the project. The config file (XML) became inconsistent with the build information, not allowing for my tool to show in the add-in manager as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks to ESRI, for choosing to use XML. Perhaps if this kind of error was documented... I wouldn't have had such a bad afternoon thus far.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2011 17:18:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/my-arcmap-application-not-recognized/m-p/743868#M19795</guid>
      <dc:creator>RobHalko</dc:creator>
      <dc:date>2011-04-07T17:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: My.Arcmap.Application Not Recognized</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/my-arcmap-application-not-recognized/m-p/743869#M19796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OP, I would quickly assume that they did not add their .net developer kit and use the Template to create their addin...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My is the Namespace created when created using the Developer Template addin CLASS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(Your addin solution)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Namespace My will contain the Friend Module ThisAddin and pass any XML information to the Solution project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Friend Module ArcMap
&amp;nbsp; Private s_app As ESRI.ArcGIS.Framework.IApplication
&amp;nbsp; Private s_docEvent As ESRI.ArcGIS.ArcMapUI.IDocumentEvents_Event

&amp;nbsp; Public ReadOnly Property Application() As ESRI.ArcGIS.Framework.IApplication
&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If s_app Is Nothing Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_app = TryCast(Internal.AddInStartupObject.GetHook(Of ESRI.ArcGIS.ArcMapUI.IMxApplication)(), ESRI.ArcGIS.Framework.IApplication)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return s_app
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp; End Property

&amp;nbsp; Public ReadOnly Property Document() As ESRI.ArcGIS.ArcMapUI.IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Application IsNot Nothing Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return TryCast(Application.Document, ESRI.ArcGIS.ArcMapUI.IMxDocument)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp; End Property
&amp;nbsp; Public ReadOnly Property ThisApplication() As ESRI.ArcGIS.ArcMapUI.IMxApplication
&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return TryCast(Application, ESRI.ArcGIS.ArcMapUI.IMxApplication)
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp; End Property
&amp;nbsp; Public ReadOnly Property DockableWindowManager() As ESRI.ArcGIS.Framework.IDockableWindowManager
&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return TryCast(Application, ESRI.ArcGIS.Framework.IDockableWindowManager)
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp; End Property

&amp;nbsp; Public ReadOnly Property Events() As ESRI.ArcGIS.ArcMapUI.IDocumentEvents_Event
&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_docEvent = TryCast(Document, ESRI.ArcGIS.ArcMapUI.IDocumentEvents_Event)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return s_docEvent
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp; End Property
End Module&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you can use My namespace and get ArcMap.Application&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rhalko:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why should ESRI document how to use XML?&amp;nbsp; We all know special characters in different codes require attention.&amp;nbsp; Hopefully your afternoon gets better now that you found what was wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references" rel="nofollow noopener noreferrer" target="_blank"&gt;XML characters&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to use &amp;amp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;amp;amp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g. &amp;lt;company&amp;gt;AT&amp;amp;amp;T&amp;lt;/company&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:39:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/my-arcmap-application-not-recognized/m-p/743869#M19796</guid>
      <dc:creator>MichaelRobb</dc:creator>
      <dc:date>2021-12-12T07:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: My.Arcmap.Application Not Recognized</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/my-arcmap-application-not-recognized/m-p/743870#M19797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Brad,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you creating the project using an Add-In template? I spent a fair amount of time researching the same issue for the Add-In I was developing. Ultimately, I found that the &amp;lt;ArcMap&amp;gt; tag was missing from the 'Config.esriaddinx' file. Once I added this the build ran successfully. If you are using the Add-In template, try adding the following sample text (and modify for your add-in type) within the &amp;lt;Addin&amp;gt; tag of the 'Config.esriaddinx' file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
&amp;lt;ArcMap&amp;gt;
&amp;lt;Commands&amp;gt;
&amp;lt;Button
id="Acme_ToggleDockWinBtn"
class="ToggleDockWinBtn"
caption="OpenDockWin"
category="Acme Tools"
image="Images\ToggleDockWinBtn.png"
tip="Toggle dockable window."
message="Open dockable window."&amp;gt;
&amp;lt;Helpheading="Toggle"&amp;gt;Turns the ACME dockable window on and off.&amp;lt;/Help&amp;gt;
&amp;lt;/Button&amp;gt;
&amp;lt;/Commands&amp;gt;
&amp;lt;/ArcMap&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kyle&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:39:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/my-arcmap-application-not-recognized/m-p/743870#M19797</guid>
      <dc:creator>KyleBelott</dc:creator>
      <dc:date>2021-12-12T07:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: My.Arcmap.Application Not Recognized</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/my-arcmap-application-not-recognized/m-p/1030600#M20254</link>
      <description>&lt;P&gt;Just came across this issue.&amp;nbsp; Using .NET, it was saying the exact same thing about My.ArcMap not a member.&amp;nbsp; Well, it turned out to be simple.&amp;nbsp; The assembly when building was defaulting to have onDemand="true".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just add onDemand="false" to Config.esriaddinx inside the &amp;lt;Button&amp;nbsp;&amp;nbsp; /&amp;gt; brackets.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 18:54:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/my-arcmap-application-not-recognized/m-p/1030600#M20254</guid>
      <dc:creator>MarshallFlynn</dc:creator>
      <dc:date>2021-02-25T18:54:03Z</dc:date>
    </item>
  </channel>
</rss>

