none
Outlook 2010 Addin build in VS2012 not working after deploying (Exception from HRESULT: 0x8007000B). RRS feed

  • Question

  • I created a Outlook 2010 Add-In in VS2012 . For creating a installer i used install shield. Installer got created successfully and is running fine on my system. But the same addin throws a error on deploying it on another machine.

    Error: Usual functionality of the add in are working but it throws a error---  An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

    Note: In my addin project i use a C++ dll (through DLLImport). The error comes when i cal a method of this method.

    I have tried a lot but not able to find a result. Any help will be highly appreciated.

     
    Tuesday, August 12, 2014 11:06 AM

Answers

  • You need to include the x64 edition of the assembly. The x86 based assembly cannot be loaded in the x64 based process.
    Wednesday, August 13, 2014 3:39 PM

All replies

  • Hello Nitin,

    It looks like you forgot to include all the required prerequisites. For example, you may need Visual C++ Redistributable installed on the target PC. Is this the case?

    Also please make sure that you included an appropriate dll version depending on the Outlook bitness (x64 or x86).

    Tuesday, August 12, 2014 1:52 PM
  • Yes the C++ Redistributable are present in the Target machine.

    I have used Any CPU so I don't think it should be a problem.

    Tuesday, August 12, 2014 4:09 PM
  • Did you build the C++ assembly as AnyCPU? If so, how?
    Tuesday, August 12, 2014 4:16 PM
  • No I was talking about my Addin project(Any CPU) . C++ DLL is Win32 project DLL.
    Tuesday, August 12, 2014 6:33 PM
  • As I already wrote, you need to include the appropriate edition of the dll (x64 and x86).

    Most probably the add-in is trying to load x86 assembly into the x64 based Outlook (or in the opposite). Is this the case?

    Tuesday, August 12, 2014 8:21 PM
  • Hi Eugene

    following are the findings

    Outlook 32 bit (Windows 7 OS 64 Bit) : Win32 DLL inside Addin project (Build on Any CPU) = working fine

    Outlook 64 bit (Windows 7 OS 64 Bit) : Win32 DLL inside Addin project (Build on Any CPU) = An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

    Outlook 64 bit (Windows 7 OS 64 Bit) : Win32 DLL inside Addin project (Build on X64) = An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

    Wednesday, August 13, 2014 12:44 PM
  • You need to include the x64 edition of the assembly. The x86 based assembly cannot be loaded in the x64 based process.
    Wednesday, August 13, 2014 3:39 PM
  • I got it you are saying that the C++ DLL should be X64 bit . I will try that and will let you know

    Wednesday, August 13, 2014 5:14 PM