enable script debugging using Chrome in Visual Studio 11

20,875

Solution 1

You simply can't do this. Visual Studio only connects with IE in this way.


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.


There is a whole load of answered / unanswered / incorrectly answered questions all over the web and SO on the matter.

Solution 2

Here are the steps that worked for me in Visual Studio 2015 (should work in earlier versions as well):

Start chrome in remote debug mode: chrome.exe --remote-debugging-port=9222 Attach Visual Studio: "Debug" -> "Attach to Process..." -> select the chrome instance

All credit goes to: http://lostindetails.com/blog/post/JavaScript-debugging-in-VisualStudio-with-Chrome

Solution 3

This has been enabled in Visual Studio 2017 https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/

Share:
20,875
eddo
Author by

eddo

Finds solutions.

Updated on November 19, 2020

Comments

  • eddo
    eddo over 3 years

    I have a MVC 4 web Application with some javascript which is working fine with Internet Explorer and gives an issue with 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

    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.

    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?

    PS: attaching the Chrome process does not help as the debugging mode is 'Native' instead of '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.

  • Revious
    Revious over 9 years
    Is this answer still actual for the new releases of Chrome 38 and VS 2014? Is there any workaround?
  • Blowsie
    Blowsie over 9 years
    @Revious it would require visual studio to develop a plugin or some sort of websocket type communication. This has not been done yet, as far as I know, the closest thing is Browser Link. vswebessentials.com/features/browserlink but it does not offer the debugging mentioned in the question
  • Revious
    Revious over 9 years
    I've read an article on Source Map which should be supported by chrome. For me is really sad that developers don't ask microsoft to develop this plugin.. we are the IT, we serve all other sectors and we DON'T serve ourself..
  • Blowsie
    Blowsie over 9 years
    @Revious I personally don't have an issue with just debugging from Chrome itself. If you really need this functionality right now, WebStorm may be of interest to you. jetbrains.com/webstorm/features/#JS_debugging
  • Supersharp
    Supersharp over 8 years
    The NTVS extension can debug Nodejs scripts in Vistual Studio. Nodejs and Chrome are sharing the same JS engine V8. It is now "almost" possible. I opened a feature request on NTVS codeplex. Vote for it!
  • Hexo
    Hexo almost 8 years
    Note: This seems not to be working with WCF Services