x64 Platform target in a 32 bit outlook development machine

Add-in Express™ Support Service
That's what is more important than anything else

x64 Platform target in a 32 bit outlook development machine
 
gera




Posts: 95
Joined: 2009-04-28
Hi

I have a solution that creates plug ins for outlook. I have to support 64 bit outlook 2010.
I also use redemption, for which to work with outlook 64 bit, it seems I need to set the Target platform to x64 while compiling. But while compiling if I set it to x64 in a machine which has only outlook 32 bit it complains that "An attempt was made to load an assembly with an incorrect format:"

Is my understanding correct that I need a machine with 64 bit outlook if want to set the target platform to x64 while compiling?
Since I have only machine with 32 bit outlook as the development machine, is there a work around for it?

Thanks in advance

-Gera
Posted 28 Jun, 2011 07:25:47 Top
Andrei Smolin


Add-in Express team


Posts: 14140
Joined: 2006-05-11
Hi Gera,

Outlook 32-bit can only load 32-bit add-ins; Outlook 2010 64-bit can only load 64-bit add-ins. Note that an empty Add-in Express add-in can be loaded by 32-bit and 64-bit Outlook versions. That's because it is compiled using AnyCPU; the bitness-dependent part of the loading process is managed by adxloader.dll and adxloader64.dll files that the default setup project includes. Using a bitness-specific assembly or component implies that you have two versions of your add-in: one must be compiled with x86 - it can be loaded by Outlook 2000-2007 and Outlook 2010 32-bit; and another one with x64 platform - it can be loade by Outlook 2010 64-bit.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 28 Jun, 2011 09:15:20 Top
gera




Posts: 95
Joined: 2009-04-28
Hi Andrei,

Thanks for your reply. I guess my question is not clear.

In the machine where I develop and create the installation files using "Publish" option I have only outlook 2007. But I want to install the application to a machine which has 64 bit oulook 2010. In order to do that I want to set the platform target to x64. When I set the platform target to x64, I get the error "An attempt was made to load an assembly with an incorrect format:"

Is the reason for this error message is that machine where I compile has outlook 2007?

So my question is can I compile the project with platform target x64 in a machine which has outlook 2003 or 2007? So that then I can publish and use the installation files to install it in a machine which has 2010 64 bit outlook.

Thanks,
Gera
Posted 29 Jun, 2011 02:30:48 Top
Andrei Smolin


Add-in Express team


Posts: 14140
Joined: 2006-05-11
Hi Gera,

Now I see. You get this problem because Add-in Express tries to get PublicKeyToken from the assembly. To do this, it loads the assembly but since VS is 32-bit and the assembly is built in 64-bit format, the load process ends with the exception that you see. In your case, there's a way out that Redemption provides - find "RedemptionLoader class" at http://www.dimastr.com/redemption/security.htm.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 29 Jun, 2011 05:36:46 Top