Im creating an application with dynamically loaded assemblies and get a lot of cast-exceptions. Why?
If you load your assemblies with Assembly.LoadFrom(), they are loaded in another binding context (LoadFrom-context). On the other hand, compile-time assemblies are loaded into the Load-context. If you try to cast types of different contexts, you’ll get cast exceptions. A work-around is to load your assemblies with Assembly.Load(). Here you will need to assign a strong name to your assemblies, otherwise Load() fails.