4

I am experiencing some weird behaviors when debugging my MVC Web Application. Some days I experience these issues, but other days everything works fine.

  1. 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.
  2. The debugger will detach from the process without me clicking the Stop Debugging button.

I have tried everything I can think of including:

  1. Refreshing the page in IE to force the browser to get the latest version of the javascript files.
  2. Clean / Rebuild the application in Visual Studio
  3. Close / Reopen Visual Studio
  4. Delete all files from bin and obj folders and rebuild
  5. Cleaned up all old sites from my IIS Express applicationhost.config file
  6. Installed VS2013 Update 4
  7. Deleted / Reinstalled VS2013
  8. Removed / Added IE11
  9. Installed VS2015. Same behavior as VS2013
  10. 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.

John Way
  • 227
  • 1
  • 5
  • 17
  • So I've noticed this too. I have noticed that a lot of the time JavaScript can't be debugged directly within VS. The times that I was actually able to do it is within certain project types. One type I know that let's me do it is the SharePoint App project. Other times, it's been an asp.net project which adds in another node to the solution explorer when it's debugging through visual studio called "Browse" I have no good answer but I think it all comes down to the project type. Have you checked out this thread? http://stackoverflow.com/questions/15507349/can-not-hit-breakpoint-inside-of-js-file – mwilson Aug 21 '15 at 03:00
  • have you enabled script debuggin within IE. https://msdn.microsoft.com/en-us/library/z959x58c(v=vs.120).aspx – alaney Aug 21 '15 at 03:19
  • 1
    @mwilson, I checked out the article, nothing worked except adding the "debugger" where I want to debug. I still want to figure out why I'm the only one having these problems. I updated the question to include the fact that some days the debugger hits all the breakpoints fine, then I come in the next day and it doesn't hit them... so weird. – John Way Aug 21 '15 at 03:20
  • @Rodger, yes tried it both ways... same result. – John Way Aug 21 '15 at 03:22
  • 1
    This fixed the problem for me. http://stackoverflow.com/a/26628721/3976684 – John Way Aug 21 '15 at 12:29
  • Keep in mind that if you have minified your .js files and are referencing the minified files, you will not get a hit on your breakpoints in the raw .js file. I know this seems obvious, but it's haunted me a few times because it's so easy to forget. – brsfan Sep 15 '17 at 14:23

0 Answers0