Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Type Script 1.8 in Visual Studio 2017 for legacy project

I have recently installed visual studio 2017 and tried to run my project in it. It is causing TypeScript error. I think VS 2017 is using Typescript 2.1.5 but my application was writted for TypeScript 1.8.

How can I make VS 17 use TypeScript 1.8. I already have VS 2015 and the solution is working fine on it. But I really want to use 2017(without making changes to code)

The odd thing is: The TypeScript version mentioned in .csproj is 1.8

<TypeScriptToolsVersion>1.8</TypeScriptToolsVersion>

But if I edit the .csproj the TypeScriptToolsVersion to something else and then back to 1.8, the solution compiles properly. However, after consecutive compiles, the TypeScript resurfaces.

like image 795
U.P Avatar asked Apr 07 '17 11:04

U.P


1 Answers

I noticed the compile errors disappeared when you "force" a downgrade of TypeScript by applying nuget package Microsoft.TypeScript.MSBuild.1.8.11.

That way the solution/project seems to use the package version instead of the built in version.

like image 188
Fredrik Claesson Avatar answered Sep 21 '22 14:09

Fredrik Claesson