vb.net 如何在 IE11 Dev Tools 中定位和调试特定文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42542812/
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
How can I locate and debug a specific file in IE11 Dev Tools?
提问by B. Clay Shannon
I have a file that is part of a legacy web site I'm maintaining that I need to debug - step into, etc. But I can't see how to do that. The site needs to be run in IE, in Compatibility mode.
我有一个文件,它是我维护的旧网站的一部分,我需要调试 - 进入等。但我不知道如何做到这一点。该站点需要在 IE 中以兼容模式运行。
When I run the site from VS (2013) by right-clicking the "http://localhost/..." item beneath the solution and selecting "View in Browser (Internet Explorer" and then hit F12, I see on the Debugger tab the file that has been set as the Default page (the "main" page I see after logging in), but from there I don't see how to open a different file - the one I need to debug.
当我通过右键单击解决方案下方的“ http://localhost/...”项并选择“在浏览器中查看(Internet Explorer)”然后按 F12从 VS(2013)运行站点时,我在调试器上看到标签已设置为默认页面的文件(登录后看到的“主”页面),但从那里我看不到如何打开另一个文件 - 我需要调试的文件。
There are a handful of files apparently available for selection beneath the folder icon:
在文件夹图标下方有一些显然可供选择的文件:
...but not the one I need. If I enter its name in the search box, I get, "No results found." It is beneath a pages folder, but so are those that are displayed. What makes them special? Why can I select those undesirables, but cannot select the only page I care about?
...但不是我需要的那个。如果我在搜索框中输入它的名称,我会得到“未找到结果”。它位于 pages 文件夹下方,但显示的那些文件夹也是如此。是什么让他们与众不同?为什么我可以选择那些不受欢迎的,却不能选择我唯一关心的页面?
采纳答案by Andrii Litvinov
I assume you have the JavaScript file you want to debug somewhere in dist. Just go to that file and write debugger;inside the function you want to debug. The open dev tools in IE and reload the page. Initiate an action that should invoke that function with debugger (if it was not done on page load) and you will be able to debug it.
我假设您有要在 dist 某处调试的 JavaScript 文件。只需转到该文件并debugger;在要调试的函数中写入即可。在 IE 中打开开发工具并重新加载页面。启动一个应该使用调试器调用该函数的操作(如果它没有在页面加载时完成),您将能够调试它。


