TypeScript: Visual studio intellisense is not using the specified TS version.

TypeScript Version: 2.1 - 2.6

We work on multiple solutions with different Typescript versions. This means I have Typescript 2.1 and 2.6.1 installed in Visual Studio 2017. For the project that is using TS 2.1, we selected the correct Typescript version in the project properties. In the msbuild output, i can see it’s using tsc.exe in the Typescript 2.1 directory and that the build succeeded. But We still get TS errors for the Intellisense.

When I set the project to use Typescript 2.6, I get the same errors in both msbuild en Intellisense. So I think Intellisense is ignoring the selected Typescript version and is always using the latest version installed.

Updating the project to use TS 2.6 is not a solution since it is an older angular 1.3 project. Most of the errors come from the angular 1.3 *.d.ts files.

Expected behavior: Intellisense uses the version of typescript specified in the project properties. (same as msbuild)

Actual behavior: Msbuild is using the correct Typescript version specified in the project properties. Intellisense on the other hand is using the latest Typescript version installed.

I’m not sure if this is a Visual Studio issue or Typescript issue, but they advised me to post this here.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 31 (11 by maintainers)

Most upvoted comments

Thanks for very valuable input. I was experiencing similar issue and it has helped me to solve it without unloading the project. Maybe the solution helps somebody else:

  • Identify the projects affecting the Intellisense version by following the guide from @minestarks
  • Configure these projects to compile typescript (I have common MSBuild target, which I use for libraries) in required version
  • Configure Typescript engine to not build any outputs: <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>

This solution worked for me on the 15.5.2. Since I am quite unexperienced when it comes to TS internals (especially integration with Visual Studio), please drop a comment if you find anything wrong with this workaround.

Anyway, I think it would be nice to have some property in the .csproj file, which would allow us to mark the file as not Typescript relevant (so it will not be used to determine typescript version for Intellisense purposes).