17

When I start debugging the project we are currently working on, the program window is not given proper focus in windows but is stacked behind the Visual Studio window. I don't think this problem occurs on any of my team members computers, so it looks like it's a problem on my system.

Is there a setting in VS2008 for always on top or something like that? I can't seem to find one...

Any idea what could be causing this? Visual Studio? The program code?

I know this is sort of a vague issue but I'll concider adding more detail if no one recognizes the problem.

EDIT: I am using Visual Studio 2008 with ReSharper, GhostDoc and Resource Refactoring Tool.

EDIT: I've looked through every single option I can find in VS and I can not find anything that would explain this behaviour.

EDIT: I am running this on a dual monitor setup Lenovo Thinkpad Tseries laptop. The monitors are connected through a docking station. Monitor 1 is connected with a DVI cable and monitor 2 is connected vith a VGA cable.

Sakkle
  • 1,934
  • 9
  • 27
  • 39
  • I also see this from time to time. CodeRush? TeamCity? – Ruben Bartelink Mar 18 '09 at 15:38
  • TC has some Resharper bits, but prob nnothing to do with it... – Ruben Bartelink Mar 19 '09 at 08:04
  • 1
    Is it possible that VS is being launched from a TopMost window? – Greg D May 05 '09 at 11:54
  • I'm not sure i uderstand the question... could you please elaborate? – Sakkle May 05 '09 at 13:06
  • 1
    It's possible for a process' main window to inherit the TopMost property if there's other poorly-behaved software on the system. E.g., I've had my IM client pop open a new window with a NULL parent while a topmost splash screen was displayed. Windows assumed the splash was the parent window, and suddenly the IM client window was a topmost window. (Task Manager is another example of a topmost window) – Greg D May 05 '09 at 19:57
  • I have no idea if this was the case tbh... I'll try to make a note of what programs are open if it happens again. As it stands now I havent had problems for a while. – Sakkle May 06 '09 at 07:44

11 Answers11

21

I had the same problem that Visual Studio 2010 was running Always-On-Top.

I don't know whether this always works. Anecdotally, I closed Visual Studio 2010. Then I re-ran as administrator. Visual Studio then ran normally, not Always-On-Top. I closed Visual Studio. I ran Visual Studio normally (not as administrator). Visual Studio did not run as Always-On-Top.

Note: by "ran as administrator", I mean that I right clicked; on popup menu clicked on properties; on dialog clicked on "Advanced"; checked "run as administrator".

I did not try running as administrator by right clicking and then clicking "run as administrator" on the popup menu.

I only did this one time because once I got Visual Studio running normally, I did not know how to make it run Always-On-Top again.

Indinfer
  • 915
  • 9
  • 6
6

See also this answer: https://superuser.com/a/704621/710593

  1. Select a different application (e.g. Chrome).
  2. Press Windows-Home (which will minimise everything else).
  3. Press Windows-Home again (which will restore everything else).
  4. Visual Studio will function normally again.

It just happened to me in VS 2019, and this weird sequence fixed the problem.

Peet Brits
  • 2,911
  • 1
  • 31
  • 47
4

You can toggle “Always on top” option for the Active window using:

"Windows Key + A"

  • 4
    This does not fix the problem. – Alpha Apr 24 '15 at 15:08
  • This fixed the problem for me. – niki b Dec 02 '15 at 20:34
  • fixed it for me as well. Good call, Virtually Present – Ross Brasseaux Dec 10 '15 at 20:35
  • 9
    Win+A now brings up the Action Center in Windows 10 – Israel Lopez Jan 08 '16 at 01:34
  • Side note - it will **also** insert the letter "a" in your IDE - don't forget about it :) This happened after upgrading VS2015 to Update 2 (Windows 8.1). Thanks VP! – Riegardt Steyn Apr 04 '16 at 09:29
  • 2
    This answer depends upon some third party tool. Windows does not provide (and never has, [according to this page](https://support.microsoft.com/en-us/help/12445/windows-keyboard-shortcuts)) an automated or built-in shortcut for making a window stay on top. (If I am incorrect about this, please provide a link to official documentation stating otherwise.) – kmote Aug 28 '17 at 15:12
  • not a fix for the problem and doesn't align with modern versions of windows, downvote – Peter May 16 '20 at 19:49
  • This is probably for an older version of Windows. See this answer instead: https://stackoverflow.com/a/64495036/371917 – Peet Brits Oct 23 '20 at 06:40
4

This is just a theory, but after I recently upgraded to ReSharper 4.5 this problem looks to be resolved. It could be a coincidence but I'm inclined to think it isn't... :P

Sakkle
  • 1,934
  • 9
  • 27
  • 39
1

I had this problem with Visual Studio 2013 running on windows 10, I'm not 100% sure when or why it started, but it may have been after installing some Windows updates.

I resolved it using a minor variation of the method described by Indinfer:

  • Close Visual Studio
  • Right click on the Visual Studio shortcut, Run As Administrator. The problem is no longer there.
  • Stop and start Visual Studio as normal. The problem is no longer there.
0

I got this when I have AppVerifier set for vstest.discoveryengine.x86.exe

AndreiM
  • 815
  • 9
  • 17
0

Simplest solution is to reset your custom settings on Visual studio.

  1. Goto -> Tools -> import and export settings -> select "Reset all settings"
  2. Close all instances of Visual Studio, re-open.

This is safest solution but you will loose all customization you did, e.g. adding line numbers for code files, themeing, etc.

It worked for my Visual Studio 2012 Ultimate.

ShahidAliK
  • 30
  • 7
0

None of the above worked for me, but it went away while I was troubleshooting a different problem. I could not register MSVS 2019 as the Just-In-Time debugger even though I was running in admin. The message as "Another Debugger is Registered...". I uninstalled MSVS Shell (2015) and MSVS 2017, and deleted the registry keys listed in the accepted asnwer here: How to stop “Just In Time Debugging” messages blocking a buildserver , and it solved both problems.

BTW - The problem Always On Top problem did not happen with C++ debugging and I am using ReSharper Ultimate 2020.

Community
  • 1
  • 1
Kevin S. Miller
  • 913
  • 1
  • 9
  • 21
0

It worked for my by simply restarting my computer. Three times over the last month or so.

-1

No solution, but maybe an observation: I got this from time to time too with WinForms applications debugging on a machine with dual monitor enabled. Thinking about it, I never tried turning one monitor off and at my new work we do not create WinForms applications. With Webforms starting a new browser I never had this problem (yet).

Sascha
  • 10,231
  • 4
  • 41
  • 65
  • I am running dual monitors as well... will look into this. Didn't occur to me that this could be related. Thanks :) – Sakkle Mar 25 '09 at 09:29
-3

Very Simple. Just Toggle Maximise Button on Visual Studio 2017