In the project I'm working on, there is a certain form that contains an ImageList control. Up until a few days ago, everything was working fine, and there were 5 images in the control.
Then one of my co-workers added a 6th image to the control. I got latest version from source control, and suddenly my project would not compile anymore. Error message:
error RG0000: Could not load file or assembly 'file:///D:/MyProjectPath/Bin/Debug/SomeOther.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
This error message is obviously bogus. There is no connection whatsoever between the ImageList control and SomeOther.dll
. When I reverted the changes my colleague made, the project compiled fine again. But if I tried just to remove the one image he added, it still gives the compiler error. In fact, if I remove all the images, then add a new one myself, it still throws the error. Only if I remove all images from the ImageList will it compile!
Something is really not cool here. To summarize:
Any ideas?
Solution found here. It's a known bug at Microsoft since may 2010, and they have still not released a patch. Have to use the workaround suggested there. What a PAIN!