Loading error for custom task pane in MS Word

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

Loading error for custom task pane in MS Word
 
Subscribe
Daniel Lutz




Posts: 9
Joined: 2023-02-27
Hello AddinExpress team,

i have a customer where Microsoft Word crashed through the loading of our addin. The customer repair our setup (which ships the addin express technology) and also repair the .net Framework. We canot reproduce the issue and it seems to be that this customer is currently the only one who can reproduce it.

Exception:


Detailed technical information follows: 
---
Date and Time:         12.02.2025 09:51:38
Machine Name:          
IP Address:           
Current User:          

Application Domain:    C:Program Files (x86)[NameOfOrAddin]
Assembly Codebase:     file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
Assembly Full Name:    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Assembly Version:      4.0.0.0

Exception Source:      
Exception Type:        System.ArgumentException
Exception Message:     Ein ungültiges übergeordnetes Fenster wurde angegeben.
Exception Target Site: ForwardCallToInvokeMember

---- Stack Trace ----
   System.RuntimeType.ForwardCallToInvokeMember(memberName As String, flags As BindingFlags, target As Object, aWrapperTypes As Int32[], msgData As MessageData&)
       mscorlib.dll: N 0193 (0xC1) IL 
   AddinExpress.MSO.ICTPFactory.CreateCTP(CTPAxID As String, CTPTitle As String, CTPParentWindow As Object)
       mscorlib.dll: N 00000 (0x0) JIT 
   AddinExpress.MSO.ADXAddinModule.AddCustomTaskPanes(parent As Object, outlookFolderName As String, showError As Boolean)
       mscorlib.dll: N 0640 (0x280) IL 


The adxloader.log also:


Add-in Express Loader Log File: 02/12/2025 08:49:47:357

Startup directory: C:Program Files (x86)[NameOfOrAddin]
Loader version: 10.2.4714.0
Operating System: Microsoft Windows 10 Professional (build 19045), 64-bit
Process Owner: User
Command Line: "C:Program FilesMicrosoft OfficeRootOffice16WINWORD.EXE" -Embedding
Run 'As Administrator': No
Process Elevated: No
Integrity Level: Medium
UAC (User Account Control): On
------------------------------------------------------------------------
08:49:47:361 4620 4680 Start.
08:49:47:361 4620 4680 The host's version is 16.0.18429.20132
08:49:47:361 4620 4680 Creating a new instance of the add-in loader.
08:49:47:361 4620 4680 Loading mscoree.dll
08:49:47:362 4620 4680 INFO: Assembly codebase - C:Program Files (x86)[NameOfOrAddin][NameOfOrAddin].dll.
08:49:47:364 4620 4680 INFO: Assembly version - 25.0.0.0.
08:49:47:364 4620 4680 Success.
08:49:47:364 4620 4680 Loading the configuration from the system registry.
08:49:47:364 4620 4680 Getting the latest CLR version.
08:49:47:365 4620 4680 The latest CLR version is 'v4.0.30319'.
08:49:47:365 4620 4680 The configuration has been loaded successfully.
08:49:47:365 4620 4680     Runtime version: v4.0.30319.
08:49:47:365 4620 4680     Assembly name: [NameOfOrAddin], PublicKeyToken=C6979FD13A4FC533.
08:49:47:365 4620 4680     Class name: JdrNJKvhtBdH3cDdss.dwCfbC6L9pJ58JpRBg.
08:49:47:365 4620 4680     Registry key: CLSID{644C70AB-2BAB-407D-B9E5-B016B85F72C6}.
08:49:47:365 4620 4680 Attempting to create a new instance of the managed add-in class: CLR - v4.0.30319
08:49:47:365 4620 4680 Loading CLR: v4.0.30319.
08:49:47:365 4620 4680 Calling CLRCreateInstance method.
08:49:47:365 4620 4680 Success.
08:49:47:365 4620 4680 Calling GetRuntime method.
08:49:47:366 4620 4680 Success.
08:49:47:366 4620 4680 Checking if the hosting API of .NET Framework v4.0 beta is installed.
08:49:47:379 4620 4680 The hosting API is up to date.
08:49:47:379 4620 4680 Calling SetDefaultStartupFlags method.
08:49:47:379 4620 4680 Success.
08:49:47:379 4620 4680 Calling GetInterface method for the CorRuntimeHost interface.
08:49:47:379 4620 4680 Success.
08:49:47:379 4620 4680 Starting CLR...
08:49:47:379 4620 4680 Success.
08:49:47:379 4620 4680 Getting the CLR version.
08:49:47:379 4620 4680 The CLR v4.0.30319 has been initialized successfully.
08:49:47:379 4620 4680 Creating a new domain setup.
08:49:47:380 4620 4680 Success.
08:49:47:380 4620 4680 Getting the add-in directory.
08:49:47:381 4620 4680 Success. The directory is 'C:Program Files (x86)[NameOfOrAddin]'
08:49:47:381 4620 4680 The 'shadow copy' is disabled.
08:49:47:381 4620 4680 Creating a new application domain.
08:49:47:384 4620 4680 Success.
08:49:47:384 4620 4680 Creating an instance of the managed class. Assembly identity: '[NameOfOrAddin], PublicKeyToken=C6979FD13A4FC533'
08:49:47:916 4620 4680 Success.
08:49:47:916 4620 4680 Unwrapping the managed class.
08:49:47:918 4620 4680 Success.
08:49:47:918 4620 4680 Querying the add-in extensibility.
08:49:47:918 4620 4680 Success.
08:49:47:918 4620 4680 Querying the custom task panes.
08:49:47:918 4620 4680 Success.
08:49:47:918 4620 4680 Querying the ribbon extensibility.
08:49:47:918 4620 4680 Success.
08:49:47:918 4620 4680 Querying the form regions.
08:49:47:918 4620 4680 Success.
08:49:47:918 4620 4680 Querying the encryption provider.
08:49:47:918 4620 4680 The 'EncryptionProvider' interface is not supported.
08:49:47:918 4620 4680 Getting the dispid of the 'Dispose' method.
08:49:47:920 4620 4680 Success.
08:49:47:920 4620 4680 Getting the dispid of the 'InitializeLoaderService' method.
08:49:47:920 4620 4680 Success.
08:49:47:920 4620 4680 Invoking the 'InitializeLoaderService' method.
08:49:47:920 4620 4680 Success.
08:49:47:920 4620 4680 The instance of the managed add-in class has been created successfully.


If you need more informations i can research for it.

Best regards
Daniel
Posted 13 Feb, 2025 07:39:34 Top
Daniel Lutz




Posts: 9
Joined: 2023-02-27
Addition:

MS Word has also been reinstalled and no other add-ins are installed. The error probably occurs sporadically.
Posted 13 Feb, 2025 07:44:02 Top
Andrei Smolin


Add-in Express team


Posts: 19095
Joined: 2006-05-11
Hello Daniel,

Make sure the pane class doesn't contain initializers on class-level complex-type variable, e.g. MyClass myVariable = null. The "= null" part makes .NET to load the assembly that implements that class. The issue occurs if that assembly isn't prepared to be loaded at that moment (for any possible reason). Initialize such variables after the form loads.

Also, check the constructor(s) of the pane class: custom code in the constructor(s) may be responsible for this issue, too.

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Feb, 2025 15:24:47 Top
Daniel Lutz




Posts: 9
Joined: 2023-02-27
Hello Andrei,

thank you for the hints. We will test it with an modified version and i will come back with the results.

Best regards
Daniel
Posted 14 Feb, 2025 11:16:44 Top