Visual Studio命令窗口 [英] Visual Studio Command Window

查看:134
本文介绍了Visual Studio命令窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Studio中的命令窗口(菜单 View -> 其他Windows -> 命令窗口)有用吗?

What is the usefulness of the Command Window in Visual Studio (menu View -> Other Windows -> Command Window)?

我知道Visual Studio 命令窗口用于执行命令或别名直接在IDE中. MSDN文章 命令窗口 解释了可以使用命令窗口来打印调试语句,但是我认为在即时窗口中可以更轻松地执行这些语句.

I know that the Visual Studio Command Window is used to execute commands or aliases directly in the IDE. The MSDN article Command Window explains how one can use the command window to print debug statements, but I feel that these can be easier executed in the Immediate Window.

命令窗口有什么作用?

推荐答案

即时"窗口主要用于调试,变量求值等.您听起来很熟悉,所以我不会怀疑它的用法.有关它的更多信息,请查看MSDN文章

The Immediate window is mostly used for debugging, variable evaluation, etc. You sound familiar with it, so I won't belabor its usage. For more information on it, check out the MSDN article Immediate Window.

命令"窗口允许您使用其别名来执行各种命令.您会注意到命令窗口提示中有一个>字符.您可以使用of Class1.cs在解决方案中打开文件,然后按Enter,然后将其打开.在查找"对话框和立即"窗口中,您需要包括>,将其设置为>of Class1.cs.

The Command window allows you to execute a variety of commands using their aliases. You'll notice that the command window prompt has a > character. You can open a file in your solution using of Class1.cs, hit enter, and open it up. In the Find dialog and Immediate window you would need to include the >, making it >of Class1.cs.

尽管如此,您也可以在立即"窗口中通过在命令前加上>作为前缀来执行完全相同的操作. 命令"窗口为您节省了额外的击键,并且只要您放下命令别名就可以使用.

Nonetheless, you can do exactly the same thing in the Immediate window by prefixing a command with > as well. The Command window saves you an extra keystroke and is ready to go whenever you drop a command alias.

查看这些链接以获取一些命令:

Check out these links for some commands:

  • Predefined Visual Studio Command Aliases
  • Immediate Window Commands

例如,要打开快速监视"窗口,请在命令窗口中键入??.在立即窗口中尝试该操作,您将获得:

For example, to open the Quick Watch window, type ?? in the command window. Try that in the Immediate window and you'll get:

??
Invalid expression term '?'

在立即窗口中输入>??,它将起作用.

Type >?? in the Immediate window, and it'll work.

这篇关于Visual Studio命令窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆