views:

1144

answers:

5

I have this problem where I open Visual Studio and the internal windows are scattered all over the place. None of them are docked; some that should be visible have become invisible and vice versa. I then have to spend ages getting the windows back where I like them.

It only seems to happen with some solutions and only appeared recently.

For the life of me I can't fix the problem. Has anyone else been through this?

+1  A: 

Which solution you're opening shouldn't matter because those settings are not solution-specific. But I wonder do you maybe have Visual Studio 2005 and 2008 installed? If so, opening a solution created in 2005 will open VS 2005 and opening a 2008 solution will open VS 2008. You may have VS 2005 even if you didn't install it. For example, InfoPath 2007 installs a VS 2005 shell.

First I would position the windows where you want them, then do a Tools -> Export Settings and include only the window layouts. That way you at least have something you can revert to.

Then I would check Tools -> Options -> Import Export Settings and make note of where the "Automatically Save My Settings To This File" path is set to. Keep an eye on that file. Do you have any sync software that may be inadvertently overwriting it? Does it point to a non-existing location?

Josh Einstein
+6  A: 

Sounds like there is definitely a problem with Visual Studio retaining your settings between round-trips and possibly your Visual Studio settings profile in general.

The solution I'd recommend is firstly to reset all settings, secondly customize things to your personal preference and finally take a backup of those customized settings. The idea is that this settings backup file can be used later to automate a quick settings restore to a point you are happy with. The following steps show how to do this and hopefully should sort out even the most confused Visual Studio setting issues:

  1. Close down all instances of Visual Studio.

  2. Go to Start > Programs > Visual Studio 200X > Visual Studio Tools > and choose 'Visual Studio 200X Command Prompt'

  3. Run the sligthly less well known 'devenv.exe /ResetUserData' command. With this command you will lose all of your Visual Studio environment settings and customizations. Because of this, the /ResetUserData switch is not officially supported and Microsoft does not advertise it (the switch is not described in the help for devenv.exe you get when you type devenv.exe /? in a command prompt). Importantly, wait for the resulting devenv.exe process to disappear from Task Manager or even better Process Explorer.

  4. When the process disappears from Task Manager or Process Explorer, run 'devenv.exe /ResetSettings' which will restore the IDE's default settings and eventually start a single instance of Visual Studio.

  5. Now in Visual Studio choose 'Import and Export Settings...' near the bottom of the 'Tools' menu to start the Import and Export Settings Wizard.

  6. Choose 'Reset all settings' radio button and Next > Choose 'No, just reset settings, overwriting my current settings' and Next > Choose your personal 'Settings Collection' preference, I would choose Visual C# Development Settings here (Note: What you choose here has an effect on keyboard shortcuts etc. but you can always repeat this process until happy) and click Finish.

  7. When you get the message that 'Your settings were successfully reset to XXXXXX Development Settings.' click Close then spend a good bit of time adding any personal customizations to Visual Studio such as opening windows you always want open, customizing toolbars and adding any toolbar buttons etc.

  8. When you are finished with your personal customization and completely happy with your setup go again to Tools > 'Import and Export Settings...'

  9. Choose 'Export selected environment settings' radio button and Next > Tick 'All Settings' and Next > Choose a file name and directory and click Finish to store a backup of your current settings in a .vssettings file.

  10. In future if things go haywire again head back to Tools > 'Import and Export Settings...' and this time choose 'Import selected environment settings' radio button and Next > Choose 'No, just import new settings, overwriting my current settings' and Next > Either choose the name of your .vssettings file from the list (usually under the My Settings folder) or Browse.. to where you saved the file and Next > Tick 'All Settings' and click Finish.

  11. Importantly, close the single instance of Visual Studio. Any future instance you open should retain your latest customizations.

Peter McGrattan
+1  A: 

I had a similar issue when the My Documents folder was stored on a mapped drive. If I opened VS before mapping the drive, VS would act as if it was the first time it had been opened. I solved this issue by storing the environment settings on the local disk.

Tim
I have problems all the time having vs settings on a mapped drive. I have mine set to save locally, but even then, at random, VS will change the save path back to the mapped drive.
rally25rs
A: 

I'm facing similar issue. And it also only started recently, like, within the last 30 days or so. The only thing I remember changing in this period was updating Resharper 4.5.

sergiopereira
+1  A: 

Actually I worked out what the culprit was - previous VS crashes.

If one of my Visual Studio instances crashes for whatever reason - driving unit tests with Resharper is a common one - the next time I start up VS, I get a weird batch of settings. The behaviour depends on various factors, like whether or not I had other instances of VS open at the time.

cbp
So what did you do to solve it
John Dunagan
Nothing really - try to stop VS from crashing.
cbp