Skip to content

Commit 24b53b5

Browse files
Set bindingflags required by netstandard2.0 impl of GetProperty
1 parent 7600860 commit 24b53b5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

ICSharpCode.CodeConverter/CSharp/MethodInfoExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private static TDesiredFunc CreateOpenInstanceDelegateForcingType<TDesiredFunc>(
6363
public static MethodInfo ReflectedPropertyGetter<TInstance>(this TInstance instance,
6464
string propertyToAccess)
6565
{
66-
var propertyInfo = instance.GetType().GetProperty(propertyToAccess);
66+
var propertyInfo = instance.GetType().GetProperty(propertyToAccess, BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);
6767
return propertyInfo?.GetMethod.GetRuntimeBaseDefinition();
6868
}
6969
}

ICSharpCode.CodeConverter/Util/ReflectionCompatibilityExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static FieldInfo GetField(this Type type, string name, BindingFlags bindi
6969
return type.GetTypeInfo().DeclaredFields.FirstOrDefault(f => (f.Name == name) && IsConformWithBindingFlags(f, bindingFlags));
7070
}
7171

72-
public static PropertyInfo GetProperty(this Type type, string name)
72+
public static PropertyInfo GetProperty(this Type type, string name, BindingFlags bindingFlags)
7373
{
7474
return type.GetTypeInfo().DeclaredProperties.FirstOrDefault(p => p.Name == name);
7575
}

0 commit comments

Comments
 (0)