We are installing a third party application in one of our 64-bit Windows servers. This application apparently was build with the compiler option set to choose the platform at run time. When we run the application it gives us an error:
System.BadImageFormatException: is not a valid Win32 application.
I have seen in MSDN forums that in order to fix this error I have to build the application set to 32-bit, and that way it will run fine on a 64-bit server. I check on other StackOverflow links Other Posts.
How to get around this situation? For everyone that wants to know more information:
- The application is running fine in a 32-bit test server.
- IIS version 6
- using SQL Server Express 2005
- On the Web Service Extension there are both Framework64\v2.0.50727\aspnet_isapi.dll
- and Framework\v2.0.50727\aspnet_isapi.dll
One possibility is that the application depends on an unmanaged DLL that needs to be run in 32-bit mode. Since the default ‘AnyCPU’ .NET build checks the platform automatically the .NET part of the program is starting in 64-bit mode. This will cause the calls to the 32-bit-only unmanaged DLL to fail.
To fix it, you need to create a manifest file to tell the app to run in 32-bit mode. I’ve never needed to do that myself, so I can’t provide instructions and a quick Google search hasn’t (yet) turned up anything.
[Update]
See if this link helps:
http://msdn.microsoft.com/en-us/library/aa374191.aspx