petgre
Posts: 44
Joined: 2014-04-29
|
I have an add in for Outlook, works great in 32 bit Outlook version.
The dll is depending on a separate dll, handling the communication between the add in and our crm system.
Upgraded to Office 64 yesterday. I compile the depending dll as any cpu, like also the add in. I can register it in Outlook 64. Works as it should. If I try to compile the add in and the dll as x64, it will not compile at all.
So, I created a setup via Wix. Tried to install it on another computer, also office 64 bit. The install will not work, as it says system.BadImageFormatException.
What do a do wrong?
As far as I understod, is that if you have a depending dll, it must be 64 bit if running in Outlook 64.
How can it work in my Outlook 64 but using any cpu, the dll i use is a 32 bit dll if i loook at it in notepad.
Please give my some ideas whats wrong :) |
|
Andrei Smolin
Add-in Express team
Posts: 18619
Joined: 2006-05-11
|
Hello petgre,
BadImageFormatException is about loading a 32bit DLL in a 64bit process or, vice versa, about loading a 64bit DLL in a 32bit process.
petgre writes:
As far as I understod, is that if you have a depending dll, it must be 64 bit if running in Outlook 64.
This must be so WHEN Outlook loads it. This means the Any CPU platform can simplify the things as .NET recompiles an Any CPU assembly to 64bit when it is loaded in a 64bit process. Also, Add-in Express is about add-ins built for the Any CPU platform. Using Any CPU also simplifies the setup project. Look into the setup project that Add-in Express generates for a newly-created add-in project: the add-in project is Any CPU and the setup project creates a single installer that works in 32bit and 64 Windows. The setup project uses the adxregistrator.exe utility which registers your add-in for both 32bit and 64bit Office.
petgre writes:
the dll i use is a 32 bit
You can't support a 64bit Outlook if you do not have a 64bit version of that DLL: it isn't possible to bypass BadImageFormatException. If you have a 64bit version of that DLL, check Building and deploying a bit-specific Office add-in on our blog.
Andrei Smolin
Add-in Express Team Leader |
|
petgre
Posts: 44
Joined: 2014-04-29
|
My SharedServices.dll is compiled with the AnyCPU as also the add-in dll.
I can register it in VB, and it works in outlook 64.
If i take the same files and use it in my wix installer, I get BadImageFormatException on the SharesServices.DLL in the other computers Outlook 64.
You say "as .NET recompiles an Any CPU assembly to 64bit when it is loaded in a 64bit process"
When does this happens?
//Peter |
|
petgre
Posts: 44
Joined: 2014-04-29
|
And now it works, dont really know what I did, but i must be related to anycpu!
Thanks for your support!
//Peter |
|
Andrei Smolin
Add-in Express team
Posts: 18619
Joined: 2006-05-11
|
|