Initialization procedure of Assembly

  • Thread starter Thread starter Alexander Muylaert
  • Start date Start date
A

Alexander Muylaert

Hi

Is their a way to perform something when an assembly is loaded the first
time? I would like to register some classes after I have (dynamicly) loaded
an assembly.

kind regards

Alexander
 
Ideal would be if I could use the static constructor.

When I load an assembly, is this constructor called for each class or is
this done when I access the class for the first time?

kind regards

Alexander
 
Hi

Thanks,

but this event is called inside the application. I would like to have
something called inside the assembly.

kind regards
 
Alexander said:
Hi

Is their a way to perform something when an assembly is loaded the first
time? I would like to register some classes after I have (dynamicly) loaded
an assembly.

kind regards

Alexander

If that would be possible, every assembly would be able to run some code
automatically at load-time. I'd rather stay in control of my app.
As you are loading the assembly dynamically, it should not be too
difficult to call on a static method (through reflection) to do some
assembly related initialization.
The previous proposal isn't that bad either.

Cheers,
Benoit
 
Back
Top