Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a solution folder in Visual Studio?

I have a Visual Studio 2008 solution, and I would like to include a real folder in the solution, but not at the project level, instead at the solution level.

I noticed you can right click the solution and add a solution folder, but it comes up as some white folder, and I have my doubts as to exactly what it is supposed to be...

Basically on the file system I have c:\mySolution\myFolder...

I want that myFolder is added to the solution, so that items are also under source control...

like image 604
Michael L Avatar asked Dec 17 '08 09:12

Michael L


People also ask

What is a solution folder Visual Studio?

A solution folder is a container for one or more related projects. You can create many folders within a Visual Studio solution, including nested folders. They appear in the Solution Explorer as expandable and collapsible sections.

What is solution in Visual Studio?

In Visual Studio, a solution isn't an "answer". A solution is simply a container Visual Studio uses to organize one or more related projects. When you open a solution, Visual Studio automatically loads all the projects that the solution contains.

How do I open the solution folder in Visual Studio?

In Visual Studio, click File > Open > Folder. Navigate to the folder, and click Select Folder. This opens the folder in Solution Explorer and displays its contents, files and any subfolders.

Where is the solution file in Visual Studio?

You have to go to Tools > Options > Project and Solutions > General , where you can see “Always Shows Solution” is Unchecked. Once you checked “Always Shows Solution” , you will able to view the Solution file with in solution explorer.

What is a solution folder?

Although solution folders group projects in a similar manner to the way in which directories hold files, they are not stored as physical folders on disk. They are virtual folders that are only understood by Visual Studio. It is a simple task to create a new solution folder.

What is a solution file in Visual Studio?

Solution file. Visual Studio uses two file types ( .sln and .suo) to store settings for solutions: Organizes projects, project items, and solution items in the solution. Stores user-level settings and customizations, such as breakpoints.

How to view folders in Visual Studio Solution Explorer?

You must right-click the solution, add a new folder, and then right click on the folder to add existing items or nested folders. Show activity on this post. Not quite an answer to the question, but to view folders on the file system within Visual Studio Solution Explorer there is now a way of switching views between the solution and the folders.

What is the use of vs folder in Visual Studio?

Usually, .vs folder is required by Visual Studio to store opened documents, breakpoints, and other information about state of your solution. which means It contains typical files like, Temporary caches used by Roslyn for IntelliSense. IIS Express applicationHost.config file.


1 Answers

I also would like to be able to add physical folders to a solution, but unfortunately you can't do so outside a project.

The best solution I have found is to add a solution folder with the same name as the physical folder (myFolder in your example), then add files from that physical folder to the solution folder.

However Visual Studio does not maintain a mapping between the solution folder and the physical folder which means that:

  • new files subsequently created in the solution folder using Visual Studio are not automatically placed in the physical subfolder (I think they are created in the solution root folder by default)

  • files added to the physical folder are not automatically visible in the solution folder, even with "Show All Files".

To add new files, I therefore always create the new file in the physical folder outside Visual Studio, then add it to the solution folder using "Add/Existing Item"

like image 187
Joe Avatar answered Sep 23 '22 20:09

Joe