title: How to install TypeScript 2.2 onto Visual Studio 2017
body: <p>Some people in our team have both Visual Studio 2015 and Visual Studio 2017 installed. Others only have the latest Visual Studio 2017 (15.5). With the latter, we noticed that our TypeScript project in the IDE is generating all kinds of unexpected errors due to all kinds of lib.es2015.d.ts issues.</p>
  
  <p>Our projects use TypeScript 2.2, whereas the latest Visual Studio 2017 (15.5) comes with TypeScript 2.5.</p>
  
  <p>We discovered that the Visual Studio TypeScript SDK is installed in the following path:</p>
  
  <ul>
  <li><code>C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.2</code></li>
  <li><code>C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.5</code></li>
  </ul>
  
  <p>We noticed that 15.5 comes with a new property in the csproj property screen which allows direct mutation of the wanted TypeScript version. As the project requires 2.2 which is not installed, the dropdown states the missing 2.2 bits.</p>
  
  <p>What we have tried to fix this:</p>
  
  <ol>
  <li>Installed the TypeScript 2.2 SDK for Visual Studio 2015 (for 2017 there is no separate install). Unfortunately it looks like this package does not come with the language service <code>tsserver.js</code>. Did not work. Url: <a href="http://download.microsoft.com/download/6/D/8/6D8381B0-03C1-4BD2-AE65-30FF0A4C62DA/TS-2.2-dev14update3-20170221.2/TypeScript_Dev14Full.exe" rel="noreferrer">http://download.microsoft.com/download/6/D/8/6D8381B0-03C1-4BD2-AE65-30FF0A4C62DA/TS-2.2-dev14update3-20170221.2/TypeScript_Dev14Full.exe</a></li>
  <li>Played with the NuGet-package <code>Microsoft.TypeScript.Compiler</code> and installed 2.2.1 (no 2.2.2 available?). This didn't seem to solve anything. Not clear to us how this package really integrates into something. Even after adding the specific property <code>TypeScriptNuGetToolsVersion</code>. </li>
  <li>Played with the NuGet-package <code>Microsoft.TypeScript.MSBuild</code> and installed version 2.2.2. Unfortunately, this only influences the MSBuild process and not the editor experience. MSBuild is not relevant to us as we are using the Angular CLI for really building / watching the TypeScript source code.</li>
  <li>Copied over the 2.2 bits of one of our Visual Studio 2015 installations. This enabled the 2.2 menu option in the csproj property screen. But, we still experience clashes with lib.es2015.d.ts. What we discovered is that the SDK seems to always use the latest version, in our case 2.5. We also installed 2.6, and then it started to use 2.6.</li>
  <li>Ultimately we just removed the 2.6 folder completely and created a copy of the 2.2 folder with the name 2.6. And now it works. But this really feels like a hack!</li>
  </ol>
  
  <p>To summarize our questions:</p>
  
  <ul>
  <li>What is the best way to install TypeScript SDK 2.2 onto Visual Studio 2017 (15.5)?</li>
  <li>What is the best way to really enforce the usage of lib.es2015.d.ts from version 2.2?</li>
  </ul>