Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know the title sounds unwieldy but as I am beginning convert an existing COM interface to Add-Ins, I am having trouble adding a button to a root menu.

I have an AddIn.Button that is used both as a button (in Add-In Controls) and an item in a rootmenu. The button works but when I add the namespace.classname to the .esriaddinx (as a Button refID="...", I get the modifier "static' and "internal" errors from the config.designer.cs. How do I reference this addin.button in the rootmenu so it can build the designer correctly?

share|improve this question
up vote 2 down vote accepted

I did this successfully: Opened VS2010, choose to create a new Arcmap Add-in project. Edited the xml by hand to look like this:

<ESRI.Configuration xmlns="" xmlns:xsi="">
  <Description>Type in a description for this Add-in.</Description>
    <Target name="Desktop" version="10.0" />
  <AddIn language="CLR" library="ArcMapAddin1.dll" namespace="ArcMapAddin1">
        <Menu isRootMenu="true" id="MyRootMenu" caption="RootMenu">
            <Button refID="AmberGIS_ArcMapAddin1_Button1"/>
        <Button id="AmberGIS_ArcMapAddin1_Button1" class="Button1" message="Add-in command generated by Visual Studio project wizard." caption="My Button" tip="Add-in command tooltip." category="Add-In Controls" image="Images\Button1.png" />

I then ran in debug mode, which brought up arcmap. Under Customize>Customize Mode, I went to Commands tab and was able to drag and drop RootMenu onto the main menu.

enter image description here

After closing, it was still there.

enter image description here

share|improve this answer
Thank you, Kirk. Your example helped in knowing that I was close. The specific problem was that internal static string in the config.designer.cs kept putting in the fully qualified string. Taking out the namespace (as well as simplifying it) was the solution. – SteveC Apr 11 '11 at 19:18
Did you change your xml file, or from the cs file? The cs file is auto generated, so I wouldn't rely on edits made there. – Kirk Kuykendall Apr 12 '11 at 13:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.