|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to execute code when a DLL loads?Visual Studio designer loads my dll). I know about static constructors and I've tried to place the code in there, but the problem is these don't actually execute until the types they're in get instantiated. What I actually try to do is to register those types to be used in the Visual Studio designer for some third party controls. So I am running into a chicke and egg problem: I need to register my types so that they can be used in the designer, but my registration code doesn't run until somebody uses an instance of one of the types. It would be nice to have some form of an OnLoad method that would execute when a DLL first loaded, before any particular types got instantiated. Is there such a thing? I've seen this post: http://groups.google.com/group/microsoft.public.dotnet.framework/browse_frm/thread/4a31e1c3b11b60aa/dcf5a967885d63a7?q=OnLoad+dll&rnum=1#dcf5a967885d63a7 It seems to suggest such a thing exists, but doesn't explain how to get a hold of it. Please help. Thanks, Andrew |
|||||||||||||||||||||||