Re: Can you detect when your assembly is loaded?



You can use a static class constructor. The first time your class is used
the static ctor will be invoked before any of the instance methods or fields
can be accessed.

"Jeff Lar" <JeffLar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4BE69F9C-DF78-4294-A81A-0C9A1189FDC7@xxxxxxxxxxxxxxxx
>
> I'm writing a class library that will be consumed by other applications,
> both web and form, and may also be loaded dynamically. I need the assembly
> to
> perform some validation immediately after it is loaded, and possibly shut
> itself down. I cannot find an event or mechanism to detect when my
> assembly
> is loaded. Any suggestions?


.