TypeScript 1.8 for Visual Studio 2017

typescriptvisual-studio-2017

I have a project created in Visual Studio 2015 which using TypeScript 1.8. After installing Visual Studio 2017, I tried to open the old project in the new IDE.
If I check properties of the project, I get this:

TypeScript version: 1.8 (unavailable).

enter image description here

However, I can see that this version is already under C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8.

I don't want to use a newer version because I don't want to change the code right now.

Does Visual Studio 2017 support TypeScript 1.8?

How can I make this version available to VS 2017?

Best Answer

I was able to solve this problem by installing the corresponding version nuget package of Microsoft.TypeScript.MsBuild. So for us it is version 1.8.11.

The TypesScript version still says 'unavailable' and there are still some intellisense errors shown. However, the project builds and runs properly.

Alternatively, if a user wants a higher version. Microsoft makes some version tooling available as a visual studio extension (e.g. version 2.7 https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.typescript-27-vs2017)

UPDATE: I have figured out the intellisense errors. You can go to Tools > Extensions and Updates and install typescript tools for a version greater than 2.6. Then you can you the //@ts-ignore suppression comments described here

Side note: I did not have any luck resolving the intellisense errors. I tried

  • Installing the Microsoft.TypeScript.Compiler nuget package for 1.8
  • Installing various versions of the TSLint nuget package
  • Installing the TSLint.MSBuild nuget package
  • Installing the TypeScript Analyzer (a static analysis extension for TSLint)