Troubleshooting Error: Loader Lock was detected

While working with Redemption library, we usually get the following error while debugging the project.

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.

As per Dmitry Streblechenko (Redemption Team), this exception is raised when .NET thinks that a dll that it is loading is doing something that can potentially lock the loader (like circularly loading dlls etc). Redemption does load the MAPI libraries at the startup, but that is about it. That warning can be safely ignored.

 

Work-Around:

We can skip this error by clearing the LoaderLock checkbox in Debug -> Exceptions -> Managed Debud Assistants.

Debug | Exceptions | Managed Debug Assistants > LoaderLock (Uncheck this!)

Redemption Library is really wonderful creation. It helps the developers a lot in handling and accessing some attributes of Outlook Items which cannot be accessed using the API given by Microsoft.

2 Comments

    1. Hi Eric,
      Glad to know that you have visited my blog. Thanks a lot!
      Good to know that this tip works for Add-in Express too.
      I have worked with Add-in Express controls too. They ease the development process and lessen the project duration.

Leave a Comment

Your email address will not be published. Required fields are marked *