View Text For Any File In A Solution In Visual Studio

In Visual Studio solution (we use the current version of 2019 16.11.0), some files are readable, such as C# code, some are not, such as .NetFramework project file. This article will introduce a way to view all files in text or with a suitable editor.

This article would be the first one (08/21/2021), the other one is recent writing on 10/07/2022.

Introduction

In Visual Studio solution, some files are readable, such as code (C#, C++, any language), config file, HTML, and etc., some are not, such as Windows Form, .resx project file. they may have a design mode. For some of later, we may have a luck to view them, such as WPF Window (XAML) has both design mode and code view, and can be open at the same time,

Window Forms can be opened with design mode,

And in view mode with right-click of the file => View Mode,

For .resx file, it can be opened with design mode,

But cannot be opened with view mode, however, right-click the file => open with,

It can be opened with multiple editors,

Finally, for project files such as .csproj, although we can open the .Net Core project file either in design mode,

Or by double click, the file name to open it in text,

Or, for .NET Core project, you even can right Click on Project => Edit Project File

 

It is no way to open a project file for .NetFramework.

The following sections will give several alternative ways to open .NetFramework Project file and the way can be used for any other files if you cannot open it from Visual Studio Solution easily.

  • Method 1: Unload project
  • Method 2: Switch to Folder View of Visual Studio Explorer
  • Method 3: Use Open With

Method 1 - Unload project

Right-click the project file => Unload Project,

The project text file will be loaded automatically,

Method 2 - Switch to View Folder

Click the Icon Switch between solutions and available views as shown below

Get this,

Click the folder to switch to Folder View, then Click the project file,

Method 3 - Use Open With --- Choose your favorable editor

The same as above, after switching to Folder View, right click the file, such as project file => Open With,

Choose your favorable editor,

Summary

This article is to introduce the way to open the project files in Visual Studio Solution, however, the method can be used for opening any files from within Visual Studio Solution Explorer.


Similar Articles