Debugging With Chrome in Visual Studio 2017

In this post we are going to explorer how to debug client side script in Visual Studio 2017 using Chrome and how to disable it.

Debugging client side script using IDE is a most exciting feature in Visual Studio 2017, recently I have updated my IDE and after creating a new ASP.Net Core application I have noticed below splash screen before starting the application, soon later I realize about the new exciting feature and then I decided to explain it to others.

This screen is nothing but the information about debugging script using Visual Studio.

Let’s break those points:

Set breakpoint in JavaScript/TypeScript in Visual Studio

Here we go, let’s write some js code in Site.js file

// Write your Javascript code.
function sum() {
    var value = (1 + 2);
    console.log(value);
};

Set breakpoint like below screen using IDE in Js file.

It hit the breakpoint while reload the page, in IE this will hit on initial page loading. Use (F10/F11) to continue debug.

Automatically break on script errors:

Let’s create an error, update the previous function in js file, our below code snippet will cause a range error at runtime.

function sum() {
    var value = (1 + 2);
    console.log(value);

    var num = 1;
    num.toPrecision(500);
};

Hit F5 using IE, like below screen it’ll automatically hit the break point while script error occur.

  

 Opening developer tools in Chrome stops the script debugging session:

  

As you can see while I was switching to Developer tools in Google Chrome at debug session the application stops debugging.

 

Disable Debugging: Go to Tools -> Options -> Debugging -> General and

Uncheck/Clear the setting Enable JavaScript Debugging for ASP.NET (Chrome and IE).

Get more on it:

Hope this will help 🙂

Author:

Since March 2011, have 8+ years of professional experience on software development, currently working as Senior Software Engineer at s3 Innovate Pte Ltd.

One thought on “Debugging With Chrome in Visual Studio 2017”

  • Hello,I log on to your new stuff named “Debugging With Chrome in Visual Studio 2017 – SHASHANGKA SHEKHAR’S BLOG” daily.Your humoristic style is awesome, keep it up! And you can look our website about مهرجانات.

Leave a Reply