Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The breakpoint will not currently be hit. A different version of script file has been loaded by debugged process

I have strange behavior in VS 2012 with JavaScript as if it were caching old version. It appears to not load the latest changes made to the .js file when debugging. The breakpoint suggests

"The breakpoint will not currently be hit. A different version of this script file has been loaded by the debugged process. The script file may need to be reloaded."

Is there anyway to clear it out so that I can always run with latest changes? This only started happening recently (possible cause VS 2012 update 2???), I have used 2012 for months now and never had this issue.

Thanks.

like image 747
xtrip Avatar asked Apr 11 '13 16:04

xtrip


People also ask

Why breakpoint is not hitting with VS code?

If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.

How do you hit a breakpoint in JavaScript?

To enable the new multi-target debugger in VS 16.7 or newer please go to Tools -> Options -> Debugging -> General -> and check the option: “Enable using the multi-target JavaScript debugger for debugging JavaScript in ASP.NET projects (requires debugging restart)”


2 Answers

So it appears JavaScript files were getting cached in IE. The solution is it to go to IE > Internet Options > Settings (under browsing history) > Check for new version of stored pages : Every time I visit the webpage. Now every time I build/run debugger the most recent JavaScript file is loaded.

like image 111
xtrip Avatar answered Oct 14 '22 14:10

xtrip


  1. Go to the IE>Tools>Internet Options> Advanced Tab>

  2. Uncheck the "Disable Script Debugging" option

like image 40
Amir Avatar answered Oct 14 '22 14:10

Amir