C# MethodInfo在使用包含引用类型的参数调用getMethod时显示null

C# MethodInfo在使用包含引用类型的参数调用getMethod时显示null,c#,reflection,C#,Reflection,mi为空事件houghelementA.getMethods()显示GetString方法。我想我的参数attributeA有问题 如果我使用typeof(System.Object)而不是attributeA,它仍然返回null 在这种情况下,请建议如何正确使用GetMethod。我认为这是由ref参数引起的 public abstract class DbAttribute : IComparable { } public abstract bool GetString(DbAttr

mi
为空事件hough
elementA.getMethods()
显示
GetString
方法。我想我的参数
attributeA
有问题

如果我使用
typeof(System.Object)
而不是attributeA,它仍然返回null


在这种情况下,请建议如何正确使用
GetMethod

我认为这是由ref参数引起的

 public abstract class DbAttribute : IComparable
 {
 }

public abstract bool GetString(DbAttribute attributeName, ref string attributeValue);

Assembly testAssembly = null;
Type attributeA = testAssembly.GetType("A.Core.Data.DbAttribute");   
Type elementA = testAssembly.GetType("A.Core.Data.DbElement");

MethodInfo mi = elementA.GetMethod("GetString", new Type[] { attributeA, typeof(System.String)});

我认为这是由ref参数引起的

 public abstract class DbAttribute : IComparable
 {
 }

public abstract bool GetString(DbAttribute attributeName, ref string attributeValue);

Assembly testAssembly = null;
Type attributeA = testAssembly.GetType("A.Core.Data.DbAttribute");   
Type elementA = testAssembly.GetType("A.Core.Data.DbElement");

MethodInfo mi = elementA.GetMethod("GetString", new Type[] { attributeA, typeof(System.String)});

我认为这是由ref参数引起的

 public abstract class DbAttribute : IComparable
 {
 }

public abstract bool GetString(DbAttribute attributeName, ref string attributeValue);

Assembly testAssembly = null;
Type attributeA = testAssembly.GetType("A.Core.Data.DbAttribute");   
Type elementA = testAssembly.GetType("A.Core.Data.DbElement");

MethodInfo mi = elementA.GetMethod("GetString", new Type[] { attributeA, typeof(System.String)});

我认为这是由ref参数引起的

 public abstract class DbAttribute : IComparable
 {
 }

public abstract bool GetString(DbAttribute attributeName, ref string attributeValue);

Assembly testAssembly = null;
Type attributeA = testAssembly.GetType("A.Core.Data.DbAttribute");   
Type elementA = testAssembly.GetType("A.Core.Data.DbElement");

MethodInfo mi = elementA.GetMethod("GetString", new Type[] { attributeA, typeof(System.String)});
typeof(AttributeA)仍然不能工作。然而,makebyreftype是答案。干杯你让我开心。谢谢feiyun0112typeof(AttributeA)仍然不能工作。然而,makebyreftype是答案。干杯你让我开心。谢谢feiyun0112typeof(AttributeA)仍然不能工作。然而,makebyreftype是答案。干杯你让我开心。谢谢feiyun0112typeof(AttributeA)仍然不能工作。然而,makebyreftype是答案。干杯你让我开心。谢谢你,飞云0112