-
Notifications
You must be signed in to change notification settings - Fork 564
Closed
Labels
Area: Mono RuntimeMono-related issues: BCL bugs, AOT issues, etc.Mono-related issues: BCL bugs, AOT issues, etc.
Description
Android application type
Android for .NET (net6.0-android, etc.)
Affected platform version
VS 2022 17.3.5
Description
Type.GetRuntimeProperties(), Type.GetProperties(..), etc. don't return internal properties that are defined in a base class of the given type when running on net6.0-android. When I run the same code as a net6.0 console application or a Xamarin.Android app, the properties are correctly returned.
Steps to Reproduce
- Create a new .NET 6 Android application. Add the code below and run the
Test.Executemethod.
public static class Test
{
public static void Execute()
{
var obj = new Class2();
var properties = obj.GetType().GetRuntimeProperties();
var names = properties.Select(x => x.Name).ToList();
Console.WriteLine($"Found {names.Count} properties: {string.Join(", ", names)}");
// Xamarin.Android: Found 2 properties: TestProp2, TestProp1
// net6.0: Found 2 properties: TestProp2, TestProp1
// net6.0-android: Found 1 properties: TestProp2
}
}
public class Class1
{
internal int TestProp1 { get; set; }
}
public class Class2 : Class1
{
internal int TestProp2 { get; set; }
}
Did you find any workaround?
No response
Relevant log output
No response
Metadata
Metadata
Assignees
Labels
Area: Mono RuntimeMono-related issues: BCL bugs, AOT issues, etc.Mono-related issues: BCL bugs, AOT issues, etc.