For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Migrate a Windows project

To work with existing native Windows project that was created with IBM MobileFirstâ„¢ Platform Foundation V6.2.0 or later, we must modify the project.


Overview

MobileFirst V8.0.0 only supports Windows Universal environments, that is Windows 10 Universal Windows Platform (UWP) and Windows 8 Universal (Desktop and Phone). Windows Phone 8 Silverlight is not supported.

We can upgrade your Visual Studio project to V8.0.0 manually. MobileFirstV8.0.0 introduces a number of changes to the Visual Studio SDK that may require changes to apps developed in earlier versions. For information on the API's that have changed, see Updating the Windows code.


Procedure

  1. Update your MobileFirst SDK to V8.0.0.
    1. Remove the MobileFirst SDK packages manually. This includes the wlclient.properties file, as well as the following references:

      • Newtonsoft.Json
      • SharpCompress
      • worklight-windows8

      Note: If your app uses the application authenticity or extended authenticity feature, we must add either Microsoft Visual C++ 2013 Runtime Package for Windows or Microsoft Visual C++ 2013 Runtime Package for Windows Phone as a reference to our app. To so do, in Visual Studio, right-click on the references of your native project and complete one of the following choices depending on which environment you added to our native API app:

      • For Windows desktops and tablets: Right click References > Add reference > Windows 8.1 > Extensions > Microsoft Visual C++ 2013 Runtime Package for Windows > OK.
      • For Windows Phone 8 Universal: Right click References > Add reference > Windows 8.1 > Extensions > Microsoft Visual C++ 2013 Runtime Package for Windows Phone > OK.
      • For Windows 10 Universal Windows Platform (UWP): Right click References > Add reference > Windows 8.1 > Extensions > Microsoft Visual C++ 2013 Runtime Package for Windows Universal > OK.
    2. Add the MobileFirst V8.0.0 SDK packages through NuGet. See Adding the MobileFirst SDK by using NuGet.
  2. Updating your application code to use MobileFirst V8.0.0 API's.
    1. For earlier releases, the Windows API's were part of the IBM.Worklight.namespace. These API's are now obsolete and have been replaced by equivalent WorklightNamespace API in the. You need to modify the app to replace all references to the IBM.Worklight.namespace with the corresponding equivalent in the WorklightNamespace.

      For example, the following snippet is an example of using the

      WLResourceRequest request = new WLResourceRequest (new Uri(uriBuilder.ToString()), "GET", "accessRestricted"); request.send(listener);

      The snippet updated with the new API would be :

      WorklightResourceRequest request = newClient.ResourceRequest (new Uri(uriBuilder.ToString(), UriKind.Relative), "GET", "accessRestricted"); WorklightResponse response = await request.Send();

    2. All methods that performed asynchronous operations previously used a Response listener call back model. These have been replaced by the await/async model.


Results

We can now start developing your native Windows application with the MobileFirst SDK. You might need to update your code to reflect the changes for MobileFirstV8.0.0 API.


What to do next

Parent topic: Migrating existing native Windows applications