Migrating 8.1 Apps to Windows 10

If you have a Windows 8.1 Store App and you want to move it to Windows 10 UAP then you can easily do that with some minor changes since a Windows 10 UAP is a superset of WinRT. You need to do some UI work to make your app look great on small devices. Underline code is nearly compatible with Windows 10 UAP. If you have a Universal WinRT app then you need to do some more work on adaptivity since only a single binary is created with a Windows 10 UAP that will run across all the devices. You don't need to rewrite all the code but you need to just reorganize things.Let us see how this can be done. This article is  based on Jerry Nixon and Andy's Microsoft Virtual Academy Course.

Windows Phone Silverlight Apps

If you want to migrate a Silverlight app to Windows 10 UAP then you need to rewrite code to target the UAP APIs, hopefully you have used good design patterns and abstracted your logic and then you don't need to do much work. Silverlight 7.x/8.x apps need reimplementation though these apps still run on Windows 10 Mobile devices.

Migrating a Windows 8.1 or Windows Phone 8.1 project

There is no tool in Visual Studio 15 to upgrade the project yet, but there is a PowerShell script to do most of the work. You can get the tool from:

https://github.com/Win10DevGuideMVA/ProjectUpgradeUtility

After you download the PowerShell file, unzip it and place the unzipped folder in the C Drive.

Let's Start

  1. Open your Win/WP 8.1 project and right-click the project and open it in the file explorer.
  2. Click File > Open command prompt > Open command prompt.
  3. Then, write the following command.
    C:\ProjectUpgradeUtility\Run_UpgradetoUAP_PowerShell_script.bat
    And press Enter. This will convert the .csproj to UAP and will update the package.appxmanifest.

Now, you will find your project migrated to UAP.

The PowerShell utility automates most of the upgrade procedure but doesn't guarantee coverage of every scenario.

Manual project file updates

Add publisher to the Package Dependency as in the following:


Figure 1: Package Dependency

Make some edits in package.appxmanifest by adding uap: before some capabilities and Application Extensions and Protocols as shown below:


Figure 2: Adding uap

If you are migrating a Windows 8.1 App, change the tile size as shown below:



Figure 3: Migrating Windows 8.1 App

Before you run the app, you need to add some extensions to solve platform-specific issues, like phone back button. For that you need to add a reference to the Windows Mobile SDK.

Right-click References and then hit Add Reference > Universal App Platform > Extensions.

Add: Windows Desktop Extension SDK and Windows Mobile Extension SDK.



Figure 4: Windows mobile SDK

Now, run your app. You might encounter some issues in XAML like Phone Styles. Change them to a public style that could run in Windows 10 UAP.

Also Charms does not exist anymore in Windows 10 but you can replace them with in-app UI like Settings or Sharing as we used to do earlier in Windows Phone 8.1.

Additional Conversion Procedure

  1. Add a reference to the Platform Extension SDKs, if needed.
  2. Review conditional code (#if..) and convert to adaptive code where appropriate.


  3. Replace calls to deprecated APIs, if any.

  4. Replace references to #ff0000 styles in XAML.
  5. Update code that integrates with the Charms Bar.
  6. Extend your UI to create a great, adaptive UI that works across multiple device families.

References 

 

Up Next
    Ebook Download
    View all
    Learn
    View all