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 thoughts on “Troubleshooting Error: Loader Lock was detected

    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.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s