Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there OnLoad event for C# libraries?

Tags:

c#

.net

dll

I want to initialize my C# library as it loads by another process, is it possible and if so - how?

like image 517
Eran Betzalel Avatar asked May 30 '10 14:05

Eran Betzalel


1 Answers

No.

Instead, you can add a static constructor to your class, which will execute the first time that the class is used.

like image 199
SLaks Avatar answered Sep 23 '22 09:09

SLaks