Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User Defined ClassLoader In C#

Tags:

c#

Inspired by this question why do we need user defined classloader in java

Does C# have a way of defining a way to load classes and dlls on demand

like image 963
Jack Kada Avatar asked Aug 24 '10 12:08

Jack Kada


People also ask

What is ClassLoader in C?

A class loader is an object that is responsible for loading classes. The class ClassLoader is an abstract class. Given the binary name of a class, a class loader should attempt to locate or generate data that constitutes a definition for the class.

What is ClassLoader and its types?

The Java ClassLoader is a part of the Java Runtime Environment that dynamically loads Java classes into the Java Virtual Machine. The Java run time system does not need to know about files and file systems because of classloaders. Java classes aren't loaded into memory all at once, but when required by an application.

What is the use of ClassLoader?

Class loaders are responsible for loading Java classes dynamically to the JVM (Java Virtual Machine) during runtime. They're also part of the JRE (Java Runtime Environment). Therefore, the JVM doesn't need to know about the underlying files or file systems in order to run Java programs thanks to class loaders.


1 Answers

You can handle the AppDomain.AssemblyResolve event to manually load assemblies that the runtime cannot locate by itself.

like image 77
SLaks Avatar answered Oct 07 '22 18:10

SLaks