I have developed an addin for word in vs2010.It's working cool in 32 bit version of office, but its not working on 64bit version of office .Searched a lot and found that
For 64-bit Root\Software\Microsoft\Office\application name\Addins\add-in ID
For 32-bit Root\Software\Wow6432Node\Microsoft\Office\application name\Addins\add-in ID
registry information path's.I tried register the information for 64bit.Even too its not working in 64 bit of office. In 64 bit office my addin was displaying under InActive Application Add-Ins.I even tried enabling it.
How to develop and deploy an addin for 64 bit of office..?
and am getting the following error ..!!
Could not load file or assembly 'xxxxx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
************** Exception Text ************** System.BadImageFormatException: Could not load file or assembly 'xxxxx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'xxxxx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
at MyWord.ThisAddIn.ThisAddIn_Startup(Object sender, EventArgs e)
at MyWord.ThisAddIn.FinishInitialization()
at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.ExecutePhase(ExecutionPhases executionPhases) at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IExecuteCustomization2.ExecuteEntryPoints() WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
The 64-bit version of Office is automatically installed unless you explicitly select the 32-bit version before beginning the installation process. To install either the 32 or 64-bit version of Microsoft 365, Office 2021, or Office 2019, follow the steps in Install Office on a PC.
NET Framework are required for each solution. Office 2013 and Office 2010 applications include the Visual Studio 2010 Tools for Office runtime.
An attempt was made to load a program with an incorrect format
In 99% of the cases, that just means one thing when this exception is raised in a 64-bit program. The "incorrect format" is a DLL that contains 32-bit code. That cannot work, a 64-bit program can only load 64-bit DLLs.
If you used C# to write that add-in then it is a very simple fix. Right-click the project in the Solution Explorer window, Properties, Build tab. Set the "Platform target" to AnyCPU. Untick the "Prefer 32-bit" checkbox if you see it (VS2012 and up). Repeat this for the Release configuration.
Other possible explanations for this, the unusual cases:
You'll need SysInternals' Process Monitor to chase these kind of mishaps down. The trace shows you what DLLs the Office program is looking for and in which directories it looked for the DLL. It will be a big trace, work from the bottom of the trace backwards.
Take a look at the Deploying an Office Solution by Using Windows Installer article in MSDN which describes all the required steps in depth. It states the following:
32-bit
HKEY_LOCAL_MACHINE\SOFTWARE(32-Bit)\Microsoft\Office\Excel\Addins\SampleCompany.ExcelAddIn
64-bit
HKEY_LOCAL_MACHINE\SOFTWARE(32-Bit)\Microsoft\Office\Excel\Addins\SampleCompany.ExcelAddIn
HKEY_LOCAL_MACHINE\SOFTWARE(64-Bit)\Microsoft\Office\Excel\Addins\SampleCompany.ExcelAddIn
An installer for 64-bit Windows requires two registry paths because it’s possible for users to run 32-bit and 64-bit versions of Office on a computer that runs 64-bit Windows.
But you may detect (in the custom actions) the bitness of MS Office installed and create keys in the proper hive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With