Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2013 Javascript Debugging

Does any one know how to enable in page JavaScript script tag debugging?

In vs2012 i can go to the page in visual studio which is running in the debugger and create a break point however in vs2013 i get "A breakpoint could not be inserted at this location"?

Thanks

like image 873
Jonathan D Avatar asked Oct 31 '13 12:10

Jonathan D


People also ask

How do I debug JavaScript in Cshtml?

JavaScript inside a Razor view (a cshtml file) cannot be debugged from Visual Studio. To debug your JavaScript, move it to a separate . js file and link to that file from your Razor view. This way, breakpoints set in the JavaScript will be hit and you can debug from Visual Studio.

How do I debug JavaScript in vs2015?

In the toolbar, click the button to get the dropdown of browsers to debug with and then click "Browse with...". Click "Add...", set Program to wherever Chrome is on your machine and set Arguments to --remote-debugging-port=9222 . You can also set Incognito as I have to ignore cache but it is not required. Important!


1 Answers

try to keep your scripts in separate files and put the breakpoints in that files. I had the same problem but when I moved java scripts from my views to script files I was able to debug. It may not be a solution but at least you should be able to work.

like image 60
Andy Avatar answered Oct 14 '22 06:10

Andy