I am building new application for Desktop, Windows 8 store and Windows phone at the same time. so I created Portable Class library to have common functionality across all platforms. my problem is that when I try to reuse my code inside PCL I can not access some methods and properties inside library. According to MSDN those methods are supported but I do know now why I can not access them.
var property = memberExpression.Member as PropertyInfo;
if (property == null)
{
}
var getMethod = property.GetGetMethod(true);
if (getMethod.IsStatic)
{}
here is the fragment of the code that can not be compiled. GetGetMethod and IsStatic are in red inside Visual Studio editor. I have no idea why is that happening and how to access those properties.
so please if anyone out there has ever done something like that, help me to make this code compile.
http://blogs.msdn.com/b/dotnet/archive/2012/08/28/evolving-the-reflection-api.aspx
. Notably: GetMethod and siblings are no longer available. Use theDeclaredMethod(s)
property instead (available onTypeInfo
instances, which you can get from a type instance using.GetTypeInfo()
). – Morten MertnerWriting code for the new reflection API – Windows Store and Portable Class Library
to find the information you need (but I'd recommend reading the whole blog post). – Morten Mertner