LoaderLock using Visio Drawing Control in VS 2005

  • Thread starter Chris Pomerantz
  • Start date
C

Chris Pomerantz

Hi,

I'm using the Visio Drawing Control embedded in a Windows Forms Application
in VS 2005 and when I close my application I get an MDA error saying
something about a LoaderLock. Any idea how to make this go away?

Here's the exact 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.

I get the same result if I just create a simple application with a Form and
the control embedded in it.

Thanks,
Chris
 
R

Roger

Hi Chris
I've just encountered the same problem and have discovered the error can be
prevented by disabling the LoaderLock exception from the
Debug>Exceptions>Managed Debugging Assistants menu. I also found it necessary
to add GC.Collect() GC.WaitForPendingFinalizers() twice before closing my app
to prevent it hanging in the IDE.

Does anyone know whether this is just hiding the problem or if it's a
reliable long-term solution? I'm just starting a major new project with VB
2005 and the Visio 2003 Drawing Control so I'm anxious to know.
Best regards
Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top