Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS 2019: how to disable warning 'Please install the 'Microsoft.TypeScript.MSBuild' NuGet package to enable TypeScript compilation in your project.'

How to disable warning 'Please install the 'Microsoft.TypeScript.MSBuild' NuGet package to enable TypeScript compilation in your project.'?

I do not need TS compilation with MSBuild - I do it with custom tools (building webpack bundle, manaually or with devserver).

enter image description here

After changing build action to "Content" warning still exists (details: was "none", this is the only one ts file in the project, solution restart doesn't help; but there are other TS files in other projects and may be they "hooked" somehow the MSBuild warning for all projects with ts files)

enter image description here

like image 943
Roman Pokrovskij Avatar asked Nov 07 '22 06:11

Roman Pokrovskij


1 Answers

It looks like this might be fixed in VS2022, but if you're still on VS2019 the following worked for me:

<PropertyGroup>
    <TypeScriptToolsVersion>4.2</TypeScriptToolsVersion>
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>

You'd manually add this to your .csproj file. I had to close and re-open VS afterwards too, but I don't get the error anymore. It also wanted to install TS version 4.2 but it doesn't seem to be compiling with it. Still not a great solution, but it's probably all we've got until Microsoft fixes it:

https://developercommunity.visualstudio.com/t/permanent-warning-please-install-the-microsofttype/1555740

like image 167
Drew Delano Avatar answered Nov 15 '22 06:11

Drew Delano