When I use "Find in files" in visual studio 2010 I don't know how to exclude some folders from search? The only option I have found is: add folders.
If I would like to search all folders and files in parent folder execept one (child) folder, there is no way to exclude this particular folder from search?
I can set the folder as hidden but than it wont be visible in VS - I don't wont that.
All I wont is to exclude it from search.
Follow the below given steps:
Step 1: Press look in button.
Step 2: Select the folders in which you want to search.
I hope this will helpful for u.
If the problem is that the GUI is lagging because of too many search results. Try in setting, Find in Files -> Result options -> Display file names only = true
Related
I have a large wordpress project inside Visual Studio Code and cant figure out how to search for specific folders. Say that I wanto to search for my plugin folder my-plugin.
The only thing I found is to use CMD P (or ctrl shift p) and write a part of the path (ie. you are looking for /first/second/third , write /third and you get the files inside the folder)
I see in visual studio, i can search within:
Current Doc
Current Selection
All Open Docs
Current Project
Whole Solution
is there anyway to:
Search within certain file types (just javascript files, just .aspx files?) ?
Search within specific folders ?
Yes you can do this using this options
You can also browse the folder the in which you want to perform the search using the button that is placed right to Look in: option.
Is it possible to add a folder structure to Solution Items without manually adding each level of the tree?
We have a multi project solution which requires several third-party libraries, at least one of which has a multi-layer tree.
We have a libs folder at the solution root level, alongside all the other projects.
The answers regarding Show Hidden Files, etc. don't work for solution items, only within a project.
Is there any way to get around this?
Do we have to add them folder by folder if we want them at the solution level?
(A similar question has been answered many times regarding Visual Studio projects. However my question is about Visual Studio solutions.)
Solution folders are just logical groupings of items. I don't think they relate to the file structure on your system. That is why you don't see them with a "Show hidden files" sort of functionality. You must right-click the solution, add a new folder, and then right click on the folder to add existing items or nested folders.
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. Here is the button to switch:
Clicking/tapping on this brings up "Solution Explorer - Views" content showing all available solution files and option for "Folder View":
Double clicking the "Folder View" shows the folders in the underlying file system:
Screen shots taken with Visual Studio 2019 16.10 preview 4, but this has been there for a while now.
I was looking for something similar and came across this thread. I had several data files that I wanted included with my solution but weren't specific to any one project in that solution.
I'm using VS 2019 and discovered they now have "Shared Projects" in C#, VB and C++ flavors. These projects don't build anything, but it's a convenient way to include some related directories/files.
Add a new Shared Project to your solution with the desired directory name.
Copy all your secondary files to the new directory.
Select "Show All Files" in the Solution Explorer.
Select the files, then right-click and select "Include in Project".
You can now view the file structure and open the files as part of your VS solution but VS will not try to build anything for that Shared Project.
If you have Source Control enabled, VS will also check-in those files (unless you mark them as excluded).
One option is to add an extension: "Add Folder as Solution Folder"
With this extension you can do this:
right click the solution > Add > Add Folder as Solution Folder
If I get you right, you'd like to have the projects organized in your solution.
Not sure if this fit your scenario, but if you choose a ".sln" (switch file-extension in the filebrowser-Dialog) when adding existing projects to your actual solution it will add all the project organized as they are saved in the sln to add.
(VS2017)
PS: Yes, I see this is a 7 Years old post :)
One Option would be to write a little exe and add this as external Tool to VS. Basically you would need to edit the sln file (plain text) by adding the folders as "Projects"
...
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mycsproj", "
[somerelativepath]\mycsproj.csproj", "{projGUID}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FolderName",
"FolderName", "{FolderGUID}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SubFolderName",
"SubFolderName", "{SubFolderGUID}"
EndProject
...
{FAE04..} shall be the Project Type GUID for CSproject
{2150...} would be the Project Type GUID for Project Folder
And define the hierarchy in the section
...
GlobalSection(NestedProjects) = preSolution
{projGUID} = {SubFolderGUID}
{SubFolderGUID} = {FolderGUID}
EndGlobalSection
...
Now it's up to you to write some exe, reading the folder info of the libs from the disk and write according Project-Folder Infos in the sln. This should not be a huge effort :)
So whenever you collect multiple projects to your solution, you hit your ext tool and have the connected projects structured fine.
And still I might be on a false track understanding your issue:)
I have to "look in:" a subfolder of the project because the entire project is very large and takes too long to search through.
I also have AnkhSVN installed and wonder if a setting in the plugin could help too.
If you use "Find in files" instead of the standard search, you can search a subfolder for file types you specify.
However, it's a lot easier to perform this kind of task using the Ultrafind add-on (http://visualstudiogallery.msdn.microsoft.com/9fa9fdd7-1c06-45e3-a9f3-0381caab8f94) which you can use to exclude specific file patterns.
Sadly, it seems that despite all the wonderful functionality of Visual Studio, the easiest way to omit .svn directories from searches is to use Windows Explorer to navigate to the .svn directory, right click the folder, go to Properties, and click the Hidden checkbox under Properties.
If you then re-open your Visual Studio solution, it should keep those files out of the searches.
A quick and dirty way is to simply include every other file type except .svn and .svn-base etc.
Try using this set of wildcards and add any other valid extensions beginning with S that you might need:
*.sql;*.svc;*.;*.?;*.??;*.a??;*.a???;*.a????;*.b??;*.b???;*.b????;*.c??;*.c???;*.c????;*.d??;*.d???;*.d????;*.e??;*.e???;*.e????;*.f??;*.f???;*.f????;*.g??;*.g???;*.g????;*.h??;*.h???;*.h????;*.i??;*.i???;*.i????;*.j??;*.j???;*.j????;*.k??;*.k???;*.k????;*.l??;*.l???;*.l????;*.m??;*.m???;*.m????;*.n??;*.n???;*.n????;*.o??;*.o???;*.o????;*.p??;*.p???;*.p????;*.q??;*.q???;*.q????;*.r??;*.r???;*.r????;*.t??;*.t???;*.t????;*.u??;*.u???;*.u????;*.v??;*.v???;*.v????;*.w??;*.w???;*.w????;*.x??;*.x???;*.x????;*.y??;*.y???;*.y????;*.z??;*.z???;*.z????;*.0??;*.0???;*.0????;*.1??;*.1???;*.1????;*.2??;*.2???;*.2????;*.3??;*.3???;*.3????;*.4??;*.4???;*.4????;*.5??;*.5???;*.5????;*.6??;*.6???;*.6????;*.7??;*.7???;*.7????;*.8??;*.8???;*.8????;*.9??;*.9???;*.9????;
(I had to use various combinations of ? instead of a single * because the final extension could still be .svn)
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