-1

I cannot insert breakpoints into JavaScript files in visual studio 2017. Anyone else having this issue and has anyone found a solution?

edit: The other questions were related to breakpoints not being HIT. I can't even insert breakpoints into JS to begin with. The option is not in the context menu in Visual Studio.

edit 2: Even if I create a brand new JS file (since this project was created in VS2015) I still can't insert a breakpoint. The option just isn't listed in the context menu.

user609926
  • 801
  • 2
  • 12
  • 25
  • 2
    Possible duplicate of [Visual Studio Javascript BreakPoint](http://stackoverflow.com/questions/23504160/visual-studio-javascript-breakpoint) – Liam Mar 08 '17 at 15:17
  • Possible duplicate of [Javascript breakpoints in Visual Studio 2017](http://stackoverflow.com/questions/42669163/javascript-breakpoints-in-visual-studio-2017) – Tore Østergaard Mar 08 '17 at 15:21
  • The other questions were related to breakpoints not being HIT. I can't even insert breakpoints into JS to begin with. The option is not in the context menu in Visual Studio. – user609926 Mar 08 '17 at 15:31
  • is your js is a `.cshtml` or `.js` file? – jdmdevdotnet Mar 08 '17 at 16:01
  • it's a .js file – user609926 Mar 08 '17 at 16:09
  • @user609926, Which VS2017 version did you use? How did you create this JS project? It would be better if you could share us the detailed steps, if possible, please also attach a screen shot about where you set the breakpoint? – Jack Zhai Mar 09 '17 at 02:20
  • I used VS2015 Enterprise to create the project and I'm opening it in VS2017 Enterprise.It works fine in all other versions of VS (2013,2015) and I can set breakpoints with no issue. When I right-click inside the JS file the context menu does not even have a breakpoint option. – user609926 Mar 09 '17 at 16:55
  • 1
    @user609926 I think some of those context menu items were removed ("cleaned up") in VS2017. What if you hit F9 or click in the editor margin? – Jimmy Mar 09 '17 at 22:07

1 Answers1

2

I test it using a simple JavaScript app in VS2015 and VS2017 Enterprise version.

It really has this menu item in VS2015, but not in VS2017:

VS2015: enter image description here

VS2017: enter image description here

One workaround is that just as Jimmy's suggestion, use the F9 or add it in A with mouse in above screen shot.

Other community members also submitted this feedback to the product team here:

https://developercommunity.visualstudio.com/content/problem/25474/right-click-add-breakpoint-option-not-in-list.html

Jack Zhai
  • 6,230
  • 1
  • 12
  • 20