Loader lock was detected

pachjo

Well-known member
Joined
Dec 12, 2006
Messages
370
Programming Experience
10+
I am now getting the above error against this line of code that has worked happily in my application I am developing for months?

VB.NET:
If frmLogon.ShowDialog().Equals(Windows.Forms.DialogResult.OK) Then

The debugger appears stating this:

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.

I am completely lost as to what this means?

Help anyone:confused:
 
If frmLogon.ShowDialog() = Windows.Forms.DialogResult.OK Then



or:
VB.NET:
Select Case frmLogon.ShowDialog()
  Case Windows.Forms.DialogResult.OK
    'Code for 'ok' button here
  Case Windows.Forms.DialogResult.Cancel
    'Code for 'cancel' button here
End Select
 
Strangely I have found the cause of this....it is iTunes?

If I dont have it running I don't get this error when developing my app. But if I open iTunes to play music I get the error?

So a few questions please....

Why does iTunes do this?

I cannot find the exceptions options within my project to disable MDA?

Should I use your method and if so why provide a new way only to casue this problem?

Thanks
 
i don't know, ITunes has always been a problem since it was created, that's why I use winamp instead of itunes

are you making an app to interact with itunes?
 
No not at all.

I am designing a home finance application and over the weekend installed iTunes to buy music online and to load onto my iPod I got from my son.

The loader lock error occured but I did not make the connect? I then was using VS.NET without iTunes running and found the error was gone and thought no more of it.

But later I started iTunes and the error returned. I then made the connection that iTunes was the problem.

The app has nothing to do with iTunes so I am worried that my finished app will fall over on a target PC if iTunes is running.....or another app the user may have installed that does what ever iTunes is doing to cause this problem.

Yoinks! I have no idea how to resolve this!!!:confused:
 
hmmm, the only reason i can think of is your app is using a file that ITunes also uses, which isn't the case here

if ITunes is interfering with the .Net framework then Apple is a bigger pain the the *** than I thought
 
I googled around a bit and probably since iTunes version 7.10 came out, there is that loader lock problem.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1353717&SiteID=1

Only solution for now is to close iTunes while debugging or turn of the Loader Lock check via "Debug -> Exceptions ... -> Managed Debugging Assistants - uncheck loader lock.
 
Thanks for the info and help chaps ;)

I am rather embarrassingly seeming unable to locate debug-exceptions-mda? I don't see this option.

Also are you able to say if this is only a problem whilst debugging? I mean when I finish my app and distribute will the final released product suffer at that hands of iTunes still?

Thanks again....P
 
Back
Top