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.
Yes you can put the break-point on client side page in Visual studio
First Put the debugger in java-script code and run the page in browser
After that open your page in browser and view the inspect element you see the following view
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 clickApply
andOK
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. :)
It is possible to debug by writing key word "debugger" to place where you want to debug and just press F5 key to debug JavaScript code.
http://www.aspsnippets.com/Articles/Debug-JavaScript-and-jQuery-using-Visual-Studio-in-Internet-Explorer-browser.aspx
The debugger should automatically attach to the browser with Visual Studio 2012. You can use the
debugger
keyword to halt at a certain point in the application or use thebreakpoints
directly inside VS.You can also detatch the default debugger in Visual Studio and use the Developer Tools which come pre loaded with Internet Explorer or FireBug etc.
To do this goto
Visual Studio
->Debug
->Detatch All
and then click Start debugging inInternet Explorer
. You can then set breakpoints at this level.For debugging JavaScript code in VS2015, there is no need for
Attaching IE didn't work, but here is a workaround.
Select IE
and press F5. This will attach both worker process and IE as shown here-
If you are not interested in debugging server code, detach it from Processes window.
You will still face the slowness when you press F5 and all your server code compiles and loads up in VS. Note that you can detach and attach again the IE instance launched from VS. JavaScript breakpoints are hit the same way they are in server side code.