How to change TypeScriptToolsVersion from 3.7 to 3.8

Viewed 4718

I am developing a project in VS2019. When I compile it, I receive the following warning:

warning : Your project specifies TypeScriptToolsVersion 3.7, but a matching compiler was not found. The latest available TypeScript compiler will be used (3.8). To remove this warning, install the TypeScript 3.7 SDK or update the value of TypeScriptToolsVersion.

I was trying to find where TypeScript version is specified but I did not find it. Microsoft.TypeScript.targets does not define it, however, if it would, I think I could change the value by not modifying that file directly.

Where can I fix that?

Jaime

3 Answers

Look for TypeScriptToolsVersion tags in your csproj files and update to required version.

Go to your project Properties -> "TypeScript build" tab and in the field: "TypeScript version" either choose specific version or select "Use latest available"

enter image description here

@BogdanRB answer above only displayed "Use latest available" and "4.2" for me. I did some research and apparently "4.2" is the SDK version installed together with Visual Studio 2019 (which I couldn't remove since it's required for lots of other VS components).

I was working on a legacy project that uses TypeScript "3.1.1", the version specified in package.json installed via npm. In order to line up the editor's IntelliSense and the compilation, and avoid using unsupported TS syntax, I've opened my ASP.NET Core MVC .csproj file and removed the following line:

<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>

Now Visual Studio's IntelliSense is compatible with the one specified in the npm package. It even works inside *.vue templates, in case you're using Vue with TypeScript.

Related