javascript 当前不会命中断点。调试进程加载了不同版本的脚本文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15953930/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 02:43:04  来源:igfitidea点击:

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

javascriptvisual-studio-2012

提问by xtrip

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

我在使用 JavaScript 的 VS 2012 中有奇怪的行为,好像它在缓存旧版本。调试时似乎不会加载对 .js 文件所做的最新更改。断点提示

"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.

无论如何要清除它,以便我始终可以使用最新的更改运行?这只是最近才开始发生(可能是因为 VS 2012 更新 2 ???),我已经使用 2012 几个月了,从来没有遇到过这个问题。

Thanks.

谢谢。

回答by xtrip

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.

所以看起来 JavaScript 文件被缓存在 IE 中。解决方案是转到 IE > Internet 选项 > 设置(在浏览历史记录下)> 检查存储页面的新版本:每次我访问网页时。现在,每次我构建/运行调试器时,都会加载最新的 JavaScript 文件。

回答by Amir

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

  2. Uncheck the "Disable Script Debugging" option

  1. 转到 IE>工具>Internet 选项>高级选项卡>

  2. 取消选中“禁用脚本调试”选项