4

在 VS2013 update 2 RC (Typescript 1.0 RTM) 中,我无法在我的一个项目中调试 TypeScript 文件。我已将其追溯到地图文件声明。默认情况下,我的 JS 文件包含:

//# sourceMappingURL=general.js.map

应该是正确的,地图文件与 TS 和 JS 文件位于同一文件夹中。但是它不起作用。如果我手动编辑文件,指定完整路径,它可以工作:

//# sourceMappingURL=C:/Users/myname/Documents/Visual Studio 2013/Projects/Test/JSLib/general.js.map

这让我很困惑,因为浏览器肯定不应该理解完整路径,例如在 IISExpress 网站之外?

任何人都可以建议一种让地图文件与第一个映射一起使用的方法吗?谢谢

视窗 8.1 x64, IE11

更新:通过 IISExpress 运行的应用程序使用 Windows 身份验证。如果我关闭这个地图文件加载!另外,检查我看到的输出窗口:

SourceMap http://localhost:53524/JSLib/general.js.map read failed: The remote server returned an error: (401) Unauthorized.'iexplore.exe' (Script): Loaded 'http://localhost:53524/JSLib/'.

我的 IIS Express 日志包含

2014-04-12 13:58:24 ::1 GET /JSLib/general.js.map - 53524 - ::1 - - 401 2 5 0

但我可以http://localhost:53524/JSLib/general.js.map在 IE 中正常浏览。那么是什么在调用地图文件(VS?)以及如何让它使用我的凭据?

4

1 回答 1

5

I too have been experiencing this problem. I am sorry to say that I do not know what the root of the problem is. However, I have found a workaround.

Open your project properties and go to the 'TypeScript Build' tab. In the 'Debugging' section, check the 'Specify root directory of the source maps' option and enter the value $(ProjectDir)\Scripts.

This works with Windows Authentication enabled and with the default 'sourceMappingUrl'.

于 2014-04-14T19:47:50.760 回答