Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
A complex business application might consist of dozens of projects, thousands of code files, and hundreds of ancillary items. With so many files loaded into Visual Studio, you need a way to understand the chaos and navigate through your assets. The Solution Explorer is the tool that tames this potential mess. I'm inside Visual Studio, and I am going to create a brand-new project, and then we are going to look at it over here in the Solution Explorer, which is usually docked to the right edge of the screen.
Before I talk about Solution Explorer, let me talk about the difference between a solution and a project. A solution, in .NET terms, is an item that can contain zero or more projects. A project, in .NET terms, is a section that contains many files that are used to construct a .NET assembly. Let me show you how that works. I'm going to go to the File menu and choose New > Project.
I am going to create a C# console application. Down here at the bottom of the screen, I can give my project--which is a container for files and compilation instructions--a name. I am going to call this one FirstConsole, and I am going to save it out in my Exercise File folder. So I am going to choose Browse, and then I will go to my desktop and find Exercise Files, chapter 2.
And I am going to create a new folder in here, 02, since we are in the second movie in this chapter. And then I will select the folder. Okay. Now here is the key part. Down at the bottom is the name of the Solution. The Solution contains zero or more projects. In this case it's going to create a project called FirstConsole, and the name of the solution will be exactly the same. Over here you can see that I have a choice to create a directory for the solution files. There are typically two files affiliated with a solution: an FLN file and an SUO file.
Those will go in a separate directory. I am going to click OK, and there is our project. It's a console application. It shows the FirstConsole project. In the Solution Explorer, it's inside the FirstConsole Solution. Another common pattern is to create a stand-alone solution first. Let me show you how to do that. File > New > Project. Then I will scroll down to the Other Projects Types node and then I am going to choose Visual Studio Solutions.
I will pick Blank Solution, and then I'll choose the name of the solution: FirstSolution. If you are following along, click OK. What's the difference? Look inside the Solution Explorer. There is only a solution. There are no other files. I'm going to add two projects to this solution. My favorite way to do that is to right- click here in the Solution Explorer and choose Add, but there are other ways to do this. I am going to choose Add > New Project, which takes us back to the same dialog we saw a minute ago.
This time I'm going to create a Visual Basic application. Again, I am going to create a Console Application, so I will call this project ConsoleVB. I'll click OK, and over here in the Solution Explorer, you will now see one project. Note that the file ends with .vb, which signifies that it contains Visual Basic code. And now I am going to go up to my Solution one more time, right-click, choose Add > New Project.
I will pick the C# language, and then Windows, and then I think I'll choose the WPF Application. I will call this one WpfAppCS and click OK. So let's review what I've done. I created a blank solution and called it FirstSolution.
I added a Visual Basic Console application to it, and I added a WPF C# application to it. Now I am going to save this file, and then I am going to go out to my hard drive and show you how the Solution Explorer mimics the same settings that you have inside your hard drive. I am going to right-click on my solution, and I'm going to go down and choose Open Folder in Windows Explorer. Here is what I want you to see. There is an SLN file that you typically use to load the solution, and that contains instructions to tell it open this folder, which contains the vbproj file.
The vbproj file contains all the information about what to load for this project. Also in the C# folder here, there is a csproj file, which contains all the instruction about what to load for that project. So Visual Studio uses the SLN and csproj and the vbproj and other proj files to figure out what to actually load into Visual Studio and to show in the Solution Explorer. Now, you can see there are some hidden files, like there's this bin folder; that doesn't show up over here in the Solution Explorer.
That's because Microsoft has decided they don't want to show you that by default. I can enable that by coming over here and clicking on the Show All Files, and then you can see the bin and object folder show up there. So it basically mimics the file system. Not only can you add files to your project, but one more thing you can do is you can add references of other precompiled assemblies. That's why I have this Reference folder. I can right-click here and choose Add Reference, and now I can go out and add other .NET libraries of this project.
I have more details about how to do this in other movies in this series. Creating a project is easy, but it's not something that you do everyday. I'd say that you are more likely to open an existing project over and over again, so that's the topic of the next movie in this chapter.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 104937 Viewers
56 Video lessons · 116780 Viewers
71 Video lessons · 85989 Viewers
131 Video lessons · 41127 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.