Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azman 64 bit using VS2010: BadImageFormatException

I recently upgraded a solution from VS2008 to VS2010. Just a solution upgrade, nothing else. I am targeting .Net 3.5. The solution is set to build build for "any CPU". Now, after the solution upgrade, I get a BadImageFormatException when trying to use Azman:

"Could not load file or assembly 'Interop.AZROLESLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format."

When I set the solution to build 32 bit everything is still fine and Azman works correctly. I'm running this on Windows 7 64 bit by the way. Any ideas what's going on?

like image 847
David Avatar asked Jan 21 '23 22:01

David


2 Answers

Assuming you aren't using Cassini here, Open Internet Information Services (IIS) Manager. Locate and click on your Application Pool for your website. Click on Advanced Settings. There is an option called "Enable 32-Bit Applications" near the top. Set this to True and it should work. We had the same problem.

like image 199
RidingTheRails Avatar answered Feb 01 '23 14:02

RidingTheRails


It seems that the component you are using is a native 32 bit application so you need to explicitly target x86 to make it work. If there's a 64 bit version of Azman you can try installing it.

like image 22
Darin Dimitrov Avatar answered Feb 01 '23 13:02

Darin Dimitrov