A namespace (namespace) can be thought of as a "container" for a class, which can contain multiple classes, and a generic reference method is to use a using statement at the beginning of the source code. Namespaces can be nested,
Declaring a method: the outermost namespace inside a layer namespace. Class name custom name = new outermost namespace inner layer namespace. Class name ();
class Library is equivalent to an assembly --in order to improve the efficiency of software development, people have applied the modularization principle of software engineering extensively, reused existing modules, developed some new modules, and finally assembled the old and new modules.
How to build a class library:
(1) Right click on the solution and click "New Project ..." as shown.
(2) Select the class library, give the class library a name, choose a good save location, click OK
(3) After successful establishment, write the required method in the class library, then refer to--1, add Class Library 2 in the reference, and write the using statement in the code.
The methods of the area classification library items, assemblies, namespaces:
(1) After each class library project is compiled, an assembly is generated
(2) You can have more than one class in a class library project that can belong to a different namespace
(3) Different class library items can define the same namespace
In general, a "namespace" is a logical concept, and its physical carrier is "Assembly", which is embodied as a "DLL" (or EXE) file. In Visual Studio, you can build an assembly by creating a project of type class library. An assembly can have more than one namespace, and a namespace can be distributed across multiple assemblies.
Namespaces and class libraries