Error when setting ADXOlExplorerLayout at runtime [Outlook]

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

Error when setting ADXOlExplorerLayout at runtime [Outlook]
 
Simon Hopwood




Posts: 5
Joined: 2019-03-05
Programatically changing ADXOlExplorerLayout to any other value produces errors. While it initially works and the program acts as normal, when you try to close down Outlook you're presented with the following error:


Managed Debugging Assistant 'LoaderLock' : 'Attempting managed 
execution inside OS Loader lock. Do not attempt to run managed 
code inside a DllMain or image initialization function since 
doing so can cause the application to hang.'



Any ideas why this would be happening?

I tested this in a new project adding a form with no other controls and only default .net references.
Posted 05 Mar, 2019 09:28:44 Top
Alexander Solomenko


Add-in Express team


Posts: 137
Joined: 2009-02-27
Hi Simon,

I need to have a look at your project or a demo project that reproduces the issue. Or you can try to comment out the code beginning with Outlook event handlers to understand what causes this error.
Regards,
Aleksandr Solomenko
Posted 06 Mar, 2019 04:10:08 Top
Alexander Solomenko


Add-in Express team


Posts: 137
Joined: 2009-02-27
Hi Simon,

I have googled and found some information about LoaderLock. This occurs only in a debugger, and this exception can be disabled. Please see the links below:

Exception: LoaderLock was detected
Loader lock error - Stack Overflow
Regards,
Aleksandr Solomenko
Posted 06 Mar, 2019 04:38:21 Top
Simon Hopwood




Posts: 5
Joined: 2019-03-05
Simon Hopwood writes:
I need to have a look at your project or a demo project that reproduces the issue.


Please find enclosed a test project which simply updates the form location at startup.
The error occurs when closing the application

https://mega.nz/#!zOwS3CCI!kQWxGAUfAhJaVN2aP5sclcC3ohblnEFidP4_oIW5Aow


Unfortunately this error doesn't only occur in the debugger.. Running the extension on a release build directly in Outlook must make the extension crash behind the scenes, as Outlook then disables the extension so it doesn't start up next time.
Posted 06 Mar, 2019 10:20:49 Top
Alexander Solomenko


Add-in Express team


Posts: 137
Joined: 2009-02-27
Hi Simon,

We have a code that releases the library when an Outlook process ends, and that code throws this exception. Currently, we are working on this. In the meantime, please try to disable the "LoaderLock" exception via "Debug->Windows->Exception Settings->Managed Debugging Assistants" menu? Will it solve the problem?
Regards,
Aleksandr Solomenko
Posted 07 Mar, 2019 05:04:52 Top