How to debug javascript in visual studio

preview_player
Показать описание
Link for all dot net and sql server video tutorial playlists

Link for slides, code samples and text version of the video

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.

In this video we will discuss, How to debug JavaScript in Visual Studio

Here are the steps
1. In Visual Studio, right click on a web form and select "Browse With..." option from the context menu

2. In the "Browse With" window,
a) select "Internet Explorer"
b) Click "Set as Default" button
c) Finally click "Browse" button

3. Close the internet explorer window that opens and run the visual studio project in Debug Mode.

4. In Visual Studio, throw a break point on the JavaScript function that you want to debug.

At this point, in the internet explorer perform the action (i.e clicking on button or changing a selection in the DropDownList) that calls the JavaScript function. The JavaScript execution should stop at the breakpoint and we should be able to step over and step into code using F10 and F11 keys respectively.

At this point we should also be able to use watch, quick watch and immediate windows in visual studio.

This approach will not work in visual studio 2008, if you are using any other browser apart from Internet Explorer.
Рекомендации по теме
Комментарии
Автор

Company switches standard to Edge/Chrome. Spend 20+ minutes trying to figure out why I can't step into scripts. Hack project file and all sorts of other shenanigans. Come close to my wits end. Watch 1 minute and 43 seconds of your video, switch VS back to IE and am back in business. You are the man!!!

jasonOfTheHills
Автор

what a life saver, been trying to debug blind. Good man thanks

mikenickson
Автор

I am beginner and have watched 4 videos today and you are so good when explaining, thanks for sharing the knowledge. Very good video!

mohpaladiti
Автор

Great tutorial video and extra details that have helped me to debug my JavaScripts. THANK you!!!

henrylee
Автор

it cleared my doubts for javascript debugging..great video as always..

iqbaljournals
Автор

Hi Venkat
I wanted to thank you for this video as it enabled me to solve my F10 not working when debugging issue. I am a member of StackOverflow and was seeking answers for this problem there and could not find it. When I remembered this tutorial and I went back over it and tried it the problem was solved. I put it forward on StackOverflow with reference to this tutorial as a possible solution for others having F10 issues.

raphaelbernard
Автор

This wasn't work for me in Visual Studio 2017 until I changed a VS option:

In VS click Tools, Options, debugging, general, check - Enable JavaScript debugging for ASP.NET (Chrome, Edge and IE)

Hope this help the next person.

CodingSquid
Автор

Is this only possible in VS, or can you do this in some browser like chrome, or with a firefox extension like FireBug?

NoahNobody
Автор

Sir please, do an AngularJs, Tutorial

libertan
Автор

Man, you just answered a question that was bothering me all night. I'm working on a thick client application with lots of javascript/jquery and heavy json and webservice calls. At work I was able to set break points in basic javascript code with no problem, but at home I could never get it to work. VS would give some useless error about the breakpoint not being hit because the code was different or something related to a context (no mention of browser). It was very frustrating as I needed to see the data in my JSON objects. Now it makes perfect sense!  Why doesn't Microsoft tell you this simple fact when you set a breakpoint in your javascript and the default browser is not IE! What a pain. 

Thanks for saving me more needless frustration and time wasting!

As a follow up, is there a way to debug JS in Chrome (my favorite browser)  ?

mattmarkus
Автор

Why does all your videos play in the lowest quality by default? I can't change the settings from my side.

dgloria
Автор

This tutorial is purely for IE and should probably say in the description. Unless it is a ploy to make people watch? IMHO because of how bad IE is/has been, people will be relunctant to use it for debugging. MS really lost the chance to dominate the front-end market with IE by ignoring features other browsers were implementing. Now they are reaping the just rewards. I hadn't used IE for 2 years before today!

TheOceanLoader
Автор

Hi venkat,
How to debug javascript in google chrome and firefox it wont support breakpoint, and what is debugger keyword avialable in javascript 

chandrashekarb
Автор

Now IE is discontinued..which browser is set as default?

arnabghosh
Автор

i have still a doubt that what is the work of javascript for site

ImranKhan-uzrh
Автор

Yes, unfortunately Microsoft has not yet figured out how to allow us to debug Javascript in an MVC 5 application. Setting a basic, simple breakpoint DOES NOT WORK. How can a company claim to support Javascript, when it can't do basic things like setting a breakpoint??? I don't want to have to type some debugger statement into my code. We might as well be living in 1981, when we debugged everything using "Pring" statements in BASIC. How is this any

tpowell
Автор

hello bro this is not working plz help,

princetyagi
Автор

Hi!, How could I call a javascript function from code behing on Web
Browser control click in Windows Forms VB.net? I am using an awesomium
Web Browser Control in my Form. Could you give me some guidance about
it, please? I can't find any information about it in the internet....

maribelmed
Автор

Your videos are really awesome. I wish you were a woman I would ask you to marry me.

chandrunagrani
Автор

I thought you would talk about How to debug javascript on visual studio with google chrome as browser...internet explorer debuggging is default behavior... you started it great but disappoint me later...

MahendranathVanne