typescript debug/breakpoint不起作用

rla*_*ies 7 debugging typescript

几天以来,调试器不再起作用了.我尝试了几件事没有成功.

  • 打字稿0.9.1
  • VS2012
  • IE10
  • 源图,JS文件在保存TS文件时更新

在Visual Studio的断点处我得到了:' 断点当前不会被击中.没有为此文档加载任何符号 '

  • 有帮助吗?

  • IE如何加载符号?我假设它与源地图有关...

预先感谢

理查德

rla*_*ies 1

这是(我的问题的答案...在 WiredPrairie 的帮助下,...;-))

这条线

<Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" Condition="'$(BuildingInsideVisualStudio)' == 'true'" />
Run Code Online (Sandbox Code Playgroud)

在我的台词之前

 <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <TypeScriptTarget>ES5</TypeScriptTarget>
    <TypeScriptRemoveComments>true</TypeScriptRemoveComments>
    <TypeScriptSourceMap>true</TypeScriptSourceMap>
    <TypeScriptModuleKind>AMD</TypeScriptModuleKind>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <TypeScriptTarget>ES5</TypeScriptTarget>
    <TypeScriptRemoveComments>true</TypeScriptRemoveComments>
    <TypeScriptSourceMap>true</TypeScriptSourceMap>
    <TypeScriptModuleKind>AMD</TypeScriptModuleKind>
  </PropertyGroup>
Run Code Online (Sandbox Code Playgroud)

所以我把它放在我的 *.csproj 之后(多么聪明的家伙,不是吗;-))

我发现问题是因为:

  1. //# sourceMappingURL=/path/to/file.js.map在保存时(而不是编译时)在 *.js 文件末尾生成的。

  2. 构建输出说The TypeScript Compiler was given an empty configurations string, which is unusual and suspicious.

解决方案来自这篇文章:TypeScript Compiler was 鉴于一个空的配置字符串

当我尝试将项目部署到 Azure 时,问题的根本原因就出现了。js 文件没有上传/编译,所以我在 csproj 中添加了这个棘手的行,运气不好:-(

谢谢,我希望它能帮助其他人。