none
RE: Walkthrough: Creating Your First Application-Level Add-in for Outlook (2010) RRS feed

  • Question

  • So I follow the instructions this walk-through detailed. http://msdn.microsoft.com/en-us/library/cc668191.aspx
    The project compiled without error, and so as instructed (With Outlook closed) I started it in debug mode (F5). Oulook 2010 began to launch, but never did, and instead I go this message from Visual Studio:

    LoaderLock was detected
    Message: 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.

    Thereafter, I shut the program down, relaunched Outlook and the add-in was working as advertised. Windows 7, Visual Studio 2010, Office 2010 (32-Bit)

    But, what did I do wrong, or what am I doing wrong? Why the 'Loaderlock' message?


    Thanks

    • Edited by ITMn0403 Tuesday, January 24, 2012 8:31 PM
    Tuesday, January 24, 2012 8:26 PM

Answers

  • When running in debug mode that occurs if an OS-related function is in process and certain managed code is executed. For example I get that often when loading a subsidiary DLL in my addin startup code.
     
    You can just continue execution, or you can use Debug, Exceptions and expand "Managed Debugging Assistants" and scroll down and uncheck the Thrown condition for LoaderLock. That will disable the error from firing if it's thrown, but not if if's unhandled.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "ITMn0403" <=?utf-8?B?SVRNbjA0MDM=?=> wrote in message news:a2f98e08-160a-4e79-9887-aa5e64a4ed26...
    So I follow the instructions this walk-through detailed. http://msdn.microsoft.com/en-us/library/cc668191.aspx
    The project compiled without error, and so as instructed (With Outlook closed) I started it in debug mode (F5). Oulook 2010 began to launch, but never did, and instead I go this message from Visual Studio:

    LoaderLock was detected
    Message: 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.

    Thereafter, I shut the program down, relaunched Outlook and the add-in was working as advertised. Windows 7, Visual Studio 2010, Office 2010 (32-Bit)

    But, what did I do wrong, or what am I doing wrong? Why the 'Loaderlock' message?


    Thanks


    Ken Slovak MVP - Outlook
    • Marked as answer by ITMn0403 Tuesday, January 24, 2012 9:25 PM
    Tuesday, January 24, 2012 9:02 PM
    Moderator