简体   繁体   中英

Breakpoints not hit in Visual Studio 2012 JavaScript files

I'm not sure how I achieved it, but using Visual Studio 2012 I was able to place breakpoints in JavaScript files which are then hit when the statement is reached (project is asp.net web forms application). This was really useful and allows me to use Visual Studio's debugger to inspect object properties and so on. Unfortunately, something has changed - possibly to do with merging branches in TFS (or maybe it was an IE update or something?) and suddenly it no longer works. I know get the 'No symbols have been loaded...' message by the breakpoint.

I know someone is going to suggest using IE dev tools, switching to Chrome or using the debugger; JS statement and they are all good ideas. However, the workflow I've been using was working great for me and I'd really like to continue that way. Also, knowing it is possible makes me determined to actually get it working!

I know there are several similar posts on SO already, but nothing that seems directly relevant. ie I'm not trying to run in page inspector, and I'm using IE10 not IE9. Another thing is this worked without having to clear the 'disable debugging...' checkboxes in IE so other websites didn't keep presenting the debug popup for every odd JavaScript fault out there.

Does anyone have a list of settings / steps required to definitely get this working in a VS2012 / IE 10 environment (on Windows 7). Thanks in advance!

It's not often these days I result to looking on the second page of a Google search but I was getting desperate. Glad I did though as I just came across a blog post from someone with the exact same problem I'm having. Here is the post: http://icanmakethiswork.blogspot.co.uk/2013/04/ie-10-install-torches-javascript.html

He in fact links to a solution on an existing SO question: https://stackoverflow.com/a/15908391/761388 (note it's not the accepted solution to that particular post but it certainly fixed my issue).

In brief in case either of those links disappear, the fix to this issue was to select a different browser from the debug shortcut (eg firefox or chrome) run in debug mode, stop, switch back to IE and voila, Script Documents were being generated again and breakpoints worked!

There are a couple of resources on MSDN that can help you with this:

Most likely the steps you need to take from here are on those pages.

I was facing the same problem today, and I have tried the following steps,

  1. Delete IE browser cache
  2. Delete the Temporary Asp.Net folder from C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Temporary ASP.NET Files(You may need to select the framework version folder you are using).
  3. Restarting IIS
  4. Refreshing the page after opening IE browser console.

Any of the above steps may help you, but what worked for me is kind of different though it was my mistake.

The IIS copy of the project was referencing to the old branch, the one I was working earlier. That's the reason why my changes was not being updated in IE. You can check and change the same by following the preceding steps.

  1. Got to IIS
  2. Select the site you are working on, under Sites -> Default Web Site
  3. Right click -> Manage Application -> Advanced Settings
  4. Select Physical Path and make sure it is pointed to the branch you are working on.

This my be silly, but just sharing as it may help some people like me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM