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

2963
1
Jump to solution
07-19-2013 09:25 AM
ionarawilson1
Occasional Contributor III
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;         }     } 
0 Kudos
1 Solution

Accepted Solutions
ionarawilson1
Occasional Contributor III
The error is gone. I am not sure what I did differently. I reinstalled the SDK and install 3.5 Framework sp1 (which I thought I had already).

View solution in original post

0 Kudos
1 Reply
ionarawilson1
Occasional Contributor III
The error is gone. I am not sure what I did differently. I reinstalled the SDK and install 3.5 Framework sp1 (which I thought I had already).
0 Kudos