How can I automatically stop debugging Visual Studio 2013 when I close the browser window?
Only Internet Explorer can do this, as it's both a Microsoft product. Since Chrome has no direct access to Visual Studio it would be weird if Chrome could cut down the IIS process which is running on your PC.
If you like to see the "Stop debug behavior" you should use Internet Explorer as debug browser.
Aware this is an old thread, but adding because this came up for me first trying to work out why VS2015 wouldn't stop debugging when I closed Internet Explorer. Turns out, being 64-bit, is had picked the x86 version of IE to browse with and of course I never noticed the difference. When I went to "Browse with", there was "Internet Explorer (2)" there, which was the 64-bit version. That stopped debugging fine when I closed IE. When I went back in to Browse With, the original X86 one was gone.
Presume because this was an old project that had the x86 association saved.
Related
I'm developing a site with .NET and C# in Visual Studio 2017. When I first load the project, I can press the green arrow IIS Express button and it opens a new browser window and everything is fine. However if I stop it or exit from the browser tab, the next time it doesn't load the page. It opens the browser window, but says it cannot connect, and the IIS Express button doesn't stay grey and goes back to white. This started happening only recently, and I've not made considerable changes to the codebase; I don't know why this is happening now.
All I have to do is exit Visual Studio and open it up again, then I can run IIS Express for one time before it stops working again.
I don't see any errors, I've tried running in Administrator mode, and I've assured that it's not trying to use a port that's already in use. I've also tried updating VS 2017.
Where do I start looking into this problem?
According to your description, I guess you may install some third-party extension in your visual stuido that casuing this issue.
I suggest you could try to run VS with safe mode to check if this is working well or not.
About how to run VS in safe mode, you could refe to below way:
open CMD and go to C:\Program Files (x86)\Microsoft Visual Studio\2019\version name\Common7\IDE folder, run the command: devenv /safemode
Besides, I suggest you could try to reset all the VS setting to defauly.
Details, you could refer to this article.
Closing MS Edge DevTools stops a running Visual Studio web project. How do I prevent this?
I have a .NET MVC app that I am developing. For local testing and debugging I run the web project from Visual Studio using IIS Express. (Visual Studio Pro 2017 v.15.9.5)
It is not uncommon for me to open the Edge DevTools (F12) to inspect JS or CSS. The problem is that once the DevTools window is open if the DevTools are closed or even the web page is refreshed it causes Visual Studio to stop running/debugging the web application.
I have tried uninstalling the TelemetryCorrelation NuGet package (& its dependencies) from the project. I have made sure that the following configurations are unchecked in VS.
(unchecked) Enable Diagnostic Tools while debugging
(unchecked) Automatically close the console when debugging
(unchecked) Enable Edge Developers Tools for WUP JavaScript Apps (Chrome, Edge, and IE)
Using a different browser is not a solid option for me. I am writing an internal application and Edge is the "company supported" browser so I need to develop and debug with the same browsers my users will use.
EDIT before confirming as duplicate:
Although my issue was the opposite from the debugger closing the browser, the same configuration changes fixed my issue. Weirdly the behavior I have reported was ONLY in Edge, not in FF or IE. I was not having the opposite issues, stopping the debugger did not close the browser.
I was overlooking the "Stop debugger when browser window is closed, close browser when debugging stops" configuration b/c I was looking under the "Debugging" configuration heading, not "Projects and Solutions".
My solution was to uncheck the "Stop debugger when browser window is closed, close browser when debugging stops" configuration in Visual Studio.
I was overlooking that configuration because I was looking under the "Debugging" configuration heading, not "Projects and Solutions".
In VS2015 and earlier, when you started debugging a web application or site, it opened IE (or edge) or even chrome to view and test your project. When you closed the browser, the debugger would stop and when you stopped debugging the browser would close. In VS2017, this behavior does not happen. I find myself leaving tons of browser windows open all over the place. I would much prefer if it would simply behave as it did in VS2015 and clean up after itself.
I am sure there is a reason for this but I cannot fathom it. Is there a way to get this behavior in VS2017?
It is not a bug/issue this is a feature you can disable by inside Debug -> Options you can disable it now.
I have updated Visual Studio 2015 to the first update. Since then I cannot debug my code twice in a row. It goes like this:
I start VS and try to debug. So far OK
Change code, build and debug.
Try to reach a web but it never loads.
If I close the VS and load the solution again it works or If I do not change code in step 2.
Other thing I noticed is the IIS Express Worker process is consuming most of CPU time.
And apparently the symbols are not loaded (I do not see the messages of DLL loading in the status bar).
This is making my development process very slow and tedious.
The solution is a MVC project under 4.6.1 framework.
Any ideas? Thank you very much!!
You should boot Visual Studio into Safe Mode. To enter safe mode do the following:
Open Command Prompt, as Administrator.
Enter: cd C:\Program Files (x86)\Microsoft Visual Studio 14.0
Enter devenv.exe /safemode
If Visual Studio does load and debug, then more than likely an extension or an update is the culprit. This will allow you to also see which updates may have occurred. The other potential issue would be if your Internet Information System had an issue.
Otherwise if your Internet Information System is stuck 'on'.
CTRL + ALT + DELETE
Go to processes, end W3P process.
Try to launch and debug inside Visual Studio.
Otherwise, simply try restarting your computer. We would need more information, as this can occur for an assortment of reasons.
#Julen - I have the same issue as you and I have found a work-around.
Add the "Terminate all" button to your toolbar and use it instead of just stopping the debugging. This command kills the IIS Express process.
See how to add it here:
Automatically Kill IIS Express Process After Debugging (VS Express 2013 Web)
If your IIS doesn't shut down after stopping the debugger, you could do one of the tricks written in this blog post - but the opposite way because the article focuses on keeping the debugger on.
Here is the proposed solution 2 - to check "Enable Edit and Continue":
Similar to VS 2013, if you disable Edit and Continue IIS Express will continue to run when you stop your debug sessions.
Open the menu item Tools/Options, look for the Debugging/General option. Scroll down and uncheck “Enable Edit and Continue”
It might be hanging when trying to load external symbols. I had a problem with that before.
To test this theory:
Open the Tools menu.
Click 'Options'.
Find and expand 'Debugging' on the left.
In the 'Symbol file (.pdb) locations' list, uncheck everything.
Click OK and see if the problem reappears.
I'm using Visual Studio 2013, C#, Windows Forms application on a new laptop with Windows 7 Ultimate.
From within VS, if I Build and run my app, it opens fine (no errors or warnings). If go into the debug folder and double click the exe file, the app doesn't open. It appears in task manager, but I can't kill it. I get no error messages. Because it's running, I can no longer Build or run the project from VS as the file is in use.
I tried Building to Release and got the same problem.
The only way to get rid from the task manager is to restart the laptop.
This wasn't a problem on my old PC - which also had Win7 Ultimate and VS2013.
Do you know why my exe isn't running and why I can't kill it in Task Manager? Any help would be appreciated.
I had exactly the same problem. I have VS Express 2015 for Windows Desktop. Recently build app worked only from Visual Studio, old builds work fine. After some research I found that the promblem was my Avast Antivirus 2015, which prevented the new apps from running.
So I suggest, if you have Antivirus running, pause it for a while and see what happens. If indeed that is was the cause for your problems, the configure Antivirus so that it will not check your app when loading.
In Avast: Settings->Active protection->File system protection
(Not sure if that is excatly so, because I have Avast in other language than english)
Hope that works!
I have the same issue with Avast 2015 (licensed) that locks File Explorer up if I double click my c# apps in the bin\debug or release folders.
As others have suggested, rather than disabling Avast "Scan programs while executing" you can add your app path into the scan exclusion list via:
Left click the Avast Icon
Click Settings
Click Active Protection
Click Customize link for "File System Shield"
Click Exclusions and add your build folder. e.g. \bin
Also,
If Windows Explorer has locked up because of this issue, rather than rebooting you can open Task Manager, end-task "Windows Explorer" (your start bar will vanish) then click File->Run new task and type in Explorer, then hit enter to get everything back.
Cheers