Command vs. Immediate Window in Visual Studio

﹥>﹥吖頭↗ 提交于 2020-01-09 19:17:45

问题


The Command Window and the Immediate Window seem to do very similar things (for example, I can display variables in both windows by typing ? myVariable). What are the differences and why does Visual Studio include both?


回答1:


They do different things.

Immediate window:

The Immediate window is used at design time to debug and evaluate expressions, execute statements, print variable values, and so forth. It allows you to enter expressions to be evaluated or executed by the development language during debugging.

Command window:

The Command window is used to execute commands or aliases directly in the Visual Studio integrated development environment (IDE). You can execute both menu commands and commands that do not appear on any menu.


The immediate window is a debugging aid.

The command window lets you execute commands (say menu items) at any time.

Though they share some functionality they each have a separate focus.




回答2:


Adding to the "difference"

Immediate window: has all the functionality of the Command Window as long as it starts with ">".

Command window: does not have other functionality since it can't start with anything but ">".

P.S. Visual Studio includes both as in developing mode you can use practically only Command Window, since you need the debugging mode to be active in order to use the functionalities of the Immediate Window(which at any time can use the Command Window). In short, have Command Window in Developing Mode and Immediate Window in Debugging Mode.



来源:https://stackoverflow.com/questions/9000665/command-vs-immediate-window-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!