public Form1() { InitializeComponent(); /* * Uncomment one of the following section to load to the map from a * tiled service, tiled dataset, tiled package, StreetMap for Windows Mobile dataset, * mobile service or mobile cache */ #region Mobile service code snippet //MobileServiceConnection //string mobileServiceUrl = @"http://srv508/arcgis/services/CENIBRA/UsoSoloMobile/MapServer/MobileServer"; string mobileServiceUrl = @"http://srv514/arcgis/rest/services/FIBRIA/mob_parcel/MapServer/MobileServer"; MobileServiceConnection mobileServiceConnection = new MobileServiceConnection(); mobileServiceConnection.Url = mobileServiceUrl; //MobileCache string cacheStoragePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\MapCache"; MobileCache mobileCache = new MobileCache(cacheStoragePath); if (mobileCache.CacheExists == true) mobileCache.DeleteCache(); //Create the schema of the mobile cache and add it to map. //Note that you have to download data from the mobile service in order to display the data mobileServiceConnection.CreateCache(mobileCache); //(Throw HERE) mobileCache.Open(); map1.MapLayers.Add(mobileCache); #endregion }
Solved! Go to Solution.