-1

I have solution with WebApi with angular client. Earlier I had an ability to set breakpoint in my typescript files and debug them with Chrome. During a long time I didn't work with this solution, but now I need. And when I set breakpoints I have warning message: "The breakpoint will not currently be hit. Breakpoint set but not yet bound".

I have updated Visual Studio 2017 to the latest version (15.9.17) but this didn't help.

Any idea how to debug type script in Visual Studio?

Dimitry
  • 217
  • 4
  • 15
  • Did you set a breakpoint in VS2017 or in Chrome? Please try to set the current project as startup project, choose `debug mode` and rebuild your project.You can check if this [official document](https://learn.microsoft.com/en-us/visualstudio/javascript/debug-nodejs?view=vs-2017) can work. More information you can refer to [this](https://stackoverflow.com/questions/42669163/javascript-breakpoints-in-visual-studio-2017). – Pod Mo Nov 25 '19 at 11:43
  • I set breakpoints in VS2017 and I try all I founded in the internet to force it work but it still doesn't work. When I set breakpoints in Chrome then I can catch it in Chrome and in VS, but not in source ts-file bun in file generated by VS, in Script Document section of the solution, but it isn't comfortable to debug there – Dimitry Nov 29 '19 at 21:07

2 Answers2

0

Try this.

In VS code, go to debug -> start debugging -> add configuration

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Node Inspector",
        "type": "node",
        "request": "launch",
        "args": ["${workspaceRoot}/src/index.ts"],
        "runtimeArgs": ["-r", "ts-node/register"],
        "cwd": "${workspaceRoot}",
        "protocol": "inspector",
        "internalConsoleOptions": "openOnSessionStart",
        "env": {
            "TS_NODE_IGNORE": "false"
        }
    }
]

}

and run it.

Got this from https://gist.github.com/cecilemuller/2963155d0f249c1544289b78a1cdd695

Hope it helps.

  • I can debug application in VS Code, but angular app exists as a part of WebApi project, mounted into it. And I was interested in debugging with Visual Studio 2017 not with Visual Studio Code – Dimitry Nov 29 '19 at 21:12
0

I decided to split WebApi project and ClientApp into two different repositories and continue developing client side in more suitable and comfortable environment, I chose WebStorm

Dimitry
  • 217
  • 4
  • 15
  • Hi friend, thanks for your sharing and please mark your reply as answer and that will help other community members who easier search this useful information, it just a reminder :) – LoLance Dec 02 '19 at 05:48