问题
Is there any way to enable Visual Studio integrated Javascript debugger with Windows 10 Edge? I mean the feature for stepping through the code, set breakpoints, etc. from inside the Visual Studio IDE. I am using Visual Studio 2012 and 2013, perhaps this can be achieved with 2015?
回答1:
TLDR;
Once it is running in Edge, use Debug > Attach to Process from Visual Studio Community 2015.
- Attach to:
Script code
- Available Processes:
MicrosoftEdgeCP.exe
Steps
- Optional: Set Edge as your default browser.
- Open your project in Visual Studio.
- Add breakpoints in your JavaScript.
- In the Solution Explorer, select your project
- Use
Ctrl
+Shift
+W
to "View in browser." - If you did step 1, it will open in Edge. Otherwise, copy the URL into Edge.
- Once it is running in Edge, in Visual Studio, go to Debug > Attach to Process.
- In the "Attach to" area, select "Script code".
- From the "Available Processes" choose "MicrosoftEdgeCP.exe".
- Click attach and refresh the page in Edge.
- You will now be debugging from the Visual Studio IDE.
Set Default Browser
Attach Visual Studio to Edge Script
Debugging
The above works in Visual Studio Community 2015 and it might also work in previous versions. Hooray!
回答2:
This feature has finally been added in Visual Studio 2017 15.7.
JavaScript debugging with Microsoft Edge
The Windows 10 April 2018 Update is also needed, as it contains the Microsoft Edge DevTools Protocol
回答3:
Using: Microsoft EdgeHTML 18.17763 , MS Visual Studio 15.9.5
All I had to do was this:
In VS...click Debug
-> Options
. Under Debugging-General
...check Enable JavaScript debugging for ASP.NET (Chrome, Edge and IE)
The next time you launch Edge from VS you will see the blue Developer Tools Server icon next to the address bar.
来源:https://stackoverflow.com/questions/32346833/visual-studio-integrated-javascript-debugging-with-windows-10-edge