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.
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.
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)”
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.
Go to the IE>Tools>Internet Options> Advanced Tab>
Uncheck the "Disable Script Debugging" option
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With