Assembly assembly=Assembly.Load(name)and the output window showed:
foreach(Type type in assembly.GetTypes()
First-chance exception at 0x7c81eb33 (kernel32.dll) in myprogramm.exe: Microsoft C++ exception: EETypeLoadException at memory location 0x0012d324..Later I found that all these happens due to a unresolved forward declaration of a ref class. but the unresolved native class will not cause the problem.
First-chance exception at 0x7c81eb33 (kernel32.dll) in myprogramm.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
A first chance exception of type 'System.Reflection.ReflectionTypeLoadException' occurred in mscorlib.dll
So be caution when you are using the forward declaration for a ref class.