DisplayAttribute Is not working in Release mode .

I have a model which have the DisplayAttribute but when i tried to read it using reflaction runtime i didn't get though CategoryAttribute is available.

When i run the same code in debug mode by check use shared suntime works fine.

            var display = DestinationTypeModel.GetType().GetTypeInfo().GetProperty(prop.Name).GetCustomAttribute<DisplayAttribute>();
            var cat = DestinationTypeModel.GetType().GetTypeInfo().GetProperty(prop.Name).GetCustomAttribute<CategoryAttribute>();

Any help would be appreciated.

Thanks in advance.


Sign In or Register to comment.