title: What is the purpose of external static constructors in C#?
body: <p>Accordingly to the section "10.12 Static constructors" of "C# Language Specification. Version 5.0" static constructor can be marked with "extern" modifier and in this case it's said to be an <em>external static constructor</em>.</p>
  
  <p>The ordinary (non-external) static constructors are well known. They are used to initialize static fields and properties.</p>
  
  <p>The external static methods are often used to call native functions via P/Invoke.</p>
  
  <p>And I'm also aware of quite esoteric <em>extern</em> constructors (see also <a href="https://stackoverflow.com/questions/2385589/purpose-of-c-sharp-constructor-extern-modifier">this question</a>). For instance, <code>String</code> class has several such <a href="https://github.com/dotnet/coreclr/blob/505d2266d4d10229105408c6f803acb5a017b0fa/src/mscorlib/src/System/String.cs#L208" rel="nofollow noreferrer">declarations</a>, these constructors are implemented by the runtime.</p>
  
  <p>But are the any real usages of external static constructors? I've searched through the <a href="https://github.com/dotnet/coreclr" rel="nofollow noreferrer">coreclr repo</a> and found nothing. The language specification couldn't give a description to some construct that has never ever been used in the wild. Or could?</p>
  
  <p>My guess: C# has external static constructors just because CLR supports them (in principle).</p>