I have installed VS2017 and trying out the new stuff they added. One of the nice things is chrome JS debugging but I can't seem to hit a break point.
I created a new .net core website (.net core 1.1) and add the following function into the site.js file
function test() {
var a = "message";
console.log(a); };
I then add a break point on the line "var = a..."
run the website - it opens a new chrome window and attaches to the process like it should. I then press F12 and call test() but no break point is hit it just outputs to the console.
One thing that is also in the console window is the following message -
Browser Link: Failed to invoke return value callback: TypeError: Cannot read property 'files' of null
however i also get this message when trying it out in IE11 and it does hit the break point in IE
I have updated my chrome to the latest version - 57.0.2987.98 I am running windows 10 pro (fully up to date)
Any ideas what it might be?
I have tried on the following computers -
All 3 failed to hit the break point
Whats odd is someone else at work is able to make it work without an issue.
To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint.
What makes JavaScript great is also what makes it frustrating to debug. Its asynchronous nature makes it easy to manipulate the DOM in response to user events, but it also makes it difficult to locate problems.
Setting BreakpointsIn the debugger window, you can set breakpoints in the JavaScript code. At each breakpoint, JavaScript will stop executing, and let you examine JavaScript values. After examining values, you can resume the execution of code (typically with a play button).
As soon as you hit F12 in chrome, which opens the Chrome Dev Tools, it kills the client-side debugging session.
See: https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/
Perhaps try executing automatically... e.g... (untested)
(function test() {
...
})();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With