Yeah, I'm not sure why CoSMOS even works when doing the assembly in place of the namespace: But sure enough, having it stay empty does find the classes.
As for the second part, I mean I use fields to find offsets for classes. I actually reformatted my enable script a bit, so here's a gist:
Link.
I use mono_class_enumFields and mono_class_getName in the code to make it easier to figure out everything: And the way I do it works across updates, unless they start to obfuscate the code.
As for what I meant by the last part, it should be possible to use lua metatables to make browsing mono objects in code far easier.
If the metaobject knows the class ID and memory location, it could take that and figure out what each name wants.
Take this example:
mainManager = mono_get_metaobject(domain, classid, instance)
mainManager.localPlayer.TurnBlinkOnOrOff(true)
the object created by mono_get_metaobject would parse the classid (Probably cache it), and see that mainManager.localPlayer is a complex object. It would then return mono_get_metaobject(myDomain, localPlayerClassID, localPlayer).
localPlayer would see that TurnBlinkOnOrOff is a function: So it'd return a function with the same number of arguments as the actual function that prepares the arguments passed to it and calls mono_invoke_method with all the needed arguments and call TurnBlinkOnOrOff through mono.
I'm shocked the 'firewall' didn't catch that for too many brackets, but you get what I mean? It'd allow someone to browse through mono classes and fields as if they were all luatables. And it'd be all dynamic too. Simple values such as strings, floats, and ints could be written to normally as well. Arrays and lists could be exposed as luatables as well, even if just read only at first. It could make using the mono api trivial.