CHAPTER 14 BUILDING AND CONFIGURING CLASS LIBRARIES
// 3D Square class.
public class Square{ }
}
Given that you have now nested the My3DShapes namespace within the Chapter14 root namespace,
you need to update any existing using directives and type aliases, like so:
using Chapter14.My3DShapes;
using The3DHexagon = Chapter14.My3DShapes.Hexagon;
The Default Namespace of Visual Studio
On a final namespace-related note, it is worth pointing out that, by default, when you create a new C#
project using Visual Studio, the name of your application’s default namespace will be identical to the
project name. From this point on, when you insert new code files using the Project Add New Item
menu selection, types will automatically be wrapped within the default namespace. If you want to
change the name of the default namespace, simply access the Default namespace option using the
Application tab of the project’s Properties window (see Figure 14-1).
Figure 14-1. Configuring the default namespace
With this update, any new item inserted into the project will be wrapped within the
Chapter14.CoreLogic namespace (and, obviously, if another namespace wishes to use these types, the
correct using directive must be applied).
So far, so good. Now that you have seen some details regarding how to package your custom types
into well-organized namespaces, let’s quickly review the benefits and format of the .NET assembly. After
this, we will delve into the details of creating, deploying, and configuring your custom class libraries.
509