Visual studio forgets window settings and makes a

2019-01-21 01:10发布

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?

12条回答
成全新的幸福
2楼-- · 2019-01-21 01:34

I just ran into this problem too (seemed to trigger after a windows update) where I kept getting some bogus window layout no matter what I did. The above suggestions didn't work either. But luckily the suggestions in: Why doesn't VS 2008 IDE remember my preferences? of deleting:

%APPDATA%\Application Data\Microsoft\VisualStudio\9.0\windows.prf

worked.

TP

查看更多
SAY GOODBYE
3楼-- · 2019-01-21 01:35

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.

查看更多
迷人小祖宗
4楼-- · 2019-01-21 01:40

I just came across this issue in VS 2012, reset window layout was doing nothing.

I extrapolated

%APPDATA%\Application Data\Microsoft\VisualStudio\9.0\windows.prf

to

%appdata%\Microsoft\VisualStudio\11.0\Windows.index

... deleted it and was back in business!

  • Make sure you close all instances of VS first!
查看更多
\"骚年 ilove
5楼-- · 2019-01-21 01:42

My issue is similar, but the result is the app crashes. The problem was this value

In HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\MainWindow. It was set to "0 1000 -280 -100 3" probably due to having multiple screens and moving the UI around a lot.

Deleting this value allowed the app to restart successfully. It gets recreated on startup.

查看更多
Deceive 欺骗
6楼-- · 2019-01-21 01:43

I have experienced something similar. In my case the text editor colors (c# editor for example) are going haywire. The only solution that I tried and works for me is change color theme so something else and then back to what I want.

查看更多
\"骚年 ilove
7楼-- · 2019-01-21 01:44

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.

查看更多
登录 后发表回答