Development Environment: vs. NET 2005 (C #)
AE version: 9.2 SP4
Error message:
The Type 'esri. arcGIS. mapcontrol. imapcontrolevents2_onoledropeventhandler 'exists in both 'e: \ Program Files \ ArcGIS \ DOTNET \ ESRI. arcGIS. mapcontrol. dll 'and 'e: \ ProgramFiles \ ArcGIS \ DOTNET \ ESRI. arcGIS. axmapcontrol. dll'
Solution:
1. in. NET 2005, go to your project's references folder in Solution Explorer. select ESRI. arcGIS. axmapcontrol or ESRI. arcGIS. mapcontrol. in the properties pane, change aliases from global to global, mapcontrolalias.
Add both axmapcontrol and mapcontrol to the reference, modify the attributes referenced by ESRI. ArcGIS. axmapcontrol, and modify its aliases (alias) by "Global" to "Global, mapcontrolalias ";
2. In your code at the first line in the file Add: extern alias mapcontrolalias;
Add extern alias mapcontrolalias before other namespaces;
3. Add alias to your ambiguous call. Ex. this. axMapControl1.OnMouseMove + = new MapControlAlias: ESRI. ArcGIS. MapControl. IMapControlEvents2_OnMouseMoveEventHandler (this. axmapcontrolpoliconmousemove );
Add the alias: object to be called
This shoshould work, don't worry about trying to do commandline/references as I couldn't figure it out, but the Properties Alias worked.
After modification, it is as follows:
Reference code:
Extern alias MapControlAlias;
Using DevExpress. XtraEditors;
Using DevExpress. XtraEditors. Controls;
Using ESRI. ArcGIS. Carto;
Using ESRI. ArcGIS. DataSourcesFile;
Using ESRI. ArcGIS. DataSourcesRaster;
Using ESRI. ArcGIS. esriSystem;
Using ESRI. ArcGIS. Geodatabase;
Class Code:
This. axmapcontrol1.onmousemove + = new mapcontrolalias: ESRI. ArcGIS. mapcontrol. imapcontrolevents2_onmousemoveeventhandler (this. axmapcontrolpoliconmousemove );
This. axmapcontrol1.onafterdraw + = new mapcontrolalias: ESRI. ArcGIS. mapcontrol. imapcontrolevents2_onafterdraweventhandler (this. axmapcontrolpoliconafterdraw );
From: http://forums.esri.com/thread.asp? C = 159 & F = 1707 & t = 171978 & Mc = 6