Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

32bit binaries on sharepoint 64bit, An attempt was made to load a program with an incorrect format

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?

like image 411
Nath Avatar asked Oct 14 '22 10:10

Nath


2 Answers

  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.

like image 125
Paul Lalonde Avatar answered Oct 20 '22 08:10

Paul Lalonde


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.

like image 33
Ravenheart Avatar answered Oct 20 '22 06:10

Ravenheart