Assembly and Import Differences

Source: Internet
Author: User
Before the Spring Festival there are comrades to ask import and assembly differences, if literally translated into Chinese, these two really similar. But in. NET, there are two different differences, and there is a relationship.
I think;
The main parts of the. NET runtime are 1. All kinds of JIT, is compiler, compile into intermediate code;
2. Intermediate code Management, garbage collector, etc.
3. Runtime Library
The Run-time Library of the runtime is like a pool where the DLL (namespace) is invoked from the middle (system memory), no longer looking in the system, running the DLL, like the Java connection pool, the EJB container (much worse), the stored procedure. Since not most programs require DLLs for all frameworks (namespace), it is not necessary to add all DLLs (namespace) to the pool from a resource standpoint. If you install the framework, the service will automatically add a few namespace at startup, that is, automatically assembly several, such as Sql,lang,io, but other namespace like net will not start loading this requires you compile-time description, If you compile with CSC, you need to specify the location of the other DLLs. With Vs.net is also the same, if you open every project tree, under Assembly will have a system automatically loaded several namspace, if the program used the other, it will be manually added, but will not let you find the DLL, you can directly choose Namspace.

Only the system has been assembly namespace can import in the program, which is to tell the compiler, you need to runtime the library has been loaded namespace (class library), so you provide the class name (only the class name) to inherit, Synthesize the classes provided by each framework. If you are not import but use it directly, you need to use the full name of the class, which is Namespace+classname

Assembly is telling the compiler: I need the system to load a namespace (run, in system memory, pool) without a default (auto) mount.

Import is to tell the compiler: I will use a namespace already in the pool, if you find in the program (JIT) you do not know (does not appear in my program and the full name of the Class), you go to these libraries.

I hope you will correct me!!!

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.