Friday, August 18, 2006

VSIP Tip: Recovering "Hidden" Tool Windows

There are times as a VSIP developer when you can't get VS.NET to display the classy tool window you've just created. You have a suspicion that it's there, but no matter how often you toggle the view state from the IDE of your experimental hive, you can't get it to display.

The most common reason this occurs is when the VS.NET experimental hive doesn't get shut down correctly (i.e.: you stop a debug session without shutting down the experimental hive, or it crashes - not due to your code of course) while your tool window is in the hidden state. "Hidden" means that the window is displayed at off-screen coordinates. VS.NET will remember these coordinates as the default position of this window the next time you open the experimental hive, and as a result you'll never be able to see your window.

Although this seems to be the perfect time to ask your manager to buy you one of those Dell 30" Ultra Sharp Widescreen monitors, you can solve this problem fairly simply:

VS. NET stores all of its tool window locations in the following location:
C:\Documents and Settings\\Application Data\Microsoft\VisualStudio\<7.1exp>\devenv.XML.

Substitute your account for and the version number of your experimental hive for <7.1exp> (this value will be 7.1Exp for VS.NET 2003 and 8.0Exp for VS.NET 2005).

Make sure your experimental hive is shut down and delete devenv.xml.

The next time you run the experimental hive the IDE will recreate this file and all tool windows will default to their original locations. This trick can also be used in your development environment in the event you need to reset the positions of any hidden tool windows; just eliminate the Exp from the version number.

Thanks to Bob Meagher for pointing this out.

No comments: