ChatGPT解决这个技术问题 Extra ChatGPT

How to disable the new debug window in VS2017

I'm using Visual Studio 2017 RC and getting very frustrated with the new Chrome window that pops up when you click Debug.

Issues with the Debug Chrome Window:

Takes ages to start/"attach" website (I think it's attaching all the javascript debugging which I don't need because I use Chrome DevTools for that anyway)

Not dockable (as a tab) with other Chrome windows

Doesn't remember form history. If I'm testing out forms I can't autocomplete form data, so I have to type the whole lot out every time

Doesn't remember url history. If I'm testing a specific page on my site, I can't quickly select the url from Chrome url bar dropdown. Have to type the url in full

Extensions aren't enabled so I can't use my ruler or color picker extensions

Chrome window closes when debugging stops so I have to open up a new window to keep browsing the local site

Does anyone know how to disable this new Debug style window and go back to how it was in VS 2015?

Options -> Project and Solutions -> Web Projects. Uncheck "Stop debugger when browser window is closed". This will stop opening new window all the time.

S
Steveadoo

I'm not sure if this came with the latest VS 2017 Update, but inside Debug -> Options you can disable it now.

https://i.stack.imgur.com/tLXYZ.png


Thanks for the solution. The above issue in VS 2017 is making my system unresponsive. Hope it helps the case, will try and update
Yes. It comes with VS2017 but thanks for saving life !
Thank you!! I forgot how much easier debugging was before this "feature" was added.
Just got 15.7 - this isn't working for me now - starting in c# debugger still opens in new window.
For those who had the issue creep back up in 15.7 see stackoverflow.com/a/50268873/2497 for the solution.
K
Katja Braz

For thoose, who have the 15.7 update and unchecking the JavaScript options doesn't do the trick, found a solution here:

https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/

Tools > Options > Projects and Solutions > Web Projects, uncheck “Stop debugger when browser window is closed”


Thanks for this! I'm surprised VS2017 has ~3 checkboxes to turn this feature on/off. I'm sure there is a subtle difference between all of them.
U
Usman

This is not an issue, rather a new feature in VS 2017. Previously we could only debug JS and TypeScript using IE in debug mode (of VS). But now they have introduced debugging JS and TS inside VS using Remote Debugging feature of Chrome. If you are running your application in debug mode (pressing F5) and Chrome is selected browser, Visual studio 2017 will try to open a remote debugging session with Chrome on a dedicated port. With remote debugging,

The browser is launched in plain mode, i.e. no extension and no history etc. Remote debuggin doesnt work with an existing instance of Chrome already running. You always see this window for a while. At this point, VS is trying to attach the remote debugger to VS

https://i.stack.imgur.com/kkTjD.png

To go back to VS 2015 experience of debugging, change the debugging target from Chrome to IIS Express.

This post describes this feature in detail. https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/

A kind of quick work around is to press F5 and launch the debug session and forget about the newly opened Chrome window. Go to your normal Chrome instance and just open your site in new tab. You will still be able to debug and do everything because IIS Express will still be running your app at that port.

Update: The answer given below by @Steveadoo is the right way going forward. The option shown in his screenshot controls how chrome is launched for debugging. Uncheck it if you want to stick to your regular Chrome instance.

Hope this helps.


Thanks! I've set my debugging target to IIS Express, but now after clicking debug or after publishing, it no longer automatically opens a browser and goes to the url (like VS2015 did). I see your link says "There will be a setting in Visual Studio that allows you to disable client-side debugging in both IE and Chrome, but unfortunately that didn’t make it in to the release candidate." I really hope that gets added in, I much prefered how 2015 did things :)
You should also be able to launch without debugging by pressing ctrl + f5 instead of just f5. Also, to fix this problem: "Chrome window closes when debugging stops so I have to open up a new window to keep browsing the local site" - just detach from the debug target instead of stopping debugging (Debug -> Detach All).
we use the "Local IIS" option in our web sites, and I don't get the "IIS Express" option in that dropdown. When I try to run attached to Chrome I get the "Please wait while we attach" window, but VS gives throws an error message: Unable to start program "http://mywebsite.com". system cannot find file specified
A simple answer would be more useful for such a question
Downvote for this. Correct answere should be Options -> Project and Solutions -> Web Projects. Uncheck "Stop debugger when browser window is closed". This will stop opening new window all the time.
c
chitra

For VS 2017, Go to Tools -> Options -> Projects and solutions-> web projects and uncheck the last option as shown in image.

Also you can refer here: https://www.johanbostrom.se/blog/how-to-disable-the-built-in-chrome-from-starting-when-debugging-in-visual-studio-2017

https://i.stack.imgur.com/Lc4YI.png


R
Ryan Boken

Here is the Microsoft blog about this new functionality, and how to revert.

https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/

Here is the path I followed to disable:

Debug > Options > Debugging > General > (uncheck) Enable JavaScript debugging for ASP.Net (Chrome and IE).


A
Ali Jamal

https://i.stack.imgur.com/PpHFw.png

Tools > Options > search for "browser projects" > untick the last option "Stop debugger when browser window is closed.

this will do the job.


A
Avner Pinheiro

Debug > Options > Debugging > General > (uncheck) Enable JavaScript debugging for ASP.Net (Chrome and IE).

Tools > Options > Projects and Solutions > Web Projects, uncheck “Stop debugger when browser window is closed”

works for me, visual studio professional 2017, v 15.7.3


M
Mykhailo Seniutovych

I'm using Visual Studio 2017, and what worked for me is a combination of these two options:

Disable JavaScript debugging in Debug -> Options -> Debugging -> General Enable JavaScript debugging for ASP.Net. Disable stop debugging when browser is closed in Debug -> Options -> Projects and Solutions -> Web Projects -> Stop debugger when browser windows is closed, close browser when debugging stops.

When I used only one of these two it did not work.


H
Hamit YILDIRIM

if you look to JavaScript case

For Enabling and Disabling JavaScript Debugging in VisualStudio is the same on all versions

Tools menu

Options...

Debugging -> General

Uncheck "Enable JavaScript debugging for ASP.NET"


S
Sum None

In Visual Studio 2017:

https://i.stack.imgur.com/FQ39M.jpg

If it prompts you again to turn JS debugger on again, choose another option (It will continue to prompt you if you have breakpoints in your script code):

https://i.stack.imgur.com/D5hgM.jpg