AnsweredAssumed Answered

Error: "The name Arcmap does not exist in the current context"

Question asked by ionarawilson on Jul 19, 2013
Latest reply on Jul 19, 2013 by ionarawilson
I bought a book called "Beggining Argis for Desktop Development Using .NET". In chapter 2 there is an exercise to create and add-in.
So I created an add in in Visual Studio 2010 but the class file has an error. It says "The name Arcmap does not exist in the current context". I even tried to add using ESRI.ArCGIS.* to no avail. Does anybody know why I am getting this error ? I am using Arcmap 10.1. Thank you for any help

using System; using System.Collections.Generic; using System.Text; using System.IO; using ESRI.ArcGIS.Framework; using ESRI.ArcGIS.esriSystem; using ESRI.ArcGIS.ArcMapUI;   namespace ArcMapAddin1 {     public class ShowTime : ESRI.ArcGIS.Desktop.AddIns.Button     {         public ShowTime()         {         }          protected override void OnClick()         {              Arcmap.Application.Caption = DateTime.Now.ToLongTimeString();         }         protected override void OnUpdate()         {             Enabled = ArcMap.Application != null;         }     }