[Mono-dev] I am using the embedded API on mono 4.8 macOS and mono_class_get_namespace(MonoClass *) is returning nil for nested classes. Does anyone recall if this was ever reported?

Jonathan Mitchell lists at mugginsoft.com
Thu Dec 7 17:39:14 UTC 2017


I have been thinking about this and it sort of makes sense that the namespace is NULL.

If I have a type like so:

A.B.C.D.FpsReader+FpsEmployee

mono_class_get_name(monoClass) returns “FpsEmployee”

To supply a value from mono_class_get_namespace() - which could not logically include the container class name as it is not part of the namespace - could give the impression that the FQ classname was A.B.C.D.FpsEmployee.

There is MonoClass* mono_class_get_nesting_type (MonoClass *klass) available to navigate the nested type hierarchy


> On 7 Dec 2017, at 16:19, R Zaghi <rzaghi at mosaic3dx.com> wrote:
> 
> Might be worth pasting a bit of code in case this is an issue in the way you make the calls.
> It's easy to make mistakes when calling stuff like mono_class_from_name() for example...
> 
> 
> 
> 
> 
> 
> Ramin Zaghi
> 
> Mosaic3DX™ | User Interface Technology
> St John's Innovation Centre,
> Cowley Road,
> Cambridge,
> CB4 0WS, UK
> E: rzaghi at mosaic3dx.com
> T: +44 1223 421 311
> http://linkedin.com/in/raminzaghi
> 
> 
> On Thu, Dec 7, 2017 at 2:30 PM, Jonathan Mitchell <lists at mugginsoft.com> wrote:
> I am using the embedded API on mono 4.8 macOS and mono_class_get_namespace(MonoClass *) is returning nil for nested classes. Does anyone recall if this was ever reported?
> 
> Thanks
> 
> Jonathan
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.dot.net
> http://lists.dot.net/mailman/listinfo/mono-devel-list
> 



More information about the Mono-devel-list mailing list