Visual Studio integrated Javascript debugging with Windows 10 Edge

18,268

Solution 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

  1. Optional: Set Edge as your default browser.
  2. Open your project in Visual Studio.
  3. Add breakpoints in your JavaScript.
  4. In the Solution Explorer, select your project
  5. Use Ctrl + Shift + W to "View in browser."
  6. If you did step 1, it will open in Edge. Otherwise, copy the URL into Edge.
  7. Once it is running in Edge, in Visual Studio, go to Debug > Attach to Process.
  8. In the "Attach to" area, select "Script code".
  9. From the "Available Processes" choose "MicrosoftEdgeCP.exe".
  10. Click attach and refresh the page in Edge.
  11. You will now be debugging from the Visual Studio IDE.

Set Default Browser

Set Edge as Default Browser

Attach Visual Studio to Edge Script

Attach to Process

Debugging

Debugging in Visual Studio

The above works in Visual Studio Community 2015 and it might also work in previous versions. Hooray!

Solution 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

Solution 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. enter image description here

Share:
18,268

Related videos on Youtube

rortegax2
Author by

rortegax2

I am a senior developer. I have skills on programming both desktop applications as web applications. I am always reading articles on new programming languages, libraries and techniques, and usually I find myself developing little utilities at night hours to put reading in practice. Some of my skills: ASP.NET (WebForms/MVC) + WebAPI AngularJS (+jQuery,+Javascript) HTML5, CSS3, SASS/LESS, SVG EF, ADO.NET WCF WPF, WinForms, Windows Services, Interoperability SQL Server, Oracle

Updated on June 04, 2022

Comments

  • rortegax2
    rortegax2 almost 2 years

    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?

  • Rudey
    Rudey over 8 years
    So you have to do this everytime now? Is this subject to change, so that it attaches automatically like it does with Internet Explorer 11?
  • hally9k
    hally9k over 8 years
    Yeah I agree, this is a demanding solution to an issue I would have expected to be solved out the box... Do I expect too much? Anyone know when they are going to sort the Edge integration out for VS 2015?
  • deandob
    deandob about 7 years
    Unfortunately still not supported in VS2017 and the suggested workaround is clunky. A shame as this made it much easier to build SPA applications and although it still works in IE, it means developing to older standards. vote at visualstudio.uservoice.com/forums/121579-visual-studio/… if you want integrated Edge debugging in VS.
  • Hypersapien
    Hypersapien over 5 years
    Naturally they're going to make it work with VS2017 but not 2015.
  • Aamir
    Aamir almost 5 years
    Are you sure that you are using VS 2015 and not VS 2017? The OP was asking for VS 2015.
  • Chris Catignani
    Chris Catignani almost 5 years
    @Aamir...in the answer I mention that I'm using "MS Visual Studio 15.9.5"
  • Chris Catignani
    Chris Catignani almost 5 years
    @Aamir...no problem. It was kind of an old question...and he was using vs2012 too
  • Marc Roussel
    Marc Roussel almost 5 years
    For your information, I'm using Visual Studio 2019 version 16.1.3 with the latest version of Microsoft Edge Dev and breakpoints in JS files aren't beeing hit. I'm forced to use Chrome which works fine.