Visual Studio 2012中的TypeScript无法编译 [英] TypeScript in Visual Studio 2012 not compiling
问题描述
我已经在Visual Studio 2012安装中安装了 TypeScript (v0.9.1.1),但是在构建期间无法使其编译我的.ts
文件(请参见下面的屏幕截图).
I have installed TypeScript (v0.9.1.1) on my Visual Studio 2012 installation but I cannot make it compile my .ts
files during build (see screenshots below).
我已经尝试过这里发布的许多不同的解决方案,但是没有一个对我有用.
I have already tried a lot of different solutions posted here but none of them worked for me.
请注意,我可以创建TypeScript项目,问题是Visual Studio无法编译/创建.js
文件.
Please note that I can create a TypeScript project, the problem is that Visual Studio is not compiling/creating the .js
file.
推荐答案
尝试在您的打字稿文件中引入错误并构建项目.它会显示错误窗格吗?
Try to introduce error in your typescript file and make a build of the project. Does it show up error pane?
此外,js文件也不是解决方案的一部分.您是否在磁盘上寻找它们?
Also the js files are not part of the solution. Do you look for them on disk ?
还要检查您的项目文件中是否包含以下条目.沿线少得多:
Also check that your project file has following entries in it. Along the lines more less:
<ItemGroup>
<TypeScriptCompile Include="app.ts" />
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<TypeScriptTarget>ES3</TypeScriptTarget>
<TypeScriptRemoveComments>false</TypeScriptRemoveComments>
<TypeScriptSourceMap>true</TypeScriptSourceMap>
<TypeScriptModuleKind>AMD</TypeScriptModuleKind>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<TypeScriptTarget>ES3</TypeScriptTarget>
<TypeScriptRemoveComments>true</TypeScriptRemoveComments>
<TypeScriptSourceMap>false</TypeScriptSourceMap>
<TypeScriptModuleKind>AMD</TypeScriptModuleKind>
</PropertyGroup>
<Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" />
这篇关于Visual Studio 2012中的TypeScript无法编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!