I am trying to make a Windows Universal App for Windows 8.1 and Windows Phone 8.1.
Here is an example class of my problem, I use the int type as an example, but the error exists regardless of the class that I use:
using System; using System.Collections.Generic; using System.Reflection; using System.Text; namespace myTtrpgHelper { class testClass { void testMethod() { int c = new int(); Type type = c.GetType(); TypeInfo typeInfo = IntrospectionExtensions.GetTypeInfo(type); PropertyInfo[] p = typeInfo.GetProperties(); PropertyInfo[] p2 = type.getProperties(); PropertyInfo[] p3 = typeInfo.GetFields(); PropertyInfo[] p4 = type.GetFields(); } } }
GetProperties and GetFields display errors:
'System.Reflection.TypeInfo' does not contain a definition for 'GetFields' and no extension method 'GetFields' accepting a first argument of type 'System.Reflection.TypeInfo' could be found (are you missing a using directive or an assembly reference?)
The msdn page http://msdn.microsoft.com/en-us/library/system.reflection.typeinfo.aspx says that it should be supported, I am using visual studio 2013.
source share