Mixed Mode dll LoadLibrary failure ERROR_DLL_INIT_FAILED

I have a .NET 2.0 Mixed Mode dll I am attempting to load using the LoadLibrary command from an MFC application. Every time I try to load the library LoadLibrary returns the error 1114 (ERROR_DLL_INIT_FAILED). If I create a new application from scratch and attempt to load this DLL it loads fine.

I have done some reading and I have seen some problems with this using Mixed Mode DLLs statically linked to the CRT, but we have none of these. This used to work in the 7.1 CRT. Has something changed in version 8.0 that would cause this behavior Can anyone suggest a way to debug this issue

Additonal Information: All dll's involed in this project are compiled with the /MDd option per the following thread: http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.vc.language&tid=8eb017f5-8116-40dc-9c28-6102fcfc39ca&cat=en-us-msdn&lang=en&cr=US&sloc=en-us&m=1&p=1


Answer this question

Mixed Mode dll LoadLibrary failure ERROR_DLL_INIT_FAILED

  • Cherry 00613

    I have figured it out and boy do I feel dumb. This application was being ported from the .NET 1.1 framework. There was a .exe.config file that was forcing the dll to load in the .NET 1.1 context. This is what causes this error.

  • Mixed Mode dll LoadLibrary failure ERROR_DLL_INIT_FAILED