Migrating Windows Store apps to the latest Windows Library for JavaScript

This article is for developers of Windows Store apps using JavaScript who want to upgrade their application from the Windows 8 Release Preview to the Windows 8 version of the Windows Library for JavaScript (WinJS).

There are four steps you must go through to upgrade an application:

  • Remove Microsoft Visual Studio references to the previous Microsoft WinJS library.
  • Update WinJS references in the Visual Studio References Manager.
  • Replace any URI references from "//Microsoft.WinJS.1.0.RC" to "//Microsoft.WinJS.1.0".
  • Adjust your code to fix errors resulting from breaking changes.
  • Build and test your app.

Important  A full list of breaking changes from Windows 8 Release Preview to Windows 8 is outside the scope of this document. We recommend that you review the app compatibility migration document for a full list of changes.

Requirements

To complete this tutorial, you must have a computer running Windows 8 and Microsoft Visual Studio Express 2012 for Windows 8. For more info, see Getting started with Windows Store apps.

JJ126963.wedge(en-us,WIN.10).gifTo migrate a Windows Store app using JavaScript

  1. In Microsoft Visual Studio 2012, open your app.

  2. Update your references. In Solution Explorer, expand the References folder and delete the Microsoft.WinJS reference. The following illustration shows an example of the reference in Solution Explorer.

    Reference to delete in Visual Studio

  3. Right-click on the References folder and choose Add Reference.

  4. From the list of SDKs, select Windows Library for JavaScript 1.0, as shown in the following illustration.

    Important  The list of SDKs in the Reference Manager dialog box may vary. Make sure you select only one version of the Windows Library for JavaScript 1.0 SDK.

    Reference to add, to Windows Library for JavScript, in Visual Studio

  5. Click OK.

  6. Search your entire solution for "//Microsoft.WinJS.1.0.RC" and replace it with "//Microsoft.WinJS.1.0".

  7. Select Build > Build Solution to build your application.

Your application should build and it may launch. Review the Output window and Error List window for error messages and warnings. If you encounter errors or other issues while testing your application, review the app compatibility migration document for changes you must make to your application. If you’re unable to resolve errors occurring in your application during launch, visit the Building Windows Store apps with HTML 5/JavaScript forum on MSDN to seek assistance.

Next Steps

Once you’ve updated your app to work with the Windows 8, you may want to consider packaging your application and deploying it to the Windows Store. For more info, see Packaging your app using Visual Studio 2012.

 

 

Build date: 11/27/2012