Using Arcmap in GIS pro C#

910
1
07-13-2021 08:03 PM
wgoris
by
New Contributor
 

I am doing a Migration from Arcmap to GIS PRO and I am trying to replace arcmap with new interface or corresponding code.

I am new to GIS and GIS pro. What is the correct way to replace Arcmap in GIS pro

Error:

Error CS0103 The name 'Arcmap' does not exist in the current context

Here is the Code examples

Arcmap.FocusMap.AddLayer((ESRI.ArcGIS.Carto.ILayer)ctfl);
Arcmap.ActiveView.Refresh();

What I have tried:

IMxDocument document;

document.ActiveView.Refresh
IMxDocument mxdoc = ArcMap.Application.Document as IMxDocument;

but I keep getting the same error cannot find ArcMap.

I tried adding the arcmap and arcmapUI reference

 

wgoris_1-1626231786308.png

 

 

 

Tags (2)
0 Kudos
1 Reply
GKmieliauskas
Esri Regular Contributor

Hi,

There is no one way of migrating ArcMap application to ArcGIS Pro add-in.

There is official  Esri page for this:

https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Migrating-to-ArcGIS-Pro 

Similar questions and discussions you can find here:

ArcMap addin migration to Pro - Esri Community

porting C#.net ArcMap add-ins to ArcGIS Pro Add-in... - Esri Community

0 Kudos