Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
According to MSDN, System.Type.GetNestedTypes(BindingFlags) is supported on Portable Class Library projects.
However, I am getting an error when trying to use this method on a Xamarin Studio PCL project: "Error CS1061: Type `System.Type' does not contain a definition for `GetNestedTypes' and no extension method `GetNestedTypes' of type `System.Type' could be found. Are you missing an assembly reference? (CS1061)"
I am using the following Project Options:
4.5 - Profile78
.NET Framework 4.5 or later
Windows Phone 8
Windows Store apps (Windows 8)
Any idea how to make this work?
I have checked this issue with following build:
X.S 4.2.4(build 17)
I am also not seeing System.Type.GetNestedTypes. However this is present in Visual Studio.
> According to MSDN, System.Type.GetNestedTypes(BindingFlags) is supported on
> Portable Class Library projects.
You seem to be missing ; presumably, it's: http://msdn.microsoft.com/en-us/library/493t6h7t(v=vs.110).aspx
The problem is that "Supported in: Portable Class Library" is nearly meaningless: it means it's supported in _some_ PCL profiles, but not necessarily all, and the documentation doesn't say in which profile the member is available in.
Which is where `grep` comes in:
$ cd /Library/Frameworks/Mono.framework/Libraries/mono/xbuild-frameworks/.NETPortable
$ grep -rl GetNestedTypes .
From the above, we can see that GetNestedTypes() is available in profiles 5, 6, 14, 19, 24, 37, 42, 47, 136, 147, and 158.
Note that profile 78 is not in that list, at least for the PCL profile assemblies that Mono 3.2.6 includes on OS X.
You want System.Reflection.TypeInfo.GetDeclaredNestedTypes().
In PCL v4.5, the "traditional" reflection APIs have been replaced by new ones in System.Reflection. There's a new TypeInfo, MethodInfo, etc. in there.
Here's a good article which explains these new APIs: