Microsoft 9GD00001 Computer Accessories User Manual


 
116 Microsoft Visual Studio 2010: A Beginner’s Guide
VS will update the Solution Name with the same name. In a multiproject solution, this
might not make sense. So, first type the project name and then you can provide a name for
the solution that is more appropriate. In Figure 5-1, you can see that the project is named
ProjectDemo and the solution is named SolutionDemo. VS allows you to put spaces in
the names. A consequence of this is that the default namespace for a project will use the
project name with spaces translated to underlines; something to be aware of if your coding
conventions don’t allow underlines in identifier names.
If you have a very simple project and want all project files in the same folder, uncheck
Create Directory For Solution. However, most applications you build will have multiple
projects and leaving this box checked makes more sense because it maintains consistency
between folder and solution organization. In any case, when an additional project is added
to your solution, VS will always put the new project into a separate subfolder.
If you check Add To Source Control, VS will open a window for you to configure source
control. Source control is a repository for you to check code into. This is especially useful
for teams where each developer can check in his or her code for a common repository of
source code for this solution when you create the solution. Click OK to create the solution.
TIP
If you accidentally start a project type that you didn’t intend, select File | Close Solution
and then delete the solution folders from the file system. VS will often put OS locks on files,
so it’s important to close the solution so that you will be able to delete files. The VS Recent
Projects list will have an entry with the name of the solution you just deleted, but you can
click that entry and VS will recognize that the solution no longer exists, prompting you
to remove the entry from the list. After that, you can start over again and use the same
solution/project name you intended, but with the right project type.
Starting a new Console project in VB, you only need to provide a Name parameter,
which is the name of the project to create. Once the project is created, the first time you
create the project, you’ll receive a window that asks you for Name, Solution Name,
Location, Create Directory, and Add To Source Control options that work the same as
described for the previous C# example. You’ve accomplished the same task, regardless of
language, but in different ways.
Navigating the Solution Explorer
VS creates a new project in the Solution Explorer window, shown in Figure 5-2. While
other VS windows provide specialized views into specialized parts of an application, the
Solution Explorer window is where you can find all of the artifacts of an application.
One of the first features of the project shown in Figure 5-2 is the hierarchical relationships.
You will have only one solution. VB doesn’t show the solution file by default, but you can