Próbuję utworzyć aplikację uniwersalną dla systemu Windows, dla systemu Windows 8.1 i Windows Phone 8.1.Reflection.Typeinfo/Reflection.Type nie ma metody GetProperties/GetFields
Oto przykład klasa mojego problemu, używam typu int jako przykład, ale błąd jest tam niezależnie od klasy używam:
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();
}
}
}
The GetProperties i GetFields zarówno błędy wyświetlania :
'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?)
na stronie MSDN http://msdn.microsoft.com/en-us/library/system.reflection.typeinfo.aspx mówi powinno być wspierane, Używam visual studio 2013.
Zmieniłem twój tytuł. Zobacz, "[Czy w tytułach pytania powinny znaleźć się" znaczniki "?] (Http://meta.stackexchange.com/questions/19190/)", gdzie konsensus brzmi "nie, nie powinien". –