Visual Studio 2015 Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

Enabling UWP app development on Windows 10

To get started with UWP app development, you must first enable app development for your Windows 10 device. If you are familiar with app development on Windows 8.X, you will recall the need to possess a developer license that had to be periodically renewed with Microsoft. That is no longer the case for UWP apps—once you have enabled development support, you are good to go. Let's look at how to do that.

Getting ready

Have Windows 10 installed on your computer. VS Express for Windows 10 will install all the necessary tools for you by default, so if you are running a different version of VS2015, make sure you have opted to install the Universal Windows App Development Tools for your particular installation of VS2015. You can rerun the VS2015 installer, if needed, to install them.

The following screenshot shows the items that should be installed. Note that specific version numbers may change between the time of writing this and when you read it, but that is okay. You will want the latest of the following:

How to do it…

Now that we have successfully installed a version of VS2015 suitable for UWP development, we will enable Developer Mode on our computer running Windows 10. If you are using VS Express for Windows 10, you will be prompted to do this when you start Visual Studio. If running Community Edition or one of the premium editions, you will be prompted to do so when you begin a UWP project. The following screenshot provides an example of this prompt:

To enable Developer mode, you will actually need to make some changes in your system settings (formerly known as the Control Panel). You can get there by clicking the settings for developers link shown in the preceding screenshot, or look for Update & Security in your Windows 10 settings page, and then click on For developers. Once there, you will want to select Developer mode, as shown in the following screenshot:

For security purposes, Windows 10 will present a confirmation box when you make the selection, so confirm your intent and proceed.

How it works…

UWP app development simply requires the host device to be in Developer mode. This greatly simplifies a process that was needlessly convoluted when developing apps for Windows 8.X, whereby a specific Developer License had to be obtained and renewed. Now a single set-and-forget setting change can be made, and your system is ready for UWP app development. Besides your day-to-day development, this makes testing your app easier, as you can easily enable this setting on test machines (including tablets, virtual machines, and others) without having to get (and renew) developer licenses for those environments too.

There's more…

When you publish your UWP app to the Windows Store, a user can download and use it without any system modification. Distributing your UWP app outside of the Windows Store is possible via the method described in this recipe or via sideloading.

Tip

In some Windows upgrade scenarios, upgrading a developer machine from Windows 8.1 to Windows 10 can result in a situation where the now-unnecessary Windows Developer License remains. To ensure your Windows 10 development is hassle free, open a PowerShell command prompt with Administrator privileges, and run the following command:

unregister-windowsdeveloperlicense