- changed status to wontfix
NotSupportedException for Assembly.GetExportedTypes
Issue #197
wontfix
I have a class in my project which is used to find all classes or interfaces that derive from a given type.
If Odin is present in the Unity project, using this class to find derived classes becomes impossible because as soon as Assembly.GetExportedTypes gets called, a NotSupportedException gets thrown:
NotSupportedException: The invoked member is not supported in a dynamic module. System.Reflection.Emit.AssemblyBuilder.GetExportedTypes () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs:680)
Removing Odin from the project fixes the issue.
The exception is thrown at line 39 of the attached document.
Comments (2)
-
-
- removed milestone
Removing milestone: 1.0.5.0 (automated comment)
- Log in to comment
This isn't something we can do anything about, unfortunately - Odin uses dynamic assemblies to emit code so that reflection can be avoided. Without this, Odin would be very slow indeed.
What you should do is, in your code, check if the assemblies you're calling GetExportedTypes on derive from System.Reflection.Emit.AssemblyBuilder - and if they do, skip them.