System.InvalidOperationException
HResult=0x80131509
Message=Invalid id for creating a unit
Source=Esri.ArcGISRuntime
StackTrace:
at Esri.ArcGISRuntime.Geometry.Unit.FromUnitId(Int32 unitId)
at Esri.ArcGISRuntime.Geometry.LinearUnits.get_Meters()
at ArcGISControl.MainWindow..ctor() in C:\Users\mfathin.CSYSINT\Documents\Visual Studio 2017\Projects\ArcGISControl\ArcGISControl\MainWindow.xaml.cs:line 32
Inner Exception 1:
DllNotFoundException: Unable to load DLL 'RuntimeCoreNet.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
private readonly LinearUnit _metersUnit = LinearUnits.Meters;
private readonly AngularUnit _degreesUnit = AngularUnits.Degrees;
private void CreatePoints()
{
// Create a red circle simple marker symbol
SimpleMarkerSymbol redCircleSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, System.Drawing.Color.FromArgb(0xFF, 0xFF, 0x00, 0x00), 10);
MapPoint mapPoint1 = new MapPoint(-2.72, 56.065, SpatialReferences.Wgs84);
MapPoint mapPoint2 = new MapPoint(-2.69, 56.065, SpatialReferences.Wgs84);
// Create graphics and add them to graphics overlay
graphic1 = new Graphic(mapPoint1, redCircleSymbol);
_overlay.Graphics.Add(graphic1);
graphic2 = new Graphic(mapPoint2, redCircleSymbol);
_overlay.Graphics.Add(graphic2);
//CreateLinePoint();
GeodeticDistanceResult distance = GeometryEngine.DistanceGeodetic(mapPoint1, mapPoint2, _metersUnit, _degreesUnit, GeodeticCurveType.Geodesic);
textBox.Text = string.Format("Distance:{0} | Azimuth:{1}", _metersUnit.UnitType.ToString(), _degreesUnit.UnitType.ToString());