Stopping debugging in Visual Studio fails to close browser - visual-studio-debugging

I have the opposite problem as this thread:
Visual Studio - Prevent stopping debugging from closing Internet Explorer
In both Visual Studio 2008 and 2010 whenever I debug my Web Projects, hitting [Stop Debugging] (or [Shift-F5]) still stops debugging, but no longer closes the browser (IE10). If I don't stay on my toes, this leads to many many browser windows being open, and eventually my machine starts grinding to a stop.
It's not a show-stopper, but it's bothersome nonetheless.
John

When you stop debug, you just stop VS debugger, but IIS is running yet and you can continue browse your site.

Related

Visual Studio 2015 "stealing" the application's console

I'm developing a gcc application using Visual Studio 2015 as an IDE. The debugger is gdb.
The application creates it's own window. When I compile with a DEBUG switch, I need the application to also spawn a console window. It's used for debugging and outputing printf's from multiple threads. Thanks to the "-mwindows" switch, this works correctly when I execute the application from outside Visual Studio.
Unfortunately, when I run the application from within Visual Studio, it seem to steal the console window. No console is spawned, and the printf's output are redirected to the Output Debug window.
This wouldn't be much of a problem if the VS console actually printed the "\n" correctly instead of stripping them out of the ouput. Everything gets printed on the same line, and the output becomes unreadable. Try as I may, I couldn't get VS to insert a newline in the Output Debug window. I searched online a lot, and this problem seems to be well documented, but I couldn't find a satisfying answer.
At this point, either of these solutions would work for me :
Prevent Visual Studio from stealing the application's console window;
Add special characters to all my printf in order to make the Output Debug print line feeds and carriage returns.
EDIT :
Ideally, the solution should be cross-plateform, in a sense that it should not add dependency to WinAPI.
EDIT2 :
"\t" seems to work as intended. Why does "\n" doesn't work? I also tried "\r\n" to no avail.
I was contacted by a Senior PM Manager for Visual Studio at Microsoft regarding this issue. I posted it as a "feedback" inside Visual Studio, about four months ago (around the time I posted it here)..
He acknowledged the problem, and said they're gonna try to add support for external consoles with Update 3.

Can't start debugger in VS2012 RC

Configuration:
Windows 7, 64 bit
Microsoft Visual Studio Professional 2012 RC Version 11.0.50522.1
RCREL
Running VS in administrator mode
The VS solution contains a web
application, with target: .NET Framework 4.
When I press F5, the solution builds... and nothing else happens.
Happens with both IIS or the VS Dev Server.
Happens with Platform Target of "Any CPU" or "x86"
If instead, I use the Debug / Attach to Process... menu, after a few seconds, I get:
"Debugger is Busy" - Debugger is performing a remote operation that is taking longer than expected. This dialog stay until I click "Terminate" and confirm it.
Then this dialog appears:
"Microsoft Visual Studio"
"Unable to connect to the Microsoft Visual Studio Remote Debugging Monitor named [COMPUTER NAME]. The network connection to the Visual Studio Remote Debugger has been closed."
After clicking OK, the 'normal' "Attach to Process" window finally shows up. In it, the list of "Available Processes" is empty.
Any suggestions or clues?
The main points that I wonder about:
Why is the list of processes empty? It is not surprising that the debugger does not work if it cannot see any processes.
Why is it trying to do "remote" debugging, when it is just accessing the local computer?
(Cross posted on social.msdn)
I had the same problem in VS 2012 (not the RC, but the final release) using a VS 2010 project. It would build fine, but the debugger would not start. So, I modified the solution file:
Changed "Format Verion 11.00" to "Format Verion 12.00"
And changed "# Visual Studio 2010" to "# Visual Studio 2012"
It's a workaround for now until my company upgrades its projects to VS 2012.
I've got a similar setup and I'd followed all the suggestions here and on Microsoft Connect - none of which worked for me. The only thing that did work was renaming MSVSMON.EXE in the x64 folder to MSVSMON.EXE.OLD and copying in the file from the x86 folder in it's place. I'm not sure if there are any other implications in doing this but it seems to have solved the problem in my case.
I eventually resolved this problem by deleting the msvsmon*.* entries in the \Windows\Prefetch folder. After doing so I could debug normally.
Ultimately, a Repair of the VS2012 resolved this issue for me. I followed the advice found at your social.msdn cross-post without any resolution (Devenv.exe /SafeMode /ResetSettings /ResetSkipPkgs and /Setup). Like you, my solution (VS 2010 SP1) also has a web application (targeting .NET 3.5), and the startup project is set to a winforms app. The ASP.NET development server did not start, nor did the app I was trying to debug.
Note that this issue was also posted to Connect at this link (by you?). If anyone else sees this issue, the Connect folks are requesting running the Microsoft Visual Studio 2012 Feedback Tool to collect data. As I started the Repair process prior to finding the Connect issue, I did not and was not able to provide feedback to MS with logging.
Seen a similar issue when running both Visual Studio 2010 and Visual Studio 2012 at the same time. Closing Visual Studio 2010 allow the debugger to start working in Visual Studio 2012.
I had the same issue - starting debugger just told me what a good job it had made of the build and the decided that that was enough.
I feared the worst, but luckily for me a reboot fixed the problem.
I know that this is therefore a pretty useless post in as far as offering help to anyone suffering with this issue, but I thought it was worth noting the point as it shows a) another person with the same problem so please fix it MS, and b) that sometimes a reboot fixes it so maybe that tells the maintainers something.
If you are opening a VS 2010 project with the new VS 2012 version it's probably your bin and obj folders that are causing the problem,deleting them solved the problem for me.Or you could clean your solution but I preferred manual deletion.
I just closed and reopened VS. This seemed to fix my problem
On another computer, with the RTM of Visual Studio 2012, I opened an older project and found that I could not press F5 to start the application. All that seemed to happen was a message in the status bar on the bottom edge of the window: "This item does not support previewing".
This solution had two projects, and the correct one was bold in the Solution Explorer, presumably indicating that it was the startup project.
However, after selecting the project and choosing "Set as Startup Project" in the context menu, I was then able to use F5 to run and debug it.
It turns out that the "This item does not support previewing" was nothing to do with the problem, but is a message that shows on the status bar whenever the item just selected in the Solution Explorer does does not support previewing.
For what it's worth, I found that I received this error message when I had an entry missing in my hosts file. I am using local domain aliases and the one I was trying to debug with wasn't in hosts. Adding the missing entry solved the problem for me.
Just copy all dte*.olb files, from C:\Program Files (X86)\Common
Files\Microsoft Shared\MSEnv to C:\Program Files X86\Microsoft Visual
Studio 9.0\Common7\IDE.
From https://mycodepad.wordpress.com/2013/12/07/visual-studio-2012-4-run-as-administrator-the-application-cannot-start-error/
Just my two cents,
I have experienced this issue twice now and it turns out after all of the suggestions I tried, it was BitDefender on my local machine that was doing this. So my fix for this problem is to try adding in exceptions to the local security software into the firewall and AV parts of it. Tell it to ignore the msvsmon.exe and devenv.exe altogether and see what difference that makes.
Otherwise try ripping it off altogether and see if the it lets you debug your solution.
You can see here for more info: http://forum.bitdefender.com/index.php?showtopic=37028
I installed the latest BitDefender version and all was fine for me.
I personally encountered some comparable problem: Visual Studio 2010 did not begin debugging but froze.
When I clicked VS it displayed a "Wait some more" or "Switch to" message box which didn't help me.
Using a task manager I could kill the *.vshost.exe process which brought VS back to life but aborted the debugging. Launching the program without debugging started the application instantly.
Solution:
Disable the indexing service for your code directories! Either deactivate the index service or uncheck the folders in the Indexing Service control panel.
Had this problem for a C++ application. Looking at the devenv.exe events in ProcMon pointed me to it trying to load a Visual Assist configuration file, which I had in my disk cleanup zeal accidentally deleted. Removing and then installing the extension again fixed it for me.
I have fixed the same issue by checking off the "Enable the Visual Studio hosting process" option from the start-up project Properties->Debug - Enable Debuggers options
All you have to do to fix this is go "Project > Set as StartUp Project" then hit F5 or the debug button and it will work!!!

Visual Studio 2010 Hangs When Deploying Windows Phone App

When deploying my Silverlight app, everything seems to be working until the screen goes black (just before the app starts loading) and Visual Studio gets to the "Launching UI Task" part of the build. Visual Studio is then unresponsive for about 60-90 seconds, during which time the screen remains black.
Finally, Visual Studio will become responsive again, the initial splash screen will load and the app will launch. However, it will hang again when I hit the "stop" button, this time for longer. It does this on a deploy to a device and to the emulator and it only does this for this one app (other projects deploy just fine).
It also does not hang when I do a non-deploy build. Cleaning and rebuilding the solution has no effect.
I'm using Visual Studio 2010 SP1 (Version 10.0.40219.1 SP1Rel). If you think I'm missing any helpful information, please let me know.
I had this problem as well. I remembered from long ago I found a post that stated if there was an invalid breakpoint, startup time could take forever. I deleted the .SUO file (which stores the breakpoints) and everything was back in order.

Debug ActiveX control with Visual Studio 2010

Bit of a strange and very annoying problem.
I'm using Visual Studio 2010 for an ASP.NET webforms project. I was able to set breakpoints in an activex control, load the page and then attach the Visual Studio debugger to the Internet Explorer process running (shows up as Type 'Script, T-SQL, Managed) then reload the page and my breakpoints would be hit.
However, after several small subtle changes (and lots of tidy-up changes), when I do the same thing, my breakpoints are not hit. The breakpoints look okay - the main change is when I look at the Debug > Windows > Modules screen, there are now no references to the iexplore process, even though the debugger is still connected to it.
I'm a bit reluctant to undo all my changes but I suspect that it might be down to ip addresses. Most of the code should run as an ipv4 address but I suspect that the Visual Studio debugger is running with ipv6 address.
Has anyone come across this type of issue, where ip address versions are messing up debugging processes?
Okay, found the solution to this after a week! It was nothing to do with IP addreses. The ActiveX component was limited to .NET 3.5.0 and so when it was loaded by IE, it ran in .NET 2.0. The rest of the project was .NET 4.0 and when Visual Studio was debugging it automatically debugged code type 'Automatic: Native' which defaulted to .NET 4.0. Although I could attach to the IE process and all the breakpoints looked ok (solid circles), none of them were hit because no symbols were loaded. Clicking the 'Select' button when attaching to the IE process, allowed me to choose Managed(v2.0, v1.1, v1.0) code and the breakpoints were hit. You can't debug both .NET 4.0 and .NET 2.0, but you can use two seperate instances of Visual Studio to debug your complete project.
Hope this helps anyone else who trips over this one like I did.

WPF Application Hang

I'm using Windows 7 Professional (x64) and having installed .NET 4.0 RTM on my machine.
Since 2 days I'm noticing that every WPF application that I'm trying to run hangs and becomes non responsive (a not responding text is appended to it's title bar) and it's painted white.
There is no info regarding any exception, no error message. Nothing. Even the Event Log shows that there was "application hang" event (code 1002) and nothing more.
This problem is for everything that is written in WPF, even for products like NHibernate Profiler and other stuff that I was using on a regular basis without any issues.
Tried to reinstall .NET 4.0 and nothing changed. Any ideas why this might be happening?
I had the same problem. It was a corrupt font cache!!
See http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7cc032c1-5f4d-4518-adc6-f53afd051e6b for a solution.
If I had to guess I would say video drivers. It might help to try attaching Visual Studio's debugger to the hung process (Debug -> Attach to Process) making sure that Managed Code is the selected debugger type. Then you can break into the debugger and maybe see a common stack trace.

Resources