An exception is being thrown at (not in) a constructor call:
controller = new Controller(classInstance); // Won't let me step in, exception thrown immediately.
The exception description is:
System.BadImageFormatException: Could not load file or assembly 'ClassLib, Version=1.0.4314.17265, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
classInstace isn't null and I cannot step into the constructor. I have never experienced this before. Any idea what this could be?
Thanks!
Try using the Fusion Log Viewer (fuslogvw.exe) to see which assembly's being matched to ClassLib. Like Jon Skeet said, it's probably either a corrupted file, a 32 vs/ 64-bit issue, or a weird runtime mismatch.
Yes - it can't find the ClassLib assembly which presumably contains Controller - or one of its dependencies. The BadImageFormatException suggests that maybe you've got a broken file (copy failed?) or possibly you're trying to load a .NET 4 assembly into a .NET 2 CLR. (I don't know whether that gives that exception or not, but I wouldn't be surprised.)
You haven't said what kind of project this is, but basically check all of your dependencies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With