0
votes

Question

Whether Visual Studio 2015 support building targets both for windows phone 8.1 and windows phone 10?

Description

I have a project which needs support both Windows Phone 10 and Windows phone 8.1, I initially created a windows universal project (library) for Windows Phone 10, after finishing my program, I need build for Windows Phone 8.1, but I found the project cannot be built for Windows Phone 8.1 via project Property -> General -> Target Platform as it is disabled.

More details,

I have installed windows sdk10, and sdk8.1.
The project is built with VC++/Windows/Universal/Runtime Component Template

2
Do you have the "Windows Phone 8.1 Tools" options installed in Visual Studio? You must explicitly select them during Setup, if not you need to add them by using the "Programs and Features" control panel. Installing the WP8.1 SDK is not enough to enable Visual Studio support.Dai
@Dai, thanks for your suggestion. I just tried to repair my VS2015, and ensure windows 8.1 and windows phone 8.0/8.1 Tools get checked and restart computer. It doesn't work for me. I still cannot build for Windows Phone 8.1.xxx

2 Answers

2
votes

You probably selected wrong project type in Visual Studio Wizard - Windows Universal Platform introduced in Windows 10 is not backward compatible, so you won't be able to retarget it to Win8.1 Windows 10 Universal Class Library

In order to support both Windows 8.1 and Win10 Universal you need to create a project for Universal Windows 8.1: Windows 8.1 Universal Class Library With it you will be able to support both Windows 8.1 and Windows 10 Universal

0
votes

If you need to support Windows 10 and Windows Phone 8.1 as well you can create a project for each and then share code via a PCL or Shared Project. The majority of your code should be able to be shared in order to limit code redundancy. Certainly, there will be some pieces that won't carry over, and these pieces would go in their specific project folders instead of shared.