(Re)Enabling JavaScript debugger in IE7 with Visual Studio 2008 - javascript

Visual Studio 2008 comes with nice javascript debugging features.
But I have played a little with NetBeans debugger wich has installed an ugly Script Debugger from Microsoft to my IE... Normally IE should ask what do I want to use for debugging, but now I can't start debugging with Visual Studio, the Script Debugger is started automatically... After uninstalling the Script Debugger I can't debug in IE at all. Even attaching to iexplore.exe process doesn't helps...
Has installed the Script Debugger again... :(((((
How can I get back my Visual Studio debugging working in IE again?

I have the same problem. It's not quite resolved yet, but I'll share what I have.
To let IE see the debugger again do this:
1. Open Visual Studio.
2. Go to Tools > Options > Debugging > Just-In-Time.
3. Enable Script checkbox, click OK.
4. Close Visual Studio.
Now when I try to debug it opens Visual Studio but gives this error:
"Unable to attach to the crashing process. An error occurred that usually indicates a corrupt installation (code 0x80040155). If the problem persists, repair your Visual Studio installation via 'Add or Remove Program' in Control Panel."
When I get back in the office tomorrow I'll try repairing Visual Studio.

make sure you don't have script debugging disabled in IE Settings. May not be the answer to your situation but I forget this all the time.

How to debug Windows Script Host, VBScript, and JScript files. Especially
make sure that the following registry
key is set to 1:
HKEY_CURRENT_USER\Software\Microsoft\Windows Script\Settings\JITDebug

If you use a global error handler window.onError, this handler prevents JS errors from being caught and IE does not asks if we want to debut with VS.
As another alternative, you can attach VS to IE process, then put breakpoints within any JS script that is available in resources view. VS should display (Script,x86) next to IE process in process list, if script is not in list it means that you haven't properly unchecked "Disable script debugging" as mentioned by #Jon Erickson

IE (7) Tools -> Manage Add-ons -> Enable or Disable Add-ons...:
Disable the troubling debuggers.

Related

Client and server side JavaScript debugging experience for Visual Studio Community 2017

I vaguely recall debugging client side JavaScript code inside of Visual Studio many years ago (this was before browsers has Dev Tools, and you had just the Firebug extension for Firefox), but more recently when I try it, I cannot break into the script inside of Visual Studio and I have to use the debugger in Dev Tools inside the browsers.
When I set a breakpoint within Visual Studio and run my application, the application does not honor the breakpoint and just keeps running. When I look at the breakpoint in the code editor, I see a message that reads:
The breakpoint will not currently be hit. No symbols have been loaded
for this document.
I am using Firefox 62.0.3 on 64-bit Windows.
My question is:
Just like the "Chrome Debugger" extension for Visual Studio Code allows for the JavaScript debugging experience inside Code, for both client and server side JavaScript, is there something that I can use with Visual Studio Community 2017 to debug JavaScript, and also support source maps?
Also, this is not very important, but since I have not been able to debug JavaScript inside Visual Studio for quite some time now, I am beginning to doubt whether I actually debugged it in Visual Studio or was it just a dream, or a memory gone wrong. But I am pretty sure, 100% that I did. But still, I don't know. I know that I did, but sometimes, I just want to make sure that it wasn't just me.
Adding a few more updates to the previous answer -
Microsoft Edge debugging is supported starting with version 15.7 of Visual Studio 2017. You will need to be on "Windows 10 April 2018 Update" or later.
Also by default Javascript debugging has been disabled by default on Visual Studio 2017. You can enable that as shown in the post above or automatically let Visual Studio show the below dialog box when you start debugging with a breakpoint set in JavaScript/TypeScript file.
Enabling JavaScript dialog box in Visual Studio 2017
Yes options are there to enable debugging JavaScript in visual studio 2017 too.
1. Go to tools and then select options
2. Then by click on the debugging tag you can able to see many check box options.
3. In that check whether your visual studio is enable with JavaScript debugging options provided.
By enabling this you can able to use Client Side JavaScript debugging on Visual Studio 2017
The short answer is:
The JavaScript debugging experience for Visual Studio is available only for debugging scripts inside Chrome and Internet Explorer. I am not sure if it is available with Microsoft Edge. And since Internet Explorer is pretty much out of use, the only popular browser that this experience is surely available for is Chrome.
So, make sure you select Chrome from the list of browsers in the toolbar when launching your debug session in Visual Studio.
Yes, I wasn't dreaming. I used to be able to debug those JavaScript files inside of Visual Studio, but at the time, I would be unconsciously using Internet Explorer. That experience was available only for Internet Explorer.
A few things to make sure you're doing before you start debugging:
Make sure you're running a debug configuration, so all your symbols are loaded.To do that, go to Project -> Properties, and from the dialog, navigate to the Configuration Properties page, and select Debug as the active configuration for the fields highlighted in the picture below.
Like Prasanna Brabourame said in his answer, check the checkbox that reads "Enable JavaScript debugging for ASP.NET (Chrome and IE)" from the Tools -> Options -> Debuggging dialog.

Visual Studio Community 2017 stops debugging when I open chrome developer tool

I am working on an apache cordova app. I do two different debugging, first is on my localbrowser(chrome) and then on an actual device. When debugging in chrome, I set break points inside VS and all are hit. Then when on chrome when I open the developer console, it stops the debugger. I swear that this never happen before. Any suggestions? I found some post that are almost related to my problem but it never solves them.
At first I thought the debugger stops because of my option settings in Visual studio, but I started a new blank(apache project) project and it works. Then I added my js, html, css files and settings to this new blank project. And there it goes, the debugger stops when I open chrome developer tool. I ran out of ideas. Please help.
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
I try to debug it in my VS2017, All projects get the same result as yours, it would stop VS debugging if we click F12 to start the chrome developer tool.
As you said that the blank project worked well in your side, if possible, you could check that whether you changed any settings in your side. I just use the default settings.
Of course, you could also reset your VS settings in your side, and then re-debug your blank project, view the result.
TOOLS->Import and Export Settings Wizard->Reset all settings->select “No, just reset settings, overwriting my current settings”->Choose a Default Collection of settings.
My understanding it is the normal action if it stopping VS debugging after you start the browser debugging, since generally we could use one debugger for one process.
In VS 2017 Go to Tools->Debugging->General then check
Enable Javascript Debugging For ASP.NET(Chrome, Edge, and IE)
Hope that helps you.

How to Get Full JavaScript/TypeScript Debugging in Chrome with Visual Studio (Like IE)

Is there a method for interactive debugging JavaScript and TypeScript in Visual Studio using Chrome similar to the functionality currently provided with Internet Explorer? With IE I can set a breakpoint in JavaScript or TypeScript in the IDE and step through the code within the IDE. I cannot get that same behavior with Chrome in Visual Studio.
For a fully integrated debugging experience with any JavaScript/browser based application and Visual Studio, you'll need to use Internet Explorer today. As TypeScript compiles to JavaScript, the integrated debugging also requires Internet Explorer.
The "trick" I often use if I want to use another browser is to add a debugger; statement somewhere in my TypeScript/JavaScript code and have the development tools open in Chrome ..., and execution will then stop on that instruction. As long as you have source-maps enabled, you should see your original TypeScript code in the Chrome debugging window. You can then use Chrome debugging tools to set further breakpoints. If the file doesn't change, the breakpoints will be retained from a "refresh" of the page.
This does not allow me to set breakpoints within Visual Studio though, but it's still effective and works well enough for my development.
Update April 2016
As a few in comments have pointed out, there's a path to making this work a little better, although the experience isn't nearly as complete as it is for Internet Explorer. Follow the steps outlined here. It involves starting Chrome with a custom command line (to enable remote debugging):
chrome.exe --remote-debugging-port=9222
And then attaching to the Chrome process with WebKit debugging enabled. You can add a custom browser to make it easy to launch Chrome.
(But, I will add that I haven't been able to get this to work in a way that I find useful and consistent, especially as I use Chrome for most other web browsing.)

IE8 javascript debugger

Is it possible using IE8 javascript debugger from ie8 dev tools to debug javascript on a page that runs locally from within VS2008 or you would have to run the page on a server against iis?
Currently I am getting an error "Unable to attach to process" if I try to debug javascript on a local page.
The problem you are experiencing is due to the fact you most likely already have a debugger attach to the process running the web application. You will have to stop the other debugger, most likely VS, and then you will be able to attach the client JavaScript debugger.
I suggist IE Developer tool bar for IE
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=95e06cbe-4940-4218-b75d-b8856fced535
it will help you debugging JavaScript just from your IE browser
also for FireFox you can use firebug
https://addons.mozilla.org/en-US/firefox/addon/firebug/
Regards
and for your question i think you must be in your server to debug your staff from vs2008
There are couple of things you should do in order to debug from Visual studio.
General the below tip is the thing I always used to forget.
First enable debugging in IE: go to Tools > Internet Options > Advanced, and make sure “Disable Script Debugging (Internet Explorer)” is unchecked and “Display a notification about every script error” is checked.
You can more information here
Here is the clear step by step explanation:
http://abhijitjana.net/2012/01/20/jscript-debugger-unable-to-attach-the-process-another-debugger-might-be-attached-to-the-process-while-application-is-running-from-visual-studio-solution/

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