问题描述
我将Visual Studio 2017版本15.5.7用于我的.NET Web API项目,并将Syncfusion的角度控件与用于SystemUI的UI一起使用.问题是,我根本无法调试打字稿.我可以放置一个断点,它看起来像正常的常规断点,直到我点击debug为止,然后它变得不可用并显示以下消息:
I'm using Visual Studio 2017 version 15.5.7 for my .NET web API project and I'm using Syncfusion's angular controls with systemJS for UI. Problem is, that I cannot debug typescript at all. I can place a breakpoint and it appears like normal regular breakepoint until i hit debug, then it becomes unavailable with message:
我尝试使用Chrome,Firefox,Edge和IE进行调试,但无济于事. .map 文件是在构建时生成的,我可以在Chrome开发工具中调试转译的javascript文件.另外,我应该指出,我无法在Chrome中导航到我的打字稿文件.刚生成的javascript文件.
I tried debugging with Chrome, Firefox, Edge and IE, but to no avail. .map files are generated on build and I can debug transpiled javascript files in Chrome dev tools. Also, I should mention that I cannot navigate to my typescript files in Chrome. Just generated javascript files.
更新:
我还应该提到,Web项目 Properties-> TypeScript Build 中的所有选项均被禁用,并显示一条消息:
I should also mention that all of the options in web project Properties -> TypeScript Build are disabled and there's a message:
我仅添加了一个 tsconfig.json 文件. VS是否使用一些内部的?这可能是个问题吗?另外,我的node_modules文件夹中还有更多的 tsconfig.json 文件.
I have added only one tsconfig.json file. Is VS using some internal one? Could this be a problem? Also there are some more tsconfig.json files in my node_modules folder.
推荐答案
最简单的方法是内联映射,这样即使打包也能正常工作.在tsconfig中尝试以下设置:
Easiest thing to do is inline the mapping, so that even packing works. try the following settings in your tsconfig:
//"sourceMap": true,
"inlineSourceMap": true,
"inlineSources": true,
这篇关于Typescript调试在Visual Studio 2017中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!