I am trying to add Silverlight support to my favorite programming langauge Nemerle.
Nemerle , on compilation procedure, loads all types via reflection mainly in 2 steps
1-) Uses Assembly.LoadFrom to load assembly 2-) Usese Assembly.GetTypes() to get the types
Then at the end of compilation it emits the resolved types with Reflection.Emit.
This procedure works for all assemblies including Silverlight ones except mscorlib of silverlight.
In c# this fails:
var a = System.Reflection.Assembly.LoadFrom(@"c:\mscorlib.dll");
but this passes :
var a = System.Reflection.Assembly.ReflectionOnlyLoadFrom(@"c:\mscorlib.dll");
Bu in the latter , a.GetTypes() throws an exception sayin System.Object's parent does not exist.
Is there a way out ?