I have an interesting issue. I first encountered it in Visual Studio 2010 Beta2 and am now able to replicate it in the release. The error occurred when i switched my company’s main application from 2008 to 2010. My quick fix at the time was to delete
the form level resources and set any missing information from the resource in the form new. Recently, I encountered this issue in a much simpler application which lead me down this path.
The error reads "Could not load file or assembly '.../ClassLibrary1.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format." and points to my form's resource file.
After experimenting with all sorts of combinations of objects, files, and resources, I narrowed it down to the following circumstances.
- On a 64-bit machine, create a 3.5 windows application.
- Add an ImageList to the form and choose an image for the ImageList. It doesn't matter which image.
- Create a 3.5 class library and make sure the first letter of the library's assembly name is less than 'S'. Ex. "ClassLibrary1"
- Set the library's target cpu to x86
- Add the library as a reference to the windows form.
These steps will produce the error at compile time. The library name just has to be before "System" on the reference list. When
View Complete Post