views:

107

answers:

5

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.

A: 

This isn't a direct answer, but have you tried debugging via Firebug?

annakata
A: 

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.

AnthonyWJones
A: 

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

redsquare
A: 

Well if I want to select the iexplorer process via attach process, I can't because it is grayed out.

I will check out firebug btw.

A greyed out item indicates that is already attached. You now need to look into the script explorer to see your script from the browser point of view.
AnthonyWJones
Firebug isn't really a solution. You would need to load it first uses its version of script explorer then set a break point. You could that in VS too. What you haven't got is a break point set in the IDE _before_ debugging being active when debugging starts.
AnthonyWJones
BTW, use add comment to response to answers rather than creating a new answer.
AnthonyWJones
A: 

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.