First time here? You are looking at the most recent posts. You may also want to check out older archives or the tag cloud. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS. Thank you for visiting! (hide this)

Today I started getting a strange exception every time I try to enter a character in a textbox:

LoaderLock detected
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.

But I was just typing a character in a test application with only a textbox, not doing anything so exotic.

After banging my head against the wall for a few hours I found onĀ MSDN forum a strange compatibility issue between Visual Studio 2005 and iTunes 7.1: LoaderLock detected, only when iTunes running...

Microsoft did a research on the issue and here is the result:

We are sorry that you are experiencing problems when running iTunes 7.1 and VS 2005. Here is the results of our research:

We noticed that iTunesKeyboardCompatibility.dll is causing the LoaderLock MDA to fire. The most likely reason is that the DLL entry point for this DLL is doing some non-trivial work which causes managed code to run. There are serious limits on what a DLL can do in the DLL entry point (i.e. DllMain()). For more information, you can refer to

This will need to be resolved by iTunes.

So only two possible solutions:

  1. move to WinAmp, or install iTunes 6.x
  2. disable the LoaderLock MDA from the Debug>Exception>Managed Debugging Assistant

Since I listen to music while working, I think I'll disable the MDA smile_regular

Actually the problem happens only when the iTunesHelper process is running, not with the main iTunes process.

posted on Wednesday, May 9, 2007 1:38 PM

Comments on this entry:

# re: iTunes causing VS to throw LoaderLock exception

Left by Jeff at 5/14/2007 4:49 AM

Removing the iTunesKeyboardCompatibility.dll will also resolve this problem. iTunes runs just fine without this DLL, you just won't be able to use the media keys on your keyboard when iTunes isn't the frontmost application.

# re: iTunes causing VS to throw LoaderLock exception

Left by Mikey2 at 5/18/2007 7:14 PM

One more note: deleting iTunesKeyboardCompatibility.dll is not have to add a blank file or folder with that exact same name or else it will recreate itself.

My SecurityTaskManager shows all sorts of warnings about this file anyway, I do not trust anything that explicitly hijacks all key-inputs anywhere on your machine.

Comments have been closed on this topic.