tags:

views:

85

answers:

1

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

+6  A: 

No.

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

SLaks
That's what I'm currently using - wondered if there is something better...
Eran Betzalel
Why? What' wrong with it?
SLaks
"execute the first time"... make that "execute *before* the first time *any other member is accessed* ".
Richard
@SLaks, because it depends on a class rather than the DLL itself, which is fine and working, but not perfect, not as it suppose to work.
Eran Betzalel