在 Visual Studio 中在调试和发布之间切换的命令

在 Visual Studio 中在调试和发布之间切换的命令

问题描述:

是否有允许我在 Visual Studio 中轻松更改构建配置(例如,调试或发布)的命令?

Is there a command that allows me to change the build configuration easily (e.g., Debug or Release) in Visual Studio?

我在工具栏中看到了该功能,但如果可能,我尝试只使用命令.对于命令,我可以轻松定义别名并使用参数直接切换到已知的构建配置.

I see the function in the toolbar, but I try to work only with commands if possible. For commands I can easily define aliases and use parameters for direct switching to a known build configuration.

链接 在 Visual Studio 中切换调试和发布模式的键盘快捷键 来自 user3399 提供了正确的方向:如果我在命令窗口中输入菜单中的第一个字符,在我的例子中是 Erstellen,我会得到代码完成,并且我尝试了一些命令.就我而言

The link Keyboard shortcut to switch between Debug and Release modes in Visual Studio from user3399 provided the right direction: If I enter in the command window the first characters from a menu, in my case Erstellen, I get code completion, and I tried some commands. In my case

Erstellen.Projektmappenkonfigurationen 发布

按预期工作.我添加了一个额外的别名,现在使用起来更简单了:

works like expected. I add an additional alias, and now it's simpler to use:

alias pc Erstellen.Projektmappenkonfigurationen
pc Debug

如果有人会写英文命令,我会编辑/更新我的答案,以便其他用户更好地找到.

If somebody can write the English command, I will edit/update my answer for better finding for other users.