Page 1 of 1

Attempting managed execution inside OS Loader lock.

Posted: Wed Dec 04, 2013 9:19 am
by Alex
Hello,

OS Loader lock exception may occur only when application that uses VintaSoftTwain.NET SDK is debugged in Visual Studio. This is not an error.

The exception occurs because VintaSoftTwain.NET SDK (managed assembly) uses TWAIN driver (unmanaged application) for management of scanner and TWAIN driver executes code in a separate thread which attempting to illegally call into managed code (return to the code of SDK) while holding the operating system's loader lock.

You can disable the LoadLock exception as following:
  • Run Visual Studio
  • Open the project
  • Select the "Debug => Exceptions..." menu
  • Extend "Manage debugging assistants"
  • Uncheck "LoaderLock" in the list
OS Loader lock exception cannot occur when application that uses VintaSoftTwain.NET SDK is executed without Visual Studio.

Best regards, Alexander