I have one static class that I need to initialize some code during the class used for the first time and de initializes when the application process dies. Actually, the init method calls the native C++ apis using the PInvoke method. I know I can use static constructor but now I need to call a native de-init method at the end,
public static class MyClass
{
static MyClass()
{
MyInitFirstTime();
}