Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > BOOK: Beginning ArcGIS for Desktop Development using .NET
|
BOOK: Beginning ArcGIS for Desktop Development using .NET
This is the forum to discuss the Wrox book Beginning ArcGIS for Desktop Development using .NET by Pouria Amirian; ISBN: 978-1-118-44254-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ArcGIS for Desktop Development using .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 19th, 2013, 01:33 PM
Registered User
 
Join Date: Jul 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error: "The name Arcmap does not exist in the current context"

In chapter 2 (page 51) 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;
        }
    }
 
Old July 19th, 2013, 03:19 PM
Registered User
 
Join Date: Jul 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Smile It is ok now

The error is gone. I am not sure what I did differently. I reinstalled the SDK and installed 3.5 Framework sp1 (which I thought I had already).





Similar Threads
Thread Thread Starter Forum Replies Last Post
The name "FirstName" does not exist in the current context markone BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 1 September 26th, 2012 01:03 AM
MSXSL gives error message for "for" inside "select" ilyaz XSLT 1 December 9th, 2010 05:02 PM
Need code corrections "get sub or function not defined" error" bluesboytoo Excel VBA 1 October 22nd, 2009 11:12 PM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM
"Piblish to Provider..." Option Not Appearing in Database Explorer Context Menu chrisreyno BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 September 18th, 2009 11:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.