5
votes

I have a lot of sharepoint web parts etc all of which are compiled for any cpu, they run fine on 32bit sharepoint but moving to server 2008 in 64bit causes the following error:

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

From my reading they should all work fine?

2

2 Answers

3
votes
  1. 64-bit processes cannot load 32-bit DLLs and vice versa.
  2. IIS is a 64-bit process on 64-bit hardware. It's possible to configure individual application pools to run 32-bit, but ...
  3. Sharepoint is most likely to be running 64-bit.

Therefore, your assemblies and all of their dependent assemblies and DLLs will have to run 64-bit.

Note that .NET assemblies that are marked as "Any CPU" will run as 64-bit on 64-bit hardware. Any native DLLs, however, will need to be compiled natively as 64-bit.

1
votes

You can't mix 32bit and 64bit assemblies. Your only option is to rebuild your binaries to x64.

You can run 32bit binaries/libraries on 64bit OS, but again you cannot mix them together.