Typescript调试在Visual Studio 2017中不起作用 [英] Typescript debugging not working in Visual Studio 2017

查看:146
本文介绍了Typescript调试在Visual Studio 2017中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将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:

该断点当前不会被命中.此代码位置尚未加载任何代码.

The breakpoint will not currently be hit. No code has been loaded for this code location.

我尝试使用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文件.项目属性被禁用.

One or more tsconfig.json files detected. Project properties are disabled.

我仅添加了一个 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中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆