Re: Strange behavior Part 2

Fabian Schmied <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.winforms
Message-ID <[email protected]>
> I the this error simply by hitting the ctrl or shift key as soon as I start
> the program in debug only. Everything works fine if running as stand alone
> program outside of VS.

The problem is just not detected when run outside of the debugger. As
the message implies, it could cause the application to hang even when
you don't see that debug message.

> 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.
>
> Not even sure what that means.

I'd guess you're using some (maybe 3rd party) DLL written in managed
C++ with .NET 1.1. This DLL is trying to execute managed code from its
DLLMain, which is potentially harmful to do and which Visual Studio
2005 now detects.

You probably need to contact the people who created the DLL and ask
them what to do. Either they will give you a new version of the DLL,
which avoids doing that harmful thing. Or they will tell you that
their DLL is safe (or tell you in what circumstances it is safe), in
which case you can turn of the loader lock debugging assistant.

Here is some information on how to turn it off:
http://www.thezbuffer.com/articles/304.aspx (the article talks about
Managed DirectX for .NET 1.1, which had the same problem). However,
I'd first make sure that the DLL is really safe to use, otherwise you
could get sporadic hangs in your application...

Regards,
Fabian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.