Simple comparison between namespaces and assembly

Source: Internet
Author: User
Namespace: Like folders in a hard disk, different files (classes) are stored in different folders, so that all files are piled up in one place to avoid confusion (likewise, in this way, you can create namespaces for different modules to make the class easier to manage) and avoid multiple files with the same name from being placed in one folder.ProgramSet: the DLL and exe compiled by. NET are the Assembly. Assembly includes: 1. Assembly List, including Assembly metadata. 2. Type metadata. 3. implement these types of Microsoft intermediate language (msil)Code. 4. Resource set. These two concepts are actually different and have no connection. Generally, when a class library project (DLL) is created, the Assembly file is named using the default namespace. This makes it easy for people to associate these two items.

Note: adding a reference is not equivalent to importing a namespace using the using statement. The Using statement allows you to use a class in a namespace without having to enter a long string of fully valid class names. However, if you lose a reference, you cannot use the using statement to include the corresponding namespace. For example, if the system. Web. UI namespace is introduced, you can write the page class in the code, instead of system. Web. UI. Page. However, if you do not add a reference to the system. Web. dll Assembly containing these classes, you cannot access the classes in the system. Web. UI namespace.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.