Migrating to Visual Studio 2015 or 2017

Updated: January 29, 2018

In this topic:

Introduction

Visual Studio 2015/2017 updates the existing IDE and toolset available for XDK development. Moving Xbox One development to the new tools will take advantage of all the new compiler improvements. These include new features, tighter conformance to existing C++ standards, and better linker performance.

Important Support for Visual Studio 2012 (17.1) has been fully removed as of the November 2017 XDK, so we highly recommend that you move to Visual Studio 2015 Update 3 or Visual Studio 2017.

Update process

To make use of the new toolset, you must install Visual Studio prior to installing the XDK. Visual Studio 2015 was officially released on July 20, 2015, and is supported by the July 2015 XDK or later. Visual Studio 2017 was released on March 7, 2017, and is supported by the March 2017 XDK or later. A code to unlock one copy of Visual Studio 2015 or Visual Studio 2017 Professional is available to you for every XDK development console you’ve purchased. We recommend that you install Visual Studio 2015 Update 3 or make use of Visual Studio 2017 with the latest updates (version 15.5 as of this writing).

Installing Visual Studio

When installing Visual Studio 2015, it’s important to note is that the C++ toolset is not part of a Typical install. You must select Custom and be sure to add Common Tools for Visual C++ 2015. If you have already installed Visual Studio 2015, you can modify it via Programs and Features in Control Panel. For more info, see Setup Changes in Visual Studio 2015 Affecting C++ Developers on the Visual C++ Team Blog.

The Visual Studio 2017 installer uses a new, lightweight installer, so be sure to select the following components for use with the Xbox One XDK:

You’ll probably also want to include some or all of the following:

Required to build UWP apps with either C++ or C#/JavaScript

Supports building Win32 desktop apps with C++; in particular, Xbox tools that run on the desktop PC.

Required to build Win32 desktop apps in C#; in particular, Xbox tools that run on the desktop PC.

If you have already installed Visual Studio 2017, you can modify it by running the Visual Studio Installer application on your system. For more info, see The Lightweight Visual Studio 2017 Installer on the Visual C++ Team Blog.

Visual Studio solutions and projects

Visual Studio has built-in capabilities to update existing solutions and projects originally created with earlier versions of Visual Studio. To do so, open an existing solution and walk through the update wizard.

If you don’t receive an upgrade prompt automatically, you can use the menu option Project > Retarget Solution.

Command-line build systems

If your build system does not use the Visual Studio IDE, a number of changes will be required to update to the new toolset. After you install Visual Studio and the latest XDK, make the following changes to your build system:

Note The actual commands passed to cl.exe and link.exe should remain largely the same when updating from the v110 toolset to the v140/v141 toolset. Consider reviewing the changes to the compiler for a list of new compiler switches, and reviewing changes to the default switches used for Visual Studio-based build solutions.

Note When you use the Xbox One XDK (March 2017), Xbox One XDK (June 2017), or Xbox One XDK (November 2017), the Xbox One XDK uses the VS2015 paths for Visual Studio 2017 builds. The Xbox One XDK (February 2018) or later includes a VS2017 specific directory to use instead. Visual Studio 2015 Update 3 and Visual Studio 2017 code is binary compatible.

Code fixup

The new compiler introduces a number of updates to improve compliance with the C99 and C++11. It also introduces new C++14 features and C++17 features. Existing projects built with the v110 toolset will most likely emit a number of compiler warnings and errors with the new compiler. Following are a few resources for reference to help you get started with updating code bases:

If you’re already on Visual Studio 2015, be sure to move to Update 3 when possible. If you are moving to Visual Studio 2017 from Visual Studio 2015 Update 3, the migration should be reasonably trivial.

Still having trouble? Ask a question in the forums!

Summary

There are numerous benefits to migrating to the v140/v141 toolset. Unless you’re rapidly nearing a release date, it is advised to make the switch as soon as possible. In summary, the benefits include: