Migrating your applications from ArcGIS Mobile 9.3 to 10

Since many changes have been made to the Mobile SDK for 10, you will need to update your applications build on 9.3 to work with the new version. Read the What's new documents to get an overview of the changes, or continue below to learn the steps in upgrading your applications.

NoteNote:

Your client application build with 10, can work with your 9.3 service as long as it does not include any of the new functionality.

NoteNote:

These steps below cover the basic needed to migrate your applications; there may be addition code changes required beyond the scope of this document. For example, the move to the .NET framework 3.5 may affect your application outside of the ArcGIS Mobile SDK parts. This is another reason to save a backup copy of your solution code.

Steps:
  1. Copy your entire solution folder to a backup directory.
  2. Open the solution with Visual Studio 2008. (Support for VS 2005 dropped)
  3. Go to Project > <YourAppName> Properites, and open the Appplication tab. Update the Target Framework to .NET Framework 3.5, then close and reopen the solution as suggested.
  4. In the Solution Explorer Window, check to ensure that the References contains ESRI.ArcGIS.Mobile.
  5. Check that the ToolBox controls are the 10 version, hover over the ArcGIS Mobile controls to get a tooltip
  6. Remove the mobileService1 component and replace it with a MobileCache and MobileServerConnection component from the toolbox.
  7. Open the code window for the form and use the find and replace tool to change mobileService1 to mobilecache1 or mobileServerConnection1 where needed (the members have been moved to one or the other). For example the URL property is on the MobileServerConnection and the Open method is on MobileCache.
  8. Modify the code for setting up the mobile service and map cache, by changing:

    mobileService1.CacheStoragePath = "C:\\temp\\MapCache";
    mobileService1.Url = @"http://NAMEOFYOURSERVER/ArcGIS/services/NAMEOFYOURSERVICE/MapServer";
    mobileService1.Open(CacheOpenMode.Create);
    mobileService1.GetDataAsync(map1,true,null);
    

Your new code for 10 should look something like the following, after you have added a MobileServiceConnection and a MobileCache to the form.

mobileService1.CacheStoragePath = "C:\\temp\\MapCache";
mobileCache1.DeleteCache(); 
mobileServiceConnection1.Url = @"http://NAMEOFYOURSERVER/ArcGIS/services/NAMEOFYOURSERVICE/MapServer/MobileServer";
mobileServiceConnection1.WebClientProtocolType = WebClientProtocolType.BinaryWebService; 
MobileCacheSyncAgent mobileSync = new MobileCacheSyncAgent(mobileCache1, mobileServiceConnection1); 
MobileCacheSyncResults mobileResults = new MobileCacheSyncResults(); 
//get the schema to determine list of layers mobileServiceConnection1.CreateCache(mobileCache1);
mobileCache1.Open(); 
mobileSync.Synchronize();
map1.MapLayers.AddRange(mobileCache1);


9/20/2011