Tuesday, August 30, 2011

An attempt was made to load a program with an incorrect format

I got the errro An attempt was made to load a program with an incorrect format in one of  my c#.net application. I was importing a com dll which is 32 bit and my .net application build in 64 bit. The logic behind is: your dll and the .net application should be same version. To make your .net application to support 32 bit, Right click on the project go to properties. Then from there choose Build from the left side and Go to the Platform target: and change to x86 and it will work fine. see the figure below :
You can also check out some C#.net articles.

No comments:

Post a Comment