Extending and Organizing Your Solution
The project/solution management tasks in Rider, such as browsing files and opening them in the editor, creating new items (directories, files, classes, etc.), are performed in the Explorer window. If you close this window, you can always bring it to view by pressing Alt+2 or choosing in the main menu. You can use the switcher at the top of this window to switch between different views:
Solution view, which contains the solution node with an organized logical view of projects and project items in the current solution, as defined in its .sln file.
FileSystem view, which shows you all files and subdirectories starting from the directory where the current solution file is located.
Unity view, which provides an organized view of all assets in a Unity project (you see exactly the same project tree as in the Unity editor). This view is only available for Unity projects.
To rename projects in your solution, use the Rename refactoring (N/A or ). You will also be able to rename the project folder and the project's root namespace as well as all its usages in the solution.
Adding code and resources
In JetBrains Rider, all code and resource files are added using editable file templates. When you choose the node in the Solution Explorer where you want to add a new file, just press Ctrl+Alt+Insert or right-click and choose Add, and then pick the desired template for the new file.
File templates are configurable on language-specific pages under thepage of JetBrains Rider settings (Ctrl+Alt+S).
Adding project and assembly references
Rider allows adding references to other projects in your solution as well as to standard .NET Framework assemblies by right clicking a project node and selecting Add From... button can be used to reference a file on disk.. The resulting dialog can be searched, just by typing, or the
Adding external files and folders
With Rider, you can extend solutions by adding external files and folders. For example, you can have your test data, logs, or any other files and folders right next to your solution. These additional items in the solution are not saved in project or solution configs, but rather in Rider's own settings.
External items in the solution are indexed by Rider, so you can enjoy instant search (Ctrl+Shift+F) and navigation (Ctrl+T) among other things for those items. However, external solution items will stay beyond the scope of your solution when you perform any of the solution-wide refactorings.
For external solution items that share their VCS root with the solution, all version-control features will also be available.
To add an external folder to the current solution, right-click on the solution in the Explorer window, choose , and then select a folder. The folder will appear in the Solution Explorer marked as attached:
Please note the difference between adding external folders to your solution and adding existing files/folders/projects to your solution.
The latter is done by choosing Add | Add Existing Project from the context menu on the solution or solution folder, or by choosing Add | Add Existing Item from the context menu on a project or folder — these kinds of modifications are saved in solution and project configs so you will also see the added items if you open the solution in Visual Studio.
When working with external items in the extended solution, note the following:
To remove an external directory from the solution, right-click on it and choose Detach Folder. The external directory will be removed from the solution view, but not from disk.
Grouping related files
It is often very convenient to group related files — e.g. layout and code-behind files in WinForms, WPF, ASP.NET projects — within a single collapsible item in the Solution Explorer.
JetBrains Rider provides two ways of grouping related files:
DependentUponelement in the project file.
You can use drag-n-drop in the Solution Explorer to arrange related files in any way you see fit. JetBrains Rider will make necessary changes in the project file to keep the desired nesting layout. As the
DependentUponis the standard project property, your nesting layout will be preserved if you open the project in Visual Studio. On the downside, you have to make the necessary arrangements manually.
Using file nesting preferences.
JetBrains Rider provides a default configuration of file types and typical suffixes that are used for related file types — for example, a file with the .map.ts suffix is normally related to a file having the same name and the .ts extension — such files will be automatically grouped in the Solution Explorer.
You can configure these relations or disable logical nesting altogether by clicking on the toolbar of the Solution Explorer. Grouping of files in this way will not make any changes in your project/solution config files.
Browsing non-solution files and folders
One way of exploring non-solution items is to add external items to your solution. But JetBrains Rider also allows you to open and explore any files and folders even without any solution being open. This way you can work on web projects that do not have a .sln file or just study any text file in the editor.
To open a file or a folder, press Ctrl+O or choosefrom the main menu. Depending on what you choose, JetBrains Rider will do one of the following:
A file will be just opened in the editor but not added to the solution view.
If you choose to open a folder while a solution is loaded, JetBrains Rider will suggest that you either close the current solution and open it in the current window or open the folder in a new application window.
If the selected folder or any of its subfolders contains a .NET solution (.sln file), you will be able to pick one of them and open the solution instead of folder.
But if you still want to browse the folder, click Just open the directory. In this case JetBrains Rider will not analyze .NET code.