Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't Visual Studio refresh the folders when I click the Solution Explorer refresh button?

In Visual Studio 2008, I can see all my project files in my Solution Explorer, and these files exist in an actual diectory.

However, if I add a file to that directory (let's say, an test.sqlite file in the App_Data folder, or say, images created by some other program), then these files do NOT appear in my Solution explorer, even if I click the refresh button.

How can I make files created by other applications appear in my Solution Explorer?

(so far, I have to create them somewhere else, then copy and paste them into the solution explorer itself, but there must be an easier way).


Edit:

Is there an advantage to this "fake solution view", i.e. I could have a file "test.sqlite" in my App_Data directory but in my solution, it could be appearing in my root directory. Coming from an Eclipse WYSIWYG Solution Explorer mindset, I don't see the advantage of having this extra virtual meta-information about the actual files in your directory. Is there a way you get an advantage out of this metaphor?

like image 353
Edward Tanguay Avatar asked Jan 23 '09 09:01

Edward Tanguay


People also ask

How do I sync Solution Explorer in Visual Studio?

You can navigate there quickly using Visual Studio Quick Launch (Ctrl + Q). Just type 'Track active' and you will get the quick link to the setting. Keep it checked, and off you go, the solution explorer and the current file will be in sync.

How do I refresh a file in Visual Studio?

There is a refresh option on the bottom of 'view' tab. click on your project in the solutions explorer(not the solution itself, but the project), then click on the view tab on the tab list on top of the visual studio. tabs go: file, edit, view, project... on the bottom of view tab refresh option will appear.

How do I add folders to Solution Explorer Visual Studio?

To create a folder within the solution, right-click the solution name in the Solution Explorer pane and choose "Add", then "New Solution Folder" from the context-sensitive menu. To create a subfolder, start by right-clicking an existing solution folder and then choose the same menu options.


2 Answers

At the top of the solution explorer is a toggle button "Show All Files" this makes it include all files in the display even if they aren't included in the project. The icons for these will be grayed out a bit. Then just use the context menu to add these to the project.

like image 104
GeekyMonkey Avatar answered Oct 26 '22 06:10

GeekyMonkey


On the solution, click the right mouse button and select 'Add existing item' and pick the file from the solution root directory. The Solution will now get a 'Solution Items' directory which contains your file. This directory is virtual, so it does not exist on disk.

However there is no feature like 'Show All Files' for a solution, this only works on projects.

like image 45
Gerrie Schenck Avatar answered Oct 26 '22 08:10

Gerrie Schenck