UGTS Document #34 - Last Modified: 8/29/2015 3:23 PM
Visual Studio Tips

Visual Studio Tips
These tips work in all versions of Visual Studio, even the Express editions.

Open Files Using Explorer
By default, when you double-click a file in a Visual Studio project, it opens in a window in Visual Studio. Sometimes this is fine, but other times, you want to be able to open the file with the default editor for that type of file. For example, you might want to open .sql files with SSMS, or .txt files with your preferred text editor.

To do this, right-click the file in the Visual Studio Solution Explorer window, and do Browse With... or Open With... Then press Add... and enter Program Name = C:\Windows\Explorer.exe, with friendly name = 'Explorer', and press 'Set as Default', and then press OK. From then on, you can right-click a file and choose 'View in Browser' to have Explorer open it.

The advantages of using Explorer are:
  • File Type Definitions - Explorer will open the file based on the standard viewer that you have configured for that file type.
  • Single Instance - If you already have the viewer open, Explorer will first try to open that file in a new window of the viewer program that is already running.