Biotronic / TweakScale

Forked from Gaius Goodspeed's Goodspeed Aerospace Part & TweakScale plugin
30 stars 58 forks source link

Tweakscale breaks reflection #23

Closed jrossignol closed 9 years ago

jrossignol commented 9 years ago

This is a rather odd bug report.... When using tweakscale, a call to System.Reflection.Assembly.GetTypes() (on the tweakscale assembly) results in the following exception: ReflectionTypeLoadException: The classes in the module cannot be loaded.

Googling this error gives a lot of references to this happening with Unity, and the cause typically seems to be due to a missing reference to a .dll.

Here's the code in my mod (Contract Configurator) that fails - you can try this with anything replaced for the type parameter and you'll get the failure.

            var subclasses =
                from assembly in AppDomain.CurrentDomain.GetAssemblies()
                from type in assembly.GetTypes()
                where type.IsSubclassOf(typeof(ParameterFactory))
                select type;
jrossignol commented 9 years ago

And to be more specific, it's scale_editor.dll that's the problem.

Biotronic commented 9 years ago

Ah, yes. Scale_Editor.dll has not been updated. I'll update it in 1.50.

Biotronic commented 9 years ago

Fixed.