I have this in my code:
Assembly assembly = Assembly.LoadFile(dllFile);
//dllFile has the correct value of a path of a .dll file
foreach (Type type in assembly.GetTypes()) {...}
When I debug my program, everything works fine. When I create the exe for my program, the code comes to assembly.GetTypes() and stops executing. What could cause assembly.GetTypes() to work differently when I’m debugging from when I’m using the exe?
Take a look at this link:
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/3bdaf65c-520c-4a1a-a825-fc2ca2957bf3/
credit to @HansPassant