How to run a JS debug session using MS Visual Studio 2022? - javascript

Could someone reply with the exact steps to rub a debug session using MS Visual Studio, for a Html/Javascript WebPage, using the Chrome Browser?
I am really confused between LiveServer, Launch Chrome, and the Run and Debug control on the left side of the IDE. I seem to get it to work at times, but wind up with multiple Chrome Browsers displayed. Really would like to know the correct process is.
Thanks so much.

Related

Debugger is not picking up the changes from visual studio

I am trying to debug a project using the Chrome browser and even though I commented out some statements in visual studio, still the browser is showing the statements.
The lines commented:
Debugger window
I tried to clear the cache in the chrome browser and tried to build and debug again but the browser is not picking up the changes. Can anyone please help me what could be the issue.

Breakpoints not hit in javascript files in Visual Studio

I am experiencing some weird behaviors when debugging my MVC Web Application. Some days I experience these issues, but other days everything works fine.
The breakpoints in my javascript files are not getting hit. I get the dreaded "The breakpoint will not currently be hit. No symbols have been loaded for this document." error.
The debugger will detach from the process without me clicking the Stop Debugging button.
I have tried everything I can think of including:
Refreshing the page in IE to force the browser to get the latest version of the javascript files.
Clean / Rebuild the application in Visual Studio
Close / Reopen Visual Studio
Delete all files from bin and obj folders and rebuild
Cleaned up all old sites from my IIS Express applicationhost.config file
Installed VS2013 Update 4
Deleted / Reinstalled VS2013
Removed / Added IE11
Installed VS2015. Same behavior as VS2013
Deleted all local project files and performed a "Get Latest" from TFS
I can manually attach the debugger to an iexplore process and then I'm able to debug that specific file, but it seems like there is a different iexplore instance for each javascript file. I end up having to guess which one to use for each javascript file. To top it off, the debugger keeps detaching in the middle of me trying to find the right process to attach to. It is nearly impossible, and definitely not feasible to try and debug this way.
Our solution is in TFS, we're using IS Express and the three other developers on our team have none of the problems I have. We all have the exact same hardware.
Another clue that might help is that we are using the OWIN functionality to connect to ACS for security. If I bypass authentication through OWIN / ACS I can step into the javascript. This, however, creates other problems since the code is expecting me to be authenticated. This is not an acceptable workaround and, again, the other developers on the team are using OWIN/ACS and do not have any problems.
I'm extremely frustrated and at a loss for how to go about figuring our what is wrong with my environment. Any help will be greatly appreciated.

Debugging javascript in ASP.NET project

I'm just starting doing js development, my experience with server-side, XAML, etc. I'm used to intellisence and nice debug experience.
Now I'm struggling. What is the best combo for debugging asp.net with javascript in VS2012? I'm using jQuery. I'd like to have debug breakpoints saved and just edit/start/debug/stop/edit/start... as usual.
Right now when I had VS debugger it would cache js file and it really doesn't work. I have to clear browser cache on every restart. It is real PITA to work like this. F12 tools is not that great either. I have to find js I need and set breakpoints every time I restart application.
People with experience, any help on minimizing pain?
You can use VS2012 to debug the JS by adding the breakpoints as usual then attaching to the IE process after allowing access to debug JS in IE through the settings. That will let you step through the JS as you would code when debugging as normal
Guide (old but still works the same):
http://www.codeproject.com/Articles/18921/Using-Visual-Studio-to-Debug-JavaScript-in-IE

Visual Studio JavaScript debugging extremely slow

I am having the strangest problem debugging JavaScript in Internet Explorer in Visual Studio.
If I set a breakpoint in JavaScript code and run the (ASP.NET MVC) project in debug mode, I hit the break point fine. But shortly after that, while on the breakpoint, pretty much my whole computer locks up for 10-30 seconds. During this time I can move the mouse pointer, but not interact with anything. If I click on things eventually the computer starts to beep.
After the 10-30 seconds is up everything is back to normal.
Debugging worked fine up until a couple of days ago. The same behavior is shown by different ASP.NET MVC projects.
I am running Internet Explorer 10 and Visual Studio 2012 on Windows 8 Enterprise 64 bit.
I have no third party antivirus (Only Windows Defender). I do not have intellitrace. I have only a single breakpoint, all others are deleted. I have tried deleting my .suo file.
My browser (ff) locks up on me when a script on a website is taking too long to run typically. It then throws a stop script prompt. The fact that you can replicate it across three computers makes sense if it's the same erroneous script causing the lock up. I doubt it'll matter if you try it on a win 7 box, win xp, but those are obvious tests if you're thinking sys configuration as a cause. Also, try setting your breakpoint earlier in the script to tell what/when is locking up.
On a different note, I've always debugged javascript in firefox with firebug with great success.
I had this same problem and it turned out it was Intellisense. Intellisense chokes on large Javascript files. The slowdowns would happen even when I wasn't doing something that required Intellisense.
I ended up splitting them out and referencing the other files with:
/// <reference path="/scripts/<other>.js" />
This allowed autocomplete to work across files and prevented the lockups.

JavaScript debugging issue with vs2005

I encountered a strange problem today. Whenever i put a breakpoint in one of my js files, the breakpoint is not hit.
I use Visual Studio 2005 in combination with TFS.
In ie the disable script options are both disabled.
The only thing that changed is that I installed Visual Basic 6 for an old project, but I don't see how that would impact debugging via Visual Studio 2005.
Did anyone had this problem before, or better does anyone know a solution?
thx.
In order for Javascript debugging to work the Visual Studio needs to be attached as a debugger to the IE process and it needs to be able to resolve the phyiscal path of the javascript file with the URL of the same script loaded in IE.
Have you checked that when you start debugging in VS that it actually attaches to the IE process that gets spun up?
Customizer your toolbar, on the commands tab select the debug category then find the "Script Explorer" command, drag it to a tool bar. Close the dialog.
Using script explorer you should be able to find the script that ought to have the break point on. Ordinarily VS is able to combine the root path it specifies for the developer web server with the physical JS file path in order to determine what its URL would look like from the browsers perspective, it can then novate the break point from the physical file to the script loaded in the browser.
you can also use a debugger; statement in your js. IE will then prompt you to debug the script file and should give you the option to debug in Visual studio 2005/2008 if you have them.
Explained here
A collegue found the issue: the Just in time debugger was only set to handle Managed and native code, and no scripting.
I just had to re-set it in the visual studio options pane.

Categories

Resources