Updating TypeScript in Visual Studio 2017
In Visual Studio 2017, TypeScript updates are applied slightly differently than in Visual Studio 2015, however you can now have multiple TypeScript versions installed and choose specific versions for each of your projects. In this document, we will walk through how to manage your TypeScript version in Visual Studio 2017.
You will need Visual Studio 2017 version 15.2 or later in order to change your TypeScript version. Depending on which version you have, there are slightly different instructions for managing your TypeScript versions. That said, using the latest available version of Visual Studio will provide the best experience.
Setting TypeScript versions in Visual Studio 2017 version 15.3
In Visual Studio 2017 version 15.3 and later, the TypeScript version used is bound to individual projects.
- Right click on the project node in Solution Explorer
- Click Properties
- Go to the TypeScript Build tab
- Change TypeScript version to the desired version or "use latest available" to always default to the newest version installed
When setting a TypeScript version on a project, the project becomes fixed on that version. Even if a new TypeScript version becomes available through a Visual Studio update or a manual SDK download, the project will still use the version it is fixed to. To stay on the latest version, we encourage you to set your projects to "use latest available" as described in step 4 above.
Note! If multiple projects are loaded with different TypeScript versions set in the properties page, the latest TypeScript version of all versions specified will take precedence.
Setting TypeScript versions in Visual Studio 2017 version 15.2
To change TypeScript versions, change the following setting:
- Change Use TypeScript version to your desired version
(Figure 1) TypeScript Version Selection
Don't see the version you're looking for?
Make sure you have downloaded the correct SDK version from the download center and restarted Visual Studio.
To change the TypeScript version used for building a project, set the MSBuild property
<TypeScriptToolsVersions> in the project file. For more information on MSBuild properties, see the TypeScript Handbook.
In Visual Studio 2017 version 15.2 you are limited to setting a global TypeScript version. This means that if you have two projects that use different TypeScript compiler versions, you will have to manually toggle the setting each time you switch projects. This is not ideal, so if possible, upgrade to Visual Studio 2017 15.3 and follow the instructions below.