Condividi tramite


Output window

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

The Output window displays status messages for various features in the integrated development environment (IDE). To open the Output window, on the menu bar, choose View > Output, or press Ctrl+Alt+O.

Toolbar

The following controls are shown in the toolbar of the Output window.

Show output from

Displays one or more output panes to view. Several panes of information might be available, depending on which tools in the IDE have used the Output window to deliver messages to the user.

Find Message in Code

Moves the insertion point in the code editor to the line that contains the selected build error.

Go to Previous Message

Changes the focus in the Output window to the previous build error and moves the insertion point in the code editor to the line that contains that build error.

Go to Next Message

Changes the focus in the Output window to the next build error and moves the insertion point in the code editor to the line that contains that build error.

Clear all

Clears all text from the Output pane.

Toggle Word Wrap

Turns the Word Wrap feature on and off in the Output pane. When Word Wrap is on, text in longer entries that extends beyond the viewing area is displayed on the following line.

Output pane

The Output pane selected in the Show output from list displays output from the source indicated.

Route messages to the Output window

To display the Output window whenever you build a project, in the Options dialog box, on the Projects and Solutions > General page, select Show Output window when build starts. Then, with a code file open for editing, choose Go to Next Message and Go To Previous Message on the Output window toolbar to select entries in the Output pane. As you do this, the insertion point in the code editor jumps to the line of code where the selected problem occurs.

Certain IDE features and commands invoked in the Command window deliver their output to the Output window. Output from external tools such as .bat and .com files, which is typically displayed in the command window, is routed to an Output pane when you select the Use Output Window option in Manage external tools. Many other kinds of messages can be displayed in Output panes as well. For example, when Transact-SQL syntax in a stored procedure is checked against a target database, the results are displayed in the Output window.

You can also program your own applications to write diagnostic messages at run time to an Output pane. To do this, use members of the Debug class or Trace class in the System.Diagnostics namespace of the .NET API. Members of the Debug class display output when you build Debug configurations of your solution or project; members of the Trace class display output when you build either Debug or Release configurations. For more information, see Diagnostic messages in the Output window.

In C++, you can create custom build steps and build events whose warnings and errors are displayed and counted in the Output pane. By pressing F1 on a line of output, you can display an appropriate help topic. For more information, see Format the output of a custom build step.

Scroll behavior

If you use autoscrolling in the Output window and then navigate by using the mouse or arrow keys, autoscrolling stops. To resume autoscrolling, press Ctrl+End.

See also