I have a dynamic-linked library in C# that will be loaded by other libs or apps. The init function needs to be called to allocate/initialize resources when the assembly(dll) is loaded and the cleanup function needs to be invoked before the assembly is unloaded.
I am looking for something in C# that is similar to DllMain
function in C++ that you can call functions in the event of DLL_PROCESS_ATTACH
and DLL_PROCESS_DETACH
.
Thanks in advance.