Visual Studio 2013 - navigating among many projects - visual-studio

Complex solutions usually contains several projects.
Currently I have more than 30 projects in a solution.
Some of the projects could contain many files inside (up to 1000 or more).
So when you open files from different projects all this stuff is expanded.
So if I want to find some file using solution explorer I need to scroll forever until it will be found.
Of course it is possible to navigate to it using Resharper's Ctrl+T but this is not related to those files you don't remember names but remember in which project and in which folder it is located.
I've tried to find some extension which could create tabs from projects but unfortunately unsuccessfully.
So is there any way to effectively navigate in such scenarios?

Some ideas:
Organize files into folders so that you don't have more than a few folders open when working on any given feature
Forget files; instead, navigate to class by name. Ctrl+, is the default shortcut.
Use F12 to go to definition; this also avoids having to find the file.
Search by keyword. Ctrl+Shift+F finds in all files. You just need to remember something from the file; it doesn't have to be the file name.
Enable "Track Active Item in Solution Explorer" in Options / Projects & Solutions / General. This keeps the file that is being edited selected in the solution explorer (but does lead to lots of folders expanding all the time).
Conversely, disable "Track Active Item", then you'll be in charge of what folders are expanded. Try both, see which one works best.
Use Solution Folders, which enable you to place several projects into a folder.

Related

Exclude folder(s) in VS 2019 Find in Files

...yes I know this is an old tune, but I would like to make it specific to the newest tool, and also put in context and emphasize the issue. Doing this in hope that soon we will have a working solution.
Context
In many web projects there are zillions of library files like jquery, bootstrap etc. To make it worst, there are the .min. siblings, what are one liner, so editor killers. Usually we do not want to search within those files and it is a productivity killer, especially if one accidentally clicks on a found .min. file which freezes the editor when opens...
Question
Is there any way to define and exclude folders in a project or solution when using VS 2019 Find in Files?
If you press the button to the right of the "Look In" drop down:
you can select a set of folders to use. This set of folders can be saved for future use (ie. the lack of ability to include a parent folder and then exclude a child is not as bad as it could be).

re-including the entire contents of a folder in visual studio 2013

I have an included folder in visual studio, which contains mainly javascript files, CSS, images, etc. These are not required for the website to run, and are altered not from Visual Studio but from other external processes.
I've been publishing to Windows Azure Websites, which require all files to be included so that they are uploaded as part of the package.
Is it possible to somehow click on a folder in the Solution Explorer, and 're-include' all it's contents?
The only option I found right now is to exclude and re-include, which due to the amount of files takes quite some time. It takes ages to 'exclude' the folder. Then, once it's ready I have to re-include which takes a long time as well. Would like to at least do them in one operation.
Was wondering if there was a better process somehow.
I'm not quite sure why you have exclude them all and include them again. Is it because the file names change or new files created often? If the file names stay the same and just the contents are changing you should not have to re-include them. If the external processes create new files now and then, then you should be able to click the "Show all files" option in solution explorer and then when you load the solution check the directory in solution explorer and any new files there include them.
hope that helps in some way. :)

Visual Studio 2012 - Hide folders from solution explorer?

Is it possible to hide folder in Visual Studio 2012 solution explorer window? I have multiple folders/files that I don't plan to use and they are just cluttering the interface and it's harder to find things.
It just seems pretty illogical that you can toggle "Show Hidden Files" but you cannot actually hide any files.
Example
Why
WebApi project includes automated help generation that I want to use, however it includes multiple folders that it needs to function. All I care about is Controllers/Models since I'm building the Api itself. But if I delete/remove from project those files than help generator won't work.
Since you want the files to still be accessible, as opposed to just excluding them, you can modify the csproj file itself. Unload your project from the solution, right-click and select edit. Scroll down to where your folders are displayed (I tested with a folder called "TestFolder" and a file within it called TestClass.cs.
<Compile Include="TestFolder\TestClass.cs">
<SubType>Code</SubType>
</Compile>
Create a new child tag called Visible and set the value to false.
<Compile Include="TestFolder\TestClass.cs">
<Visible>false</Visible>
<SubType>Code</SubType>
</Compile>
Save and reload the project and the files should no longer be visible but accessible. I just did a quick test and it seemed to work fine (but YMMV).
Hiding folders is almost certainly a bad idea. Remember that hiding a folder is not the same as excluding it from the solution - all hidden items can still be used elsewhere in the code, can be referenced by the build, and get updated when you pull the latest version from source control.
That is the reason why it was never available for project folders - so that people cannot easily confuse their workmates.
Having said that, it is possible to hide folders on the solution level - I guess mostly because it's quite common to have documentation, shared libraries etc on that level. To hide a solution folder, you right click on the folder, and select "Hide Folder" (to unhide, you'd right click on the solution itself and select "Unhide folders")
As for your screenshot where you want to hide Area, Scripts etc - I suspect you're working alone and just started learning MVC - otherwise it wouldn't make sense to hide those folders. They contain legitimate code which is used to run the application. Hiding it is the same as hiding Program.cs in a console project for the sole reason that you prefer a smaller tree in the solution.
I do agree that Solution Explorer becomes unmanageable at some point - but instead of messing up with it, I'd recommend to try other tools - Visual Studio "navigate to" options or Resharper (I use the latter).
I don't know if it's the same way in VS 2012, but in VS 2010, I just right click on the folders (and, in some cases, files) that I don't want and exclude them from the solution.
I'm not sure if this is a new feature but you can hide folders from solution explorer without excluding or deleting them.
On VS 2017 (15.5.5)
Just right click on any solution folder and click "Hide Folder"

How do I show the References folder in Solution Explorer without selecting 'Show All Files' in a VB.NET project?

As I compare many C# example projects to my VB.NET projects, I see that the References folder shows in the Solution Explorer without having to select "Show All Files". Is it possible to have this for a VB.NET project as well? I find that it would be very helpful to have this folder displayed without having to see all the other hidden files as well.
I'm using VS2010 Professional.
This adds to my list of reasons why I should have learned C# first...
I guess I will have to definitively crush your dream. Sorry. It has been a decision by Microsoft to remove this from the default view to reduce the 'clutter'. However, your 'Show All Files' setting will persist when you save your project. So if you show all files once and then save, then it will always be on.
You can also see your References in the Project designer, which you can always keep open in a tab.
As of Visual Studio 2015, this behavior has been changed to show the References folder without selecting Show All Files.
From MSDN:
What’s new is the References node. This used to be hidden and you had to click Show All Files to see it—but that also showed lots of irrelevant files.
This previous behavior might have made sense 10 years ago when you’d start with a Windows Forms project and it would generally have the right set of references. But it’s a reality of modern development nowadays that the References node is used frequently—especially to manage NuGet references. It’s a small but handy convenience to be able to find it easily in Solution Explorer.
I add a separate folder called Dependencies, add my dll's to it and check them in as described here. That way my dll's are always visible in the Solution explorer without having to turn on Show All Files.
Select 'Show All Files option' in the solution explorer.

How do you exclude .svn directories from search in Visual Studio?

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)

Resources