简体   繁体   English

在Visual Studio 11中使用Chrome启用脚本调试

[英]enable script debugging using Chrome in Visual Studio 11

I have a MVC 4 web Application with some javascript which is working fine with Internet Explorer and gives an issue with Chrome. 我有一个带有一些javascript的MVC 4 Web应用程序,它可以很好地与Internet Explorer配合使用,并且会出现Chrome问题。

I was thinking to debug using Chrome as a browser in Visual Studio 11, which can be selected from the debug dropdown: the issue is that I cannot figure out how to enable script debugging : when I debug the breakpoint are disabled with the usual warning 我想在Visual Studio 11中使用Chrome作为浏览器进行调试,可以从调试下拉列表中选择:问题是我无法弄清楚如何启用脚本调试:当我通过常规警告调试断点时

No symbols have been loaded for this document 没有为此文档加载任何符号

I know I might debug scripts directly in Chrome, but I prefer going consistent using Visual Studio, since it involves stepping into several lenghty js libraries. 我知道我可能会直接在Chrome中调试脚本,但我更喜欢使用Visual Studio,因为它涉及到几个lenghty js库。

I can see from a previous post that with Visual Studio 2008 that was not possible: does anyone know a way to do that with Visual Studio 11? 我可以从之前的帖子中看到,使用Visual Studio 2008是不可能的:有没有人知道用Visual Studio 11做到这一点的方法?

PS: attaching the Chrome process does not help as the debugging mode is 'Native' instead of 'Script' PS:附加Chrome进程无效,因为调试模式是“Native”而不是“Script”

PSII: I also tried to attach Chrome using the Attach to: Script Code option in the Attach.. menu (this switches the Debugging mode to Script ) but that does not help as well. PSII:我还尝试使用Attach ..菜单中的Attach to: Script Code选项附加Chrome(这会将Debugging模式切换为Script ),但这也无济于事。

You simply can't do this. 你根本做不到这一点。 Visual Studio only connects with IE in this way. Visual Studio只以这种方式与IE连接。


Chrome does of course have its own debugging tools that you can use, but you won't be able to get your stops inside of Visual Studio as you may hope. Chrome当然有自己的调试工具可以使用,但是你可能无法在Visual Studio中找到你想要的停止。


There is a whole load of answered / unanswered / incorrectly answered questions all over the web and SO on the matter. 整个网络上存在大量已回答/未回答/未正确回答的问题。

Here are the steps that worked for me in Visual Studio 2015 (should work in earlier versions as well): 以下是在Visual Studio 2015中适用于我的步骤(也应该在早期版本中工作):

Start chrome in remote debug mode: chrome.exe --remote-debugging-port=9222 Attach Visual Studio: "Debug" -> "Attach to Process..." -> select the chrome instance 在远程调试模式下启动chrome:chrome.exe --remote-debugging-port = 9222附加Visual Studio:“Debug” - >“Attach to Process ...” - >选择chrome实例

All credit goes to: http://lostindetails.com/blog/post/JavaScript-debugging-in-VisualStudio-with-Chrome 所有功劳都归功于: http//lostindetails.com/blog/post/JavaScript-debugging-in-VisualStudio-with-Chrome

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Firefox时如何在Visual Studio 2008中启用脚本调试 - how to enable script debugging in visual studio 2008 when using Firefox 使用jquery将脚本标签插入头部时,如何启用Chrome调试 - How do I enable chrome debugging when inserting a script tag into the head using jquery 如何为 Visual Studio 2010 启用脚本文档 - How to enable Script Documents for Visual studio 2010 使用Visual Studio在php应用程序中调试javascript - debugging javascript in php applications using visual studio chrome - 在调试脚本中相当于 Visual Studio 的 F5 - chrome - equivalent of Visual Studio's F5 in debugging scripts 从Visual Studio Code中启动Chrome并进行调试 - Launching Chrome and debugging from within Visual Studio Code 使用 Visual Studio Code 调试 Electron-Atom 脚本 - Debugging Electron-Atom script with Visual Studio Code 在Visual Studio中进行Javascript调试 - Javascript debugging in Visual Studio 如何在 cshtml ASP.NET 内核中调试 JavaScript 脚本(使用 Chrome 浏览器或在 Visual Studio 2019 中)? - How to debug JavaScript script in cshtml ASP.NET core ( by using Chrome browser or in Visual Studio 2019)? 使用 Visual Studio Code 和 Node.js 调试/学习 javascript - debugging/learning javascript using Visual Studio Code and Node.js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM