How to show empty folders in visual studio? - visual-studio

I don't know what I've pressed, but empty folders don't display in my solution explorer. It's so bad, because I can't create a new file in one of them. I didn't find a setting, which display all folders, only "display all files", but this one isn't what I need.

Related

What do these Multi-Document like TFS Icons Mean?

Does anyone know what these icons mean in TFS 2017 Source Control Explorer? The files are .cpp and .h... The icons for the two newly added files show up correctly (as seen below), but the existing files all turn into the multi-yellow-document... why is it replacing the icon for file type?
The icons initially load correctly, but seem to change after being analyzed...
I just came across a more specific solution than uninstalling all of the TFS Source Control Explorer Extension. The "icon change" functionality that is causing this can be optionally toggled on its own from Tools->Options. Set "Files icon change" = False to disable this icon behavior.
If file is branched to more than one location its icon is changed to icon as this.
File icon change
In the file list on the left side of Source Control Explorer
window are branched files displayed with changed icon.
I was wondering if you or your mates have installed TFS Source Control Explorer Extension. Please also check this link for more detail information:

Why do some of my files in visual studio get created as "Shortcuts"?

Why do some of my files in visual studio get created like this:
http://i.minus.com/jQi1qFTagyRVD.png
And why does it prevent me from moving them around? How am I supposed to work with a folder hierarchy in visual studio 2010 without this happening?
The main problem with this is that I cannot move files between folders using the solution explorer once I've added them. In order to move them I have to remove them, then drag them to a different folder, then add them again, this seems silly. See image:
http://i.minus.com/jlhGNHjyvpGOO.png
Folder structure of VS solution does not have to map one-to-one to file locations. You can add files "as link" (small triangle on Add button when you adding existing item) to a folder in VS solution. Such files will not be copied to the disk folder you are adding to, but rather have "link" pointing to original location (using relative path). I'd recommend opening the solution file in text editor to see how different files are referenced.
I.e. this feature is useful when you want to share sources between different projects.
I'm not sure about "move them around" part...

VS Find in Files: No .svn contents pleeeeeease?

Is there any way to prevent the contents of .svn subdirectories to show up in Visual Studio Find in Files results?
An alternative would be to make it ignore hidden subdirectories.
According to the documentation for "Find in Files":
The Find and Replace tool does not search directories with the Hidden or System attribute set.
However, this seems to be only partially true. For VS to ignore hidden/system directories, the "Don't show hidden files, folders, and drives" option in Explorer must be set.
If you're like me, that's one of the first things you do on a Windows computer - change that setting to "Show hidden files, etc..." (along with showing extensions - it baffles me that anyone thinks that not showing extensions is a good idea or is less confusing than showing them).
Having files in the .svn metadata show up in search results is one of the very irritating things about using SVN and/or search tools that don't let you easily exclude the directories. Unfortunately, VS's "Find in Files" seems to be one of those irritants unless you're OK with to hiding the directories system-wide along with all other hidden files and directories.
Personally, I can usually get by with 'mentally' filtering those directories from the search results. If it's a particularly bad set of results, and you really, really need the filter, you can flip the setting in Explorer, perform the search , and change the setting back without having to reboot or restart VS or anything. That's a small consolation, but I was half expecting to have to restart VS for the setting change to take effect.
Also, if what you're really searching is the Project or Solution rather than an arbitrary location on the file system, you can tell "Find in Files" to search files in the Project/Solution as hunter suggested. But I assume that's not what you're searching, or you probably wouldn't be having this problem.
I believe you can do the following:
In the Find in Files dialog, click the [...] button next to Look In:
dropdown
In the Choose Search Folders dialog choose the folders you normally wish to search from the Available Folders section. Be sure not to select the .svn folder (mine appears to be only in the root folder, thankfully not in each sub-folder)
Click the > button to add them to the Selected folders.
In the Folder set dialog, give this set of folders a name e.g.
(Trunk)ProjectDatabaseFiles
Click Apply button then OK button
You can now select that set of folders by name in the Look In dropdown of the Find In Files dialog in there-by skipping any .svn files for the search

Visual Studio - how to BULK add files under a given directory as LINK?

How can one add in Visual Studio all the files under a given directory 'as link' (that is, without Visual Studio creating a local copy under current project's directory, which is what happens if one adds a folder as 'existing item')?
In my case, I don't want local copies. Instead, I want to work with existing items in their original locations. And, I don't want to add them by going through each folder. Instead, I want to specify a given folder and click a magic silver bullet button that adds all of the files below it as 'link'.
Thanks in advance.
(Disclaimer - I went through related questions, but all of them result in VS creating local copies.)
For single files
on the add item dialog you can see a small arrow pointing down on the add button
click that (since it is a button with a dropdown) and chose the add as a link menuitem. that will add the item as link
For multiple files
on the add existing items dialog SELECT all the files you want to add as an link and press the menu item ont he add button add as a link
For Multiple files in multiple locations
If you want to select a folder and add all the items on all subfolders then you can do that this way,
on the open dialog do a search for file types you want to add, select them all and do the "add item as link" action.
Since your question changed twice including the change on the title (once)
Visual Studio - how to BULK add files under a given directory as LINK?
edited title
I have added all the things i think you needs let me know if you still like to do something else
Hope this helps
Dan
If you want files under an external directory to be synced automatically in your Visual Studio project (i.e any new files are added to the solution explorer and any deleted ones are removed) then you can specify a wild card in the link. Do to this you will need to edit the project file (.csproj, .vbproj) manually though.
Find the section in the file where the ItemGroup elements are located and add something like this:
<ItemGroup>
<Content Include="..\MyDirectory\*.*" />
</ItemGroup>
This will add all files under MyDirectory (one level up from the project) to the solution automatically.
If you select 'Show all Files' in the Solution Explorer, you can than view all the files and folers and select them and right click to add them using 'Include in Project'.

Visual Studio solution that just points to a folder and shows all sub-folders and files in the solution explorer?

Is there a way to create a blank solution, or some type of file-based project solution within Visual Studio so that I can point to a root folder, and have all of the sub-folders and files in that root, show up in my solution explorer? I realize I can create a blank solution and then add the individual items manually by add > existing item, however, this does not keep the folder structure intact, and, well, it would take forever if I have a lot of folders/files.
You can also create the blank solution and then click the second-from-the-right icon at the top of the solution explorer (it looks like three files with one "cut out"). Once you click that button to show the files in the solution directory that are not in a project, you can select all the files (with shift-click) and then right-click on your selection and select "Include In Project."
Also note you can select multiple files in the "Add Existing..." file window with shift- or control-click.
You have to create a Visual Studio Project inside your solution to be able to add files with keeping their folder structure. The files to be added must reside below the project's main folder.
I suggest adding a "C# Empty Project" (Solution Explorer: Solution > Add > New Project ... > Visual C# > Windows > Empty Project). After that you can proceed as described by SoloBold to show the files in the project folder. Right click on the topmost folder of your source files an select "Include In Project" and the whole folder structure including all files will be added. This may take some time depending on the number of files / subfolders.
See also: Answer to similar question, with screenshot

Resources