title: Are static members stored at fixed locations in .NET?
body: <p>Consider the following code:</p>
  
  <pre><code>class Foo
  {
      static readonly Guid guid = Guid.Parse("...");
  }
  </code></pre>
  
  <p>Can the underlying address of the static <code>guid</code> field change after initialization? If not, how can this address be obtained?</p>
  
  <p>What about constants?</p>
  
  <p>Note: I understand that reference types in general can be moved around by the GC (regardless of whether there's a static variable with a handle to them), but how does this work for static value types and constants?</p>
  
  <p>This question came up as we're working on some code that requires interop with an unmanaged API, and we'd like to avoid doing an extra copy of the bytes into HGlobal if they're already at a fixed address in memory to begin with.</p>
  
  <p>I'm more interested in knowing what the CLI standard says about this (versus what a specific .NET implementation <em>does</em>), since I prefer robust code that doesn't rely on a coincidental implementation detail.</p>