Exception message: Unable to load one or more of the requested types. Retrieve the loaderexceptions property for more information.
Mathengine is a Silverlight form project,
Mathengine. app and mathengine. mainpage are default application classes and main form classes respectively, so they contain references of system. Windows.
By default, the test project (mathenginetests) is a non-form project and does not add a reference to system. Windows.
Add reference: C: \ Program Files (x86) \ reference assemblies \ Microsoft \ framework \ Silverlight \ v4.0 \ system. Windows. dll,
This problem can be solved!
Public static ienumerable <t> createinstances <t> () {try {type basic = typeof (t); var types = Basic. assembly. gettypes (); var result = (from T in types where basic. isassignablefrom (t )&&! T. isabstract //&&! T. hasattribute <ignoreattribute> () Select (t) activator. createinstance (t )). tolist (); return result;} catch (reflectiontypeloadexception ex) {// The test project (mathenginetests) cannot be loaded: mathengine. APP and mathengine. mainpage: C: \ Program Files (x86) \ reference assemblies \ Microsoft \ framework \ Silverlight \ v4.0 \ system. windows. DLL throw ex;} catch (exception ex) {Throw ex ;}}