I am trying to get the properties of the FontWeights
class in C# using reflection.
var properties = typeof(FontWeights).GetProperties();
var dialog = new MessageDialog("Number of weights: " + properties.Length);
await dialog.ShowAsync();
When built with Debug configuration, the above works as expected. However, when using Release no properties are found.
Why is it so? Is there a way around it?
It's an UWP app.
BindingFlags
explicite will help:typeof(FontWeights).GetProperties(BindingFlags.Instance | BindingFlags.Public);