Excel Addin not loading - "Not loaded. A runtime error occurred during the loading of the COM Add-in"

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

Excel Addin not loading - "Not loaded. A runtime error occurred during the loading of the COM Add-in"
 
DevTools Corptax




Posts: 20
Joined: 2012-12-02
I work on a product that has two addins installed to a user's machine and are both loaded into Excel at startup. This process has worked for years. The two Addins are deployed to the same directory on the user's machine and are loaded by adxloader64.dll.

Once I updated the components to the 9.2.4635 release, one of the addins stopped loading. In the Options > Addins dialog, if you view the COM Addins dialog and click on this addin, it shows "Not loaded. A runtime error occurred during the loading of the COM Add-in"

It appears there is something in the adxloader / adxloader64 that has changed and is causing the failure, because if I replace these files with the previous version and leave the other upgraded components, it does load correctly. Is there some change in this latest version that could have caused this?


AdxLoader log:

Add-in Express Loader Log File: 02/21/2019 11:03:53:500

Startup directory: C:\Users\jputman\AppData\Local\Apps\MyApp\MyAppOffice\
Loader version: 9.2.4635.0
Operating System: Microsoft Windows Server 2012 R2 Standard Edition (build 9600), 64-bit
Process Owner: Administrator
Command Line: "C:\Program Files\Microsoft Office\Office16\EXCEL.EXE"
Run 'As Administrator': Yes
Process Elevated: Yes
Integrity Level: High
UAC (User Account Control): Off
------------------------------------------------------------------------
11:03:53:500 2704 13024 Start.
11:03:53:500 2704 13024 Creating a new instance of the add-in loader.
11:03:53:500 2704 13024 Loading mscoree.dll
11:03:53:500 2704 13024 INFO: Assembly codebase - C:\Users\jputman\AppData\Local\Apps\MyApp\MyAppOffice\MyApp.Office.Excel.AddIn.dll.
11:03:53:500 2704 13024 INFO: Assembly version - 2019.1.1.687.
11:03:53:500 2704 13024 Success.
11:03:53:500 2704 13024 Loading the configuration from the system registry.
11:03:53:500 2704 13024 Getting the latest CLR version.
11:03:53:500 2704 13024 The latest CLR version is 'v4.0.30319'.
11:03:53:500 2704 13024 The configuration has been loaded successfully.
11:03:53:500 2704 13024 Runtime version: v4.0.30319.
11:03:53:500 2704 13024 Assembly name: MyApp.Office.Excel.AddIn, PublicKeyToken=D3657C1B68A44A8E.
11:03:53:500 2704 13024 Class name: MyApp.Office.Excel.AddIn.AddinModule.
11:03:53:500 2704 13024 Registry key: CLSID\{1A86ABAF-3350-4CAB-A48E-2646A07CAA5E}.
11:03:53:500 2704 13024 Attempting to create a new instance of the managed add-in class: CLR - v4.0.30319
11:03:53:500 2704 13024 Loading CLR: v4.0.30319.
11:03:53:500 2704 13024 Calling CLRCreateInstance method.
11:03:53:500 2704 13024 Success.
11:03:53:500 2704 13024 Calling GetRuntime method.
11:03:53:500 2704 13024 Success.
11:03:53:500 2704 13024 Checking if the hosting API of .NET Framework v4.0 beta is installed.
11:03:53:532 2704 13024 The hosting API is up to date.
11:03:53:532 2704 13024 Calling SetDefaultStartupFlags method.
11:03:53:532 2704 13024 Success.
11:03:53:532 2704 13024 Calling GetInterface method for the CorRuntimeHost interface.
11:03:53:532 2704 13024 Success.
11:03:53:532 2704 13024 Starting CLR...
11:03:53:532 2704 13024 Success.
11:03:53:532 2704 13024 Getting the CLR version.
11:03:53:547 2704 13024 The CLR v4.0.30319 has been initialized successfully.
11:03:53:547 2704 13024 Creating a new domain setup.
11:03:53:547 2704 13024 Success.
11:03:53:547 2704 13024 Getting the add-in directory.
11:03:53:547 2704 13024 Success. The directory is 'C:\Users\jputman\AppData\Local\Apps\MyApp\MyAppOffice\'
11:03:53:579 2704 13024 The configuration file is 'C:\Users\jputman\AppData\Local\Apps\MyApp\MyAppOffice\MyApp.Office.Excel.AddIn.dll.config'
11:03:53:579 2704 13024 The 'shadow copy' is disabled.
11:03:53:579 2704 13024 Creating a new application domain.
11:03:53:688 2704 13024 Success.
11:03:53:688 2704 13024 Creating an instance of the managed class. Assembly identity: 'MyApp.Office.Excel.AddIn, PublicKeyToken=D3657C1B68A44A8E'
11:03:54:342 2704 13024 Success.
11:03:54:342 2704 13024 Unwrapping the managed class.
11:03:54:342 2704 13024 Success.
11:03:54:342 2704 13024 Querying the add-in extensibility.
11:03:54:342 2704 13024 Success.
11:03:54:342 2704 13024 Querying the custom task panes.
11:03:54:342 2704 13024 Success.
11:03:54:342 2704 13024 Querying the ribbon extensibility.
11:03:54:342 2704 13024 Success.
11:03:54:342 2704 13024 Querying the form regions.
11:03:54:342 2704 13024 Success.
11:03:54:342 2704 13024 Querying the encryption provider.
11:03:54:342 2704 13024 The 'EncryptionProvider' interface is not supported.
11:03:54:342 2704 13024 Getting the dispid of the 'Dispose' method.
11:03:54:342 2704 13024 Success.
11:03:54:342 2704 13024 Getting the dispid of the 'InitializeLoaderService' method.
11:03:54:342 2704 13024 Success.
11:03:54:342 2704 13024 Invoking the 'InitializeLoaderService' method.
11:03:54:342 2704 13024 Success.
11:03:54:342 2704 13024 The instance of the managed add-in class has been created successfully.
Posted 25 Feb, 2019 01:46:33 Top
Andrei Smolin


Add-in Express team


Posts: 16317
Joined: 2006-05-11
Hello,

Could you please publish (or send to the support email address; find it in readme.txt) your adxloader.dll.manifest? Which of the add-ins does it describe?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 25 Feb, 2019 01:50:06 Top
DevTools Corptax




Posts: 20
Joined: 2012-12-02
The manifest file does describe the addin that is listed above (MyApp.Office.Excel.AddIn.dll) in the adxloader log I sent. That is the addin that is being loaded correctly.

We have a second QA addin (MyApp.Office.Excel.QA.AddIn.dll) that is deployed to the same folder and does not exist in the manifest file... however it has always loaded correctly as well until the most recent version. If I make a change to the manifest file to point to this QA addin, then the first one does not get loaded correctly. I suppose this is how it is supposed to work, however until this most recent version, both addins would load fine using the same adxloader and a manifest that only pointed to one addin.

So here is the current manifest file contents:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<assemblyIdentity name="MyApp.Office.Excel.AddIn"/>
<loaderSettings generateLogFile="true" configFileName="MyApp.Office.Excel.AddIn.dll.config" shadowCopyEnabled="false" privileges="user"/>
</configuration>


Was there a specific change that caused this new behavior? I am guessing that we will need to change our installer to deploy the second addin to a different folder along with the adxloader files and then it should work again... is this correct?
Posted 25 Feb, 2019 09:43:24 Top
Andrei Smolin


Add-in Express team


Posts: 16317
Joined: 2006-05-11
DevTools Corptax writes:
We have a second QA addin (MyApp.Office.Excel.QA.AddIn.dll) that is deployed to the same folder and does not exist in the manifest file


Add-in Express doesn't support such deployment. Instead, you should deploy an add-in to a separate folder unless the add-in is part of the same assembly. To get two add-ins in the same assembly, you add another add-in module to your add-in project.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 25 Feb, 2019 09:49:48 Top
DevTools Corptax




Posts: 20
Joined: 2012-12-02
Thank you for your quick response Andrei...

I am going to look into adding an additional add-in module to my assembly to see if that is the best answer.

I see multiple choices out in the 'Add New Item' dialog... this is an Excel-based addin I maintain. Can you explain the difference between these three or point me to a resource to read up on this?


  • COM Excel Add-In Module
  • COM Add-In Module
  • COM Add-In Additional Module


Thanks!
Posted 25 Feb, 2019 11:04:34 Top
Andrei Smolin


Add-in Express team


Posts: 16317
Joined: 2006-05-11
Hello,

These are:

- COM Excel Add-In Module: Excel Automation add-in; it lets you create functions for the user to use them in Excel formulas such as =MyFunction()+1
COM Add-In Module - COM add-in; it lets you create panes and Ribbons; also lets you intercept events.
COM Add-In Additional Module - lets you create a multipart COM add-in; see How to develop the modular architecture of your COM and XLL Add-in at https://www.add-in-express.com/docs/net-tips.php#modular-architecture.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 26 Feb, 2019 03:12:19 Top