KILIÇ.NET

Assembly loading headaches

This one got me real good. If you do get an InvalidCastException and you're really sure that your casts should be working, check that your loading the correct version of the assemblies, you could be loading an incorrect (version of a) type!

To do this you need to use Assembly.LoadWithPartialName(string s) where s can be something like "YourAssembly, version=1.0.0.0" not Assembly.LoadFrom (string filename) as I was using for the last several hours (argh!).