如何调试(仅)Visual Studio中的JavaScript? [英] How to debug (only) JavaScript in Visual Studio?

查看:192
本文介绍了如何调试(仅)Visual Studio中的JavaScript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Microsoft Visual Studio 2012开发一个web应用程序(asp.net mvc 4),随着解决方案越来越大,调试越来越慢。



需要知道是否有一种方法可以在视觉工作室而不是整个应用程序(服务器+客户端)上调试我的客户端(javascript)。



有没有方式附加到IE的进程并得到断点工作....?



不想让整个客户端/服务器应用程序上运行调试器,只是客户端

解决方案

首先打开Visual studio ..选择您的项目在解决方案资源管理器中。右键单击并选择选项浏览然后将IE设置为默认浏览器。



现在打开IE ..go到

工具>>互联网选项>>进展>>取消选中禁用脚本调试(Internet Explorer)复选框。然后单击应用确定你完成了..



现在您可以在JS文件中设置断点,然后在VS中点击调试按钮。





<编辑: - 对于asp.net Web应用程序,右键单击您的启动页面(例如default.aspx)并执行相同的步骤:)


I'm developing a webapplication (asp.net mvc 4) with Microsoft Visual Studio 2012, and as the solution is getting bigger, the debug is getting slower.

Need to know if there is a way to debug only my client side (javascript) on visual studio instead of the entire application (server+client).

Is there any way to attach to process of IE and get the breakpoints working ....?

Not interested on get the debugger running on entire client/server application, just client.

解决方案

First open Visual studio ..select your project in solution explorer..Right click and choose option "browse with" then set IE as default browser.

Now open IE ..go to
Tools >> Internet option >> Advance>> uncheck the checkbox having "Disable Script Debugging (Internet Explorer). and then click Apply and OK and you are done ..

Now you can set breakpoints in your JS file and then hit the debug button in VS..

EDIT:- For asp.net web application right click on the page which is your startup page(say default.aspx) and perform the same steps. :)

这篇关于如何调试(仅)Visual Studio中的JavaScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆