We have a project for a customer using ArcGIS Mobile 9.3.1 running on a windows desktop toughbook.For better knowing and controlling which version of ArcGIS Mobile is used for the project we do not install the arcgis mobile runtime but delivering following files with our software:ESRI.ArcGIS.Mobile.dll (9.3.1.3000, 484kb) -> included as .net library in our projectESRIMobileCore.dll (9.3.1.3000, 296kb) -> just copied to same directory like ESRI.ArcGIS.Mobile.dllESRIMobileGPS.dll (9.3.1.3000, 241kb) -> just copied to same directory like ESRI.ArcGIS.Mobile.dllESRIMobilePE.dll (9.3.0.1738, 552kb) -> just copied to same directory like ESRI.ArcGIS.Mobile.dllESRIMobileSdc.dll (9.3.0.1339, 1400kb) -> just copied to same directory like ESRI.ArcGIS.Mobile.dllSo, for long time it was no problem to start our program like that.But sometimes we get an TypeInitializationException after compiling new and running program.The error appears in the MainForm Designer File on initialising the form:
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
ESRI.ArcGIS.Mobile.MetricUnitLabels metricUnitLabels1 = new ESRI.ArcGIS.Mobile.MetricUnitLabels();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMap));
this.p_Map = new ESRI.ArcGIS.Mobile.Map();
this.sketchGraphicLayer = new ESRI.ArcGIS.Mobile.Sketch.SketchGraphicLayer();
this.p_ScaleBar = new ESRI.ArcGIS.Mobile.ScaleBar(this.components); //<--- Error
this.p_ToolStrip = new System.Windows.Forms.ToolStrip();
...
}
This is part of designer, we did not change anything.The full exception message is:System.TypeInitializationException: Der Typeninitialisierer für "ESRI.ArcGIS.Mobile.SpatialReferences.ProjectionCoreApi" hat eine Aussnahme verursacht. ---> System.InvalidOperationException: Missing ArcGIS registry key.
bei ESRI.ArcGIS.Mobile.Native.WindowsApi.LoadCore(String dllName)
--- Ende der internen Ausnahmestapelüberwachung ---
ESRI.ArcGIS.Mobile.SpatialReferences.ProjectionCoreApi.CreatUnit(String unitName, Double factor)
bei ESRI.ArcGIS.Mobile.SpatialReferences.Unit..ctor(UnitTypes type)
bei ESRI.ArcGIS.Mobile.SpatialReferences.Unit.UnitCollection..ctor()
bei ESRI.ArcGIS.Mobile.SpatialReferences.Unit.get_Units()
bei ESRI.ArcGIS.Mobile.ScaleBar..ctor()
bei ESRI.ArcGIS.Mobile.ScaleBar..ctor(IContainer container)
bei MyProject.InitializeComponent()