Вопрос

Adding TypeScript support in latest version of VS is easy - just add a TypeScript file and VS will automatically will reconfigure the project.

However when all TS files are gone it spits out this warning:

Warning: The TypeScript Compiler was given no files for compilation, so it will skip compiling.

It is possible to manually remove TypeScript support by editing the project file in notepad, but is there a GUI in VS that handles this?

Это было полезно?

Решение

I removed TypeScript by hand.

  1. Right-click on the Web-project file in the Solution Explorer and choose Unload project
  2. Right-click again on the project file, and now choose Edit {project-name}.csproj
  3. Remove all elements with the name TypeScript in it, and save the XML file
  4. Right-click the project file, and choose Reload project

Always keep a backup of the project file, as you may wreck it. Your millage may vary...

Другие советы

There isn't UI for this.

In the .csproj file commenting the entire line with Microsoft.TypeScript.targets is enough to disable the build.

Another approach is to use TypeScriptCompileBlocked tag under PropertyGroup tag of csproject file.

Yes in order to edit the csproj you need to open it in notepad or any other editor. This property is not editable through visual studio.

<PropertyGroup>
    <TypeScriptCompileBlocked>True</TypeScriptCompileBlocked>
</PropertyGroup>

This wont require you to remove any other typescript tag.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top