1

I'm trying to run this ASP.NET project in VS 2019. We used to run it in VS 2015 but VS 2015 is not an option anymore as we are going to get licenses for VS 2019 only.

Look at this weird error:

VS Typescript Error

As you can see, in my project properties, TypeScript version 2.0 (2.0.6 specifically) is chosen from the NuGet package. But then, I get the warning that you can see down there, that VS is still using TypeScript 4.1. The result of these is a bunch of errors in my TypeScript files when I build the application. Also, in the Output window, it says that TypeScript 4.1 intellisense is been used.

I tried installing Typescript 2.0.6 globally via NPM as suggested here. Also, I tried to do what's suggested in yet another thread, here, but there no Typescript 2.0.6 SDK for VS 2017 in the link provided. I have, however, downloaded Typecript 2.0.6 for VS 2015, and I have it in my list of Typescript SDK in Program Files, but it wont get picked up by Visual Studio.

So, how in the world I get Visual Studio 2019 to work with TypeScript 2.0, including intellisense? How do I make it to recognize the right TypeScript version?

Thank you!

Ken White
  • 123,280
  • 14
  • 225
  • 444
SamyCode
  • 928
  • 3
  • 14
  • 33
  • Is using TypeScript 4.1 an option? At some time you will have to update, and there is likely to be less pain upgrading from 2 to 4.1 than from 2 to 99.99. You will have to search for breaking changes from 2 to 3.1 (or similar), but they might not affect you. – Andrew Morton Mar 13 '21 at 23:17
  • @AndrewMorton upgrading is not my decision, hence, I cannot upgrade myself. – SamyCode Mar 14 '21 at 03:29
  • According to [JavaScript and TypeScript in Visual Studio 2019](https://learn.microsoft.com/en-us/visualstudio/javascript/javascript-in-vs-2019?view=vs-2019), it seems that you will have to use at least TS 2.1. The MS thread [installing typescript 3.3 disables version 2.2 compilation](https://developercommunity.visualstudio.com/t/installing-typescript-33-disables-version-22-compi/528893) might contain useful links. – Andrew Morton Mar 18 '21 at 10:41
  • 1
    @AndrewMorton thank you so much for your help. We have decided to upgrade to the latest TS version. – SamyCode Mar 19 '21 at 02:25

0 Answers0