Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

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

$
0
0
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

Code:

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;
        }
    }


Viewing all articles
Browse latest Browse all 1374

Trending Articles