.NET Class Loader - What is it?

前端 未结 3 575
南笙
南笙 2021-01-02 00:44

I can\'t find any good documentation on what the concept of a Class Loader is in the .NET Framework? What is it? Where can it be found? Does anyone know?

相关标签:
3条回答
  • 2021-01-02 01:09

    In .NET assemblies are the fundamental unit of deployment. The technology that actually loads the assemblies is called Fusion. For more details on that read the .NET Fusion Workshop. Each assembly has its own class loader to load types from that assembly.

    Hosting the Common Language Runtime may also be of interest.

    I don't think that Class Loader in .NET holds the same importance or power as it does in Java. The loading of the class would be handled by the assembly's class loader.

    Dynamic loading would usually be done by loading the assembly and then instantiating the class:

    Assembly assembly = Assembly.LoadFrom("assemblyName");
    Type type = assembly.GetType("className");
    object x = Activator.CreateInstance(type);
    
    0 讨论(0)
  • 2021-01-02 01:10

    What do you mean? A similar concept to the Java class loaders? In .Net the concept is mapped to AppDomain (just search for AppDomain)

    0 讨论(0)
  • 2021-01-02 01:23

    Randy Levy's didn't answer all. Class loader did more jobs than Assembly.LoadFrom. Because there isn't a method like ‘Assembly.Unload'. The assemblies could be only unloaded by closing appdomain. Java's class loader can do lot of more than Randy Levy's answer. Here tag a better answer in stackoverflow Equivalent of Class Loaders in .NET

    0 讨论(0)
提交回复
热议问题