title: “Object does not match target type” when calling generic method with reflection
body: <p>I've searched a few different posts about a similar issue but none seem to solve my particular issue (though I believe they can't be far off).</p>
  
  <p>The below link is the closest version to my problem</p>
  
  <p><a href="https://stackoverflow.com/questions/41970341/object-does-not-match-target-type-when-calling-methods-using-string-in-c-sharp">&quot;Object does not match target type&quot; when calling methods using string in C#</a></p>
  
  <p>The only difference between my issue and the one in the link is that I am calling a generic method.</p>
  
  <p>When I make my call I get the error "Object does not match target type” but the types, form what I can tell definitely match.
  Here is sample code for which I have reproduced my problem.</p>
  
  <p>Any help would be appreciated</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          var obj = new SerializeObject();
          var serializer = new Serializer();
  
  
          var serialiserType = serializer.GetType();
          MethodInfo method = serialiserType.GetMethod("Deserialize");
          if (method == null)
          {
              return;
          }
  
          var t = obj.GetType();
          MethodInfo genericMethod = method.MakeGenericMethod(t);
          var tmp = genericMethod.Invoke(obj, new object[] { "Test" }); //error here
      }
  }
  
  public class Serializer
  {
      public T Deserialize&lt;T&gt;(string value) where T : new()
      {
          return new T();
      }
  }
  
  public class SerializeObject
  {
  
  }
  </code></pre>