BadImageFormatException : Types Defined in a Referenced Assembly at Run-time
Error : BadImageFormatException occurs when trying to Instantiating Types Defined in a Referenced Assembly at Run-time.
Cause : Instantiating Types Defined in a Referenced Assembly at Run-time
Resolution : Rebuild the referenced assembly using the "AnyCPU" setting. This would allow the class contained in it to be instantiated within a 32-bit process, or in a 64-bit process.
Reference: http://msdn.microsoft.com/en-us/library/07bysfz2.aspx