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.

6
  • I also see this from time to time. CodeRush? TeamCity? Mar 18, 2009 at 15:38
  • TC has some Resharper bits, but prob nnothing to do with it... Mar 19, 2009 at 8:04
  • 1
    Is it possible that VS is being launched from a TopMost window?
    – Greg D
    May 5, 2009 at 11:54
  • I'm not sure i uderstand the question... could you please elaborate?
    – Sakkle
    May 5, 2009 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 5, 2009 at 19:57

11 Answers 11

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.

6
  • Helped me with same issue I was having with Visual Studio 2012RC Jun 4, 2012 at 22:34
  • Helped me as well running Visual Studio 2013 and ReSharper 8.2 on a new computer. Oct 10, 2014 at 6:42
  • had similar problem. I right-clicked VS 2013 and clicked "Run as administrator" and that fixed the issue
    – FistOfFury
    Oct 14, 2014 at 15:21
  • this fix also helped me for Android Studio. Thanks.
    – mihai71
    May 12, 2015 at 7:05
  • I had the same problem with VS2013, closing and open again (regular privileges) worked for me
    – RagnaRock
    Jul 8, 2015 at 10:44
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.

1
  • yep, this is the answer
    – Giquo
    Aug 15, 2023 at 1:35
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

7
  • 1
    I had the same problem with same solution.
    – Ray
    May 6, 2009 at 22:56
  • Oh... exelent. Guess that confirms it :)
    – Sakkle
    May 7, 2009 at 7:27
  • 2
    I just installed ReSharper 6 and it seems to have caused this problem for me.
    – jpierson
    Jul 30, 2011 at 2:15
  • 2
    FYI, Resharper 8.2 is now doing it again.
    – klkitchens
    Oct 14, 2013 at 14:23
  • 1
    i don't use Resharper and i have this problem. I think it's unrelated
    – FistOfFury
    Oct 14, 2014 at 15:21
4

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

"Windows Key + A"

8
  • 4
    This does not fix the problem.
    – Alpha
    Apr 24, 2015 at 15:08
  • This fixed the problem for me.
    – niki b
    Dec 2, 2015 at 20:34
  • fixed it for me as well. Good call, Virtually Present Dec 10, 2015 at 20:35
  • 9
    Win+A now brings up the Action Center in Windows 10 Jan 8, 2016 at 1:34
  • 2
    This answer depends upon some third party tool. Windows does not provide (and never has, according to this page) 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, 2017 at 15:12
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
0

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

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.

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.

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).

1
  • 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, 2009 at 9:29
-3

Very Simple. Just Toggle Maximise Button on Visual Studio 2017

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.