title: Is it possible to create an instance of an class without running ANY code from the class? (no ctor, no field initializations)
body: <p>I have created an engine that takes in 3rd party plugins (DLL's) that implement an interface.</p>
  
  <p>Since I have no control over the code that gets plugged in, I want to be able to run 1 specific method (from the interface) from the correct class (GetTypes loop untill I find the interfaced class ).</p>
  
  <p>Since anyone can create nice constructor code that executes on <strong>Activator.CreateInstance</strong>, I can solve that by using <strong>FormatterServices.GetUninitializedObject</strong>. But that does not help when code is being initialized on fields in the class.</p>
  
  <pre><code>public class myclass : myinterface {
  
    public someotherclass name = new someotherclass()
  
    public myclass() {
       //Unknown code
    }
  
    //I only want this run.
    public string MyProperty{
      get {
        return "ANiceConstString";
      }
    }
  }
  </code></pre>
  
  <p>The problem with both ways (CreateInstance/GetUninitializedObject) is that the constructor of <strong>someotherclass</strong> will be run.</p>
  
  <p>Before you start analyze my needs. This is only run in the initializing of the engine to get a set of standard values. If this get'er relies on other initialized values the "plugin" will be marked as failed as there is no valid value returned. If not marked as failed, later on the class will be loaded properly with <strong>Activator.CreateInstance()</strong>.</p>
  
  <p>So stick to this question:
  Does .Net support any way to create an 100% non-initialized class?</p>
  
  <p>Update for the answers. I tested this before I posted my question.</p>
  
  <p>For the answer that someotherclass wont run, I allready tested that and it is run if static.</p>
  
  <pre><code>public class myclass : myinterface {
  
      static Tutle test;
  
      public myclass () {
           test = new Tutle();
      }
  
      public class Tutle {
          public Tutle() {
              MessageBox.Show("RUN!");
          }
      }
  }
  </code></pre>
  
  <p>CreateInstance shows the messagebox. GetUninitializedObject does not.</p>
  
  <pre><code>public class myclass : myinterface {
  
      static Tutle test = new Tutle();
  
      public myclass () {
      }
  
      public class Tutle {
          public Tutle() {
              MessageBox.Show("RUN!");
          }
      }
  }
  </code></pre>
  
  <p>CreateInstance shows the messagebox. GetUninitializedObject shows the messagebox.</p>
  
  <p>Is there a way to get around static field intializers and ctors?</p>