Add in install fails

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

Add in install fails
An attempt was made to load a program with an incorrect format. 
dan gallery




Posts: 83
Joined: 2009-10-19
Hi guys,

I recently have several customers getting the message "An attempt was made to load a program with an incorrect format." in the adxLoader.log, at the bottom. The addin fails to install. It is an MS Word and Excel add-in. Whats also strange is the Process Owner is Administrator, but the Run 'As Administrator' is No. Would this have anything to do with it?

Thanks,
Dan


Add-in Express Loader Log File: 03/12/2013 14:18:11

Startup directory: C:\Users\jsmith\AppData\Local\Apps\2.0\19043PHC.ADR\M0X01BJY.VW7\data..fice_6fc1fd0e726ab81c_0001.0000_5298e1da69119050\
Loader version: 6.7.3062.0
Operating System: Microsoft Windows 7 Professional Service Pack 1 (build 7601), 64-bit
Process Owner: Administrator
Command Line: "C:\Program Files\Microsoft Office\Office14\WINWORD.EXE"
Run 'As Administrator': No
Process Elevated: No
Integrity Level: Medium
UAC (User Account Control): On
------------------------------------------------------------------------
14:18:11 1572 4244 Start.
14:18:11 1572 4244 Reading the registry key 'HKEY_CLASSES_ROOT\CLSID\{E035402B-5A6A-4C50-9490-0C5312815CC7}'
14:18:11 1572 4244 Success. The registry key 'HKEY_CLASSES_ROOT\CLSID\{E035402B-5A6A-4C50-9490-0C5312815CC7}' is closed.
14:18:11 1572 4244 Converting the '{4BA250A6-8BCA-46A6-982A-F340081187C3}' CLSID from string.
14:18:11 1572 4244 Success.
14:18:11 1572 4244 Attempting to get the class object by the '{4BA250A6-8BCA-46A6-982A-F340081187C3}' CLSID.
14:18:11 1572 4244 Success.
14:18:11 1572 4244 Creating a new instance of the add-in loader.
14:18:11 1572 4244 Loading mscoree.dll
14:18:11 1572 4244 Success.
14:18:11 1572 4244 Loading the configuration from the system registry.
14:18:11 1572 4244 Getting the latest CLR version.
14:18:11 1572 4244 The latest CLR version is 'v4.0.30319'.
14:18:11 1572 4244 The configuration has been loaded successfully.
14:18:11 1572 4244 Runtime version: v2.0.50727.
14:18:11 1572 4244 Assembly name: DatappraiseOffice, PublicKeyToken=611ABD646DB528A8.
14:18:11 1572 4244 Class name: DatappraiseOffice.AddinModule.
14:18:11 1572 4244 Registry key: CLSID\{E035402B-5A6A-4C50-9490-0C5312815CC7}.
14:18:11 1572 4244 Attempting to create a new instance of the managed add-in class: CLR - v2.0.50727
14:18:11 1572 4244 Loading CLR: v2.0.50727.
14:18:11 1572 4244 Calling CLRCreateInstance method.
14:18:11 1572 4244 Success.
14:18:11 1572 4244 Calling GetRuntime method.
14:18:11 1572 4244 Success.
14:18:11 1572 4244 Checking if the hosting API of .NET Framework v4.0 beta is installed.
14:18:11 1572 4244 The hosting API is up to date.
14:18:11 1572 4244 Calling GetInterface method for the CorRuntimeHost interface.
14:18:11 1572 4244 Success.
14:18:11 1572 4244 Starting CLR...
14:18:11 1572 4244 Success.
14:18:11 1572 4244 Getting the CLR version.
14:18:11 1572 4244 The CLR v2.0.50727 has been initialized successfully.
14:18:11 1572 4244 Creating a new domain setup.
14:18:11 1572 4244 Success.
14:18:11 1572 4244 Getting the add-in directory.
14:18:11 1572 4244 Success. The directory is 'C:\Users\jsmith\AppData\Local\Apps\2.0\19043PHC.ADR\M0X01BJY.VW7\data..fice_6fc1fd0e726ab81c_0001.0000_5298e1da69119050\'
14:18:11 1572 4244 The 'shadow copy' is enabled.
14:18:11 1572 4244 Creating a new application domain.
14:18:11 1572 4244 Success.
14:18:11 1572 4244 An attempt was made to load a program with an incorrect format.
Posted 12 Mar, 2013 14:36:49 Top
dan gallery




Posts: 83
Joined: 2009-10-19
Excuse me, I meant to say the one line says: Process Owner: Administrator, but Run As Administrator is set to No.

Thanks.
Posted 12 Mar, 2013 14:38:20 Top
Andrei Smolin


Add-in Express team


Posts: 19138
Joined: 2006-05-11
Hello Dan,

"An attempt was made to load a program with an incorrect format" means loading a 32bit add-in into a 64bit process and vice versa. If your add-in does NOT use bitness-specific components such as ActiveX components, then the recommended approach for supporting 32bit and 64bit Office applications is to build the add-in using the Any CPU platform.

dan gallery writes:
Startup directory: C:\Users\jsmith\AppData\Local\Apps\2.0\19043PHC.ADR\M0X01BJY.VW7\data..fice_6fc1fd0e726ab81c_0001.0000_5298e1da69119050\
Loader version: 6.7.3062.0
Operating System: Microsoft Windows 7 Professional Service Pack 1 (build 7601), 64-bit
Process Owner: Administrator
Command Line: "C:\Program Files\Microsoft Office\Office14\WINWORD.EXE"
Run 'As Administrator': No
Process Elevated: No
Integrity Level: Medium
UAC (User Account Control): On


This means an administrator run Word 2010 normally, not via "Run as administrator" on Windows 7 64bit with UAC turned on. Since Word version is 2010 and because Word is started from "Program Files", not "Program Files (x86)", it follows that Word is 64bit. The "Startup directory" entry tells us that the add-in was deplyed via ClickOnce.


Andrei Smolin
Add-in Express Team Leader
Posted 13 Mar, 2013 06:34:54 Top
dan gallery




Posts: 83
Joined: 2009-10-19
Hi Andrei,

I changed the parameter to AnyCPU for both Release and Debug in Configuration Manager. That saved and held fine. However, when I go to "Publish the ADX Project", the Platform in the upper right says x86. And when I create the build, the error still occurs for my customer when installing my add-in. The error is:

14:18:11 1572 4244 An attempt was made to load a program with an incorrect format.

How do I tell Add-In express to go back to using AnyCpu on the Publish page?

Dan
Posted 14 Mar, 2013 17:45:54 Top
dan gallery




Posts: 83
Joined: 2009-10-19
Hi Andrei,

I got it working. Under Project Properties Build I set All Configurations to Platform: Any CPU. I also deleted the x86 Platform I had added in Configuration Manager. It seemed to take 2 builds, but then it finally installed on the clients machine without any log file errors. The client is running 64bit OS and 64bit Office 2010.

Thanks so much for your suggestions!

Dan
Posted 14 Mar, 2013 20:55:55 Top