title: Call non-static member of static property in static class with reflection
body: <p>I have a static class which looks for an implementation of an abstract type and stores it as a static property
  similar to the below:</p>
  
  <pre><code>public static class MyStaticClass
  {
      private static MyAbstractType _MyAbstractImplementation;
  
      public static MyAbstractType MyAbstractImplementation
      {
          get =&gt; _MyAbstractImplementation ?? ( _MyAbstractImplementation = FindImplementation());
          private set =&gt; _MyAbstractImplementation = value;
      }
  }
  </code></pre>
  
  <p>And I am trying to call a method of MyAbstractImplementation (which contains no static properties or methods) via reflection:</p>
  
  <pre><code>var myAssembly = Assembly.Load("MyStaticClassAssembly")
  
  var myType = myAssembly.GetTypes().First(t =&gt; t.Name == "MyAbstractType");
  
  var myImplementation = myType.GetProperties()
      .First(p=&gt;p.ReflectedType?.Name == "MyAbstractImplementation")
      .GetValue(null);
  
  var obj = myType.GetMethod("SomeMethod")?.Invoke(
                  null,
                  new object[] 
                  {
                      // Some args
                  });
  </code></pre>
  
  <p>The above code causes the following exception on getting the value of <code>MyAbstractImplementation</code>:</p>
  
  <pre><code>System.Reflection.TargetException: Non-static method requires a target.
  </code></pre>
  
  <p>Evidently, this is because I am passing null to <code>GetValue()</code>, so I try passing <code>myAssembly</code> rather than null and I get the following exception:</p>
  
  <pre><code>System.Reflection.TargetException: Object does not match target type.
  </code></pre>
  
  <p>Out of desperation, I try passing <code>myType</code> and <code>myImplementation</code> but I still get the same exception.</p>
  
  <p>What am I meant to be passing to <code>GetValue()</code>?</p>