title: C# Implementing DllMain with DllExport
body: <p>I'm using <a href="https://www.nuget.org/packages/UnmanagedExports" rel="nofollow noreferrer">UnmanagedExports</a> By RobertGiesecke </p>
  
  <p>I want to export <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms682583(v=vs.85).aspx" rel="nofollow noreferrer">DllMain</a> entrypoint. </p>
  
  <p>Here what I've tried </p>
  
  <pre><code>[DllExport("DllMain", CallingConvention.StdCall)]
  public static bool DllMain(IntPtr hModule, uint dwReason, byte[] lpReserved)
  { 
    // I Write a text to file here
    return true; 
  }
  </code></pre>
  
  <p>Then I call <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms684175.aspx" rel="nofollow noreferrer">LoadLibrary</a> but nothing happens. Any solution?</p>