VS2017 DOM Explorer turn off - debugging

I'm starting using VS2017 and noticed that for every HTML based project there's a DOM Explorer window appearing at launch. Problem: I don't want it, but I don't see how to turn off this option. I've already uncheked Tools->Options->Deguggin->General->"Enable JavaScript debugging for ASP.NET (Chrome and IE)" as a try, but the DOM Explorer window is still here.
Any idea how to turn it off ? Thanks for your help !

Here's how to disable the DOM Explorer when you launch the debugger - don't reset any settings or anything else...
All you need to do is close the DOM Explorer window when debug session is on, THEN stop debugging and restart Visual Studio for the change to be committed.
Once VS restarts you should not see Visual Studio open DOM Explorer for that project going forward. If you want to enable DOM Explorer again, you can do so by going to "Debug > Windows > DOM Explorer > Show All"

Solution:
TOOLS->Import and Export Settings Wizard->Reset all settings->select “No, just reset settings, overwriting my current settings”->Choose a Default Collection of settings. I often use the C# settings, and then disable option "Enable JavaScript debugging for ASP.NET (Chrome and IE)", debug it again.

Related

Visual Studio 2017 starts new instance of browser

I installed Visual Studio 2017 and it starts new instance of browser for web applications. I want to start it in the current opened browser, without any new instances (which closes when I stop debugging). Where is this setting?
This is a consequence of a new feature in VS 2017 that allows javascript running in Chrome, to be debugged inside Visual Studio. You can turn the feature off from
Tools > Options > Debugging > General > Enable JavaScript debugging for ASP.NET
The reason this feature requires a new instance of Chrome, is that the debugger connection requires Chrome to be launched with a specific command-line switch that can only be applied at process start, not to currently running processes.
The feature is explained in detail click here.
One other interesting note, is that opening Chrome's developer console, with F12, will have the side-effect of detaching Visual Studio's debugger from the browser.
You can solve this easily.
Go to "Tools" > "Options" > "Projects and Solutions" > "Web Projects"
Uncheck the item "Stop debugger when browser window is closed, close browser when debugging stops" > "Ok"
This should do the needful for you.

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?
I'm not sure if this came with the latest VS 2017 Update, but inside Debug -> Options you can disable it now.
Just uncheck the highlighted one:
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”
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
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.
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
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).
In VS menu click:
Tools > Options > search for "browser projects" > untick the last option "Stop debugger when browser window is closed.
this will do the job.
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
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.
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"
In Visual Studio 2017:
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):

How to stop browser closing automatically when you stop debugging on VS 2017

I'm trying out the new VS 2017 RC and wondering if anyone knows how to get the previous debugging behavior back
In VS 2015 it went like this:
Press start debugging
Website opens in new Chrome tab
Press stop debugging
Website is still open and the site is still running/active
Now in 2017:
Press start debugging
Website opens in new window that can't dock with any other Chrome windows/tabs
Press stop debugging
Website/Chrome window closes, can't continue using the site unless I manually go to the localhost window in Chrome
Is it possible in 2017 to switch back to the 2015 style? So the Chrome/Website window can dock with other Chrome windows/tabs, and it stays open after you stop debugging?
Additionally, I find the new Chrome window frustrating to use, as it seems not to have any history/content available. E.g I can't autocomplete forms or urls, which is very annoying when I'm trying to test a form
Visual Studio 2017 version 15.7 and higher & Visual Studio 2019 changed things again.
Disabling the following checkboxes will allow you to keep the browser open (doesn't close after stop debugging) and opens another tab (instead of another window):
Tools > Options > Debugging > General
Disable "Enable JavaScript debugging for ASP.NET (Chrome, Edge and IE)".
Tools > Options > Projects and Solutions > Web Projects
(Visual Studio 2017) Disable "Stop debugger when browser window is closed".
(Visual Studio 2019) Disable "Stop debugger when browser window is closed, close browser when debugging stops".
The reason for the change in behavior is due to VS 2017's support for debugging JavaScript/TypeScript running in Chrome. See announcement here https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/
To return to the 2015 behavior where Chrome is not closed by the debugger, disable the IE/Chrome script debugger in Tools -> Options like so:
For those of you who updated to Visual Studio 2019, that config is now under
Tools > Options...
And then in the options dialog (see image below)
Projects and Solutions > Web Project :
Uncheck Stop debugger when broswer window is closed, close browser when debugging
I am writing this answer as I think the previous ones cover only half of the problem.
First thing you want is to get rid of this annoying 'run chrome as a new window and auto-close when stopped debugging'
Tools → Options → uncheck Enable JavaScript debugging for ASP.NET
After doing that when starting debugging chrome opens a new tab, after stopping the tab is not closed but refreshing website shows white screen
again in the Tools → Options
uncheck Enable Edit and Continue
Since now you have your old behaviour back.
If your project is .net core:
in Properties folder > launchSettings.json file set this config :
"launchBrowser": false,
Else in visual studio 2022 :
Tools > Options > Projects and Solutions > Web Projects
uncheck : Stop debugger when browser window is closed, close browser when debugging stops
Go to Tools -> Options and search for "Stop Debugger". Then select the node Web Projects under Projects and Solutions. Uncheck "Stop debugger when browser window is closed". Before this option your should apply #jerone's suggestion.
PS: This option can be used after VS version 15.7
There are two ways to do this:
Either Launch without debugging by pressing ctrl + f5 or
Launch with debugging (pressing f5) and then go to the Debug menu and press "Detach All"
Hope that helps.

Is there a way to automatically collapse the Script Documents section in solution explorer?

While in debug mode, the solution explorer has a Script Documents section. It is expanded by default. As the debugger runs, new ScriptDocumentxxx poll.txt files are added to this section. As I am navigating the explorer files, the adding of these new line items causes the entire contents of the explorer to shift downward. This is quite annoying if I am trying to find a file or trying to click something. I can collapse the section manually, but I'd rather not have to do this all of the time.
Right click the projects you are interested in working on and click on 'Scope to this'. This will hide everything (Including the scripts folder) except those projects you selected.
I got annoyed enough with this that I turned off JavaScript debugging. If you are willing to go that far, the scripts are gone.
The path for turn of JS debugging is:
Tools -> Options -> Debugging -> General -> Enable JavaScript debugging for ASP.NET (Chrome, Edge and IE) (Visual Studio 2017 and 2019)
Note: This method does not prevent you from stepping though JS in the Chrome inspection tools so you do not lose that ability. You lose both the scripts (of course) and that new Chrome window that pops up when you launch the debugger.
Yes, there is.
IIS Express > Script Debugging > Disabled
Right click then 'Scope to This' to hide everything but the project in the solution you want to view.
Click on the Home/House icon to reverse it.
Yes there is. One way is to create a visual studio add-in or extension which monitors the solution explorer tree and collapses the "script documents" -item if it is expanded.
If you need code samples and/or a fully functional add-in just let me know. You have Visual Studio 2013, ay? Is it the express edition or what?
This is confirmed bug in VS 2019. Just Microsoft is not so fast about fixing it.
https://developercommunity.visualstudio.com/content/idea/351537/provide-a-way-to-prevent-the-script-documents-fold.html

VS2013 disable Web Publish Activity windo

Is there a way to disable the Web Publish Activity window in Visual Studio 2013?
I couldn't find any options to disable that feature.
I have no directly solution for it. But I found workaroud: I tab it to the right sidebar and set autohide for it. So, now this window take minimum screen place and isn't shown during every publish:
If you click the little x in the Web Publish Activity window, it will go away!
I had the same problem on Visual Studio 2017.
Mine was over everything every time and completely unreactive. Not even its close button worked.
The way I get rid of it was: menu Window > Reset Window Layout

Resources