How do I enable the TypeScript tab of a Visual Stu

2019-05-11 15:30发布

问题:

Using Visual Studio 2015 I created a console application to self-host Owin with embedded static files. Since Visual Studio doesn't know it's a web-site project, it ignores TypeScript files. When I go to the project properties, the TypeScript tab's typically there in web projects is missing.

How do I enabled the TypeScript tab so that I can configure TypeScript and use Visual Studio 2015's built-in capabilities to compile TypeScript.

回答1:

Open the .csproj file in a text editor and add the following line

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" />

I added it after this command:

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />