如何在编程和调试时使Visual Studio使用GUI相同的布局?

问题描述:

Visual Studio使用两种不同的GUI布局,具体取决于您的代码是否正在运行.我了解此操作的目的(让您在实际调试时仅显示与调试相关的窗口),但我发现此功能很烦人,并且希望在调试时不使用相同的布局.

Visual Studio uses two different GUI layouts depending on whether or not your code is running. I understand the purpose of this (letting you only show debugging-related windows while you're actually debugging) but I find this feature annoying and would prefer the same layout be used while both debugging and not.

是否可以禁用此功能,如果可以,如何禁用?

Is it possible to disable this feature and, if so, how?

有趣的时机. Zain Naboulsi刚刚在 Visual Studio提示和技巧博客中写了几篇文章:>

Interesting timing. Zain Naboulsi just wrote a few posts about this in the Visual Studio Tip and Tricks blog:

  1. 窗口布局:四种模式
  2. 窗口布局:设计,调试和全屏
  3. 窗口布局:文件视图
  1. Window Layouts: The Four Modes
  2. Window Layouts: Design, Debug, and Full Screen
  3. Window Layouts: File View

这里要记住的是, 既是您的工具窗口,还是您的 命令栏自定义设置已保存 分别针对每个州.有 没办法告诉Visual Studio使用 此时所有模式的一种状态. 此外,当您关闭时 处于任何状态的Visual Studio,全部四个 状态已保存.

The thing to remember here is that, both, your tool windows and your command bar customizations are saved separately for each state. There is no way to tell Visual Studio to use one state for all modes at this time. Additionally, when you shut down Visual Studio in any state, all four states are saved.

编辑

免责声明:我还没有尝试过,但是看起来很有希望.如果导出Visual Studio设置并使用文本编辑器编辑生成的文件,则可以找到<Category name="Environment_WindowLayout">元素每个布局都有子元素.我猜想将<Design>复制到<Debug>会导致两个布局相同.也许有人可以编写一个VS加载项或外部实用程序来自动执行此操作:)

Disclaimer: I haven't tried this myself, but it look promising. If you export your Visual Studio settings and edit the resulting file with a text editor, you can find a <Category name="Environment_WindowLayout"> element with child elements for each layout. I would guess that copying <Design> into the <Debug> would result in both layouts being identical. Maybe someone can write a VS add-in or external utility to automate this :)

以下是相关设置XML布局的简化形式:

Here is a simplification of what the relevant settings XML layout looks like:

<UserSettings>
    <Category name="Environment_Group" ...>
        <Category name="Environment_WindowLayout" ...>
            <NoToolWin>
                ...
            </NoToolWin>
            <Design>
                ... 
            </Design>
            <Debug>
                ...
            </Debug>
            <Design-FullScreen>
                ...
            </Design-FullScreen>
        </Category>
    </Category>
</UserSettings>