Thomas James
Thomas James

Reputation: 407

Visual Studio 2017 Chrome JavaScript Debuging - Not hitting break point

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)

site.js code

Chrome Console Output

Any ideas what it might be?

Update

I have tried on the following computers -

  1. My home PC (Windows 10 Pro)- has VS2015 and VS2017 on it
  2. Work PC (Windows 8.1 Pro) - also has VS2015 and VS2017 on it
  3. With in my work PC - (new build) HyperV VM (Windows 8.1 Pro) - just VS 2017 on it

All 3 failed to hit the break point

Whats odd is someone else at work is able to make it work without an issue.

Upvotes: 6

Views: 6979

Answers (2)

OrdinaryOrange
OrdinaryOrange

Reputation: 2712

Prior to V 63 of chrome, it would not allow multiple remote debugging sessions. Opening the chrome debug tools would take over the only available connection, and terminate the one held by VS.

However this has now been rectified by the chromimum team !

Unfortunately there is still a problem with the Visual Studio debugging session getting terminated when F12 is hit.

There is a workaround, and hopefully the VS team will correct the underlying issue. See My post on MSDN for full details

Upvotes: 0

Mark van Proctor
Mark van Proctor

Reputation: 743

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() {
   ...
})();

Upvotes: 5

Related Questions