|Error|CS1061|‘AxMap’ does not contain a definition for ‘Longitude’ and no accessible extension method ‘Longitude’ accepting a first argument of type ‘AxMap’ could be found (are you missing a using directive or an assembly reference?)

float lon = axMap1.Longitude;

1 Like


I think this dll is not available.
Do you know how to add this AxMapWinGIS dll?

there are 2 ways to solve your problem.
(1) install mapwingis.exe, register mapwingis.ocx, copy the dlls to the program folder. delete the dll in your VS, add your copy dlls to your VS.
(2) drag a new map control to your winform, the dlls can be added automatically.

1 Like

mapwingis.exe is already installed

Hello @Kayumiy

It’s hard to say where the invalid references came from; it could be that old references were in the project already, and VS attempted to resolve the references based on the OCX registered on your machine.

I think the best way to resolve it is to remove all of the references and then re-add them based on the OCX that is registered on your machine.

As he shows in the article,

  1. you add the MapWinGIS reference as a COM reference, and
  2. you add the AxMapWinGIS reference by adding the Map control from the toolbox onto your form


1 Like

this error shows but program work perfectly

The reference to axMap1 is probably left-over from removing the old references. Without seeing your code I can’t say for sure, but perhaps you re-added the OCX and VS named it axMap2, which orphaned the previous reference to axMap1.

There is a link toward the top left corner that says “Go to code”. Click that and it should take you to the reference, and you can see whether or not it can just be removed.


Besides, you should register win32 ocx, not x64 ocx. And you VS program should be also on win32 platform.

1 Like