A dynamic link library (DLL) initialization routine failed


  • Hi,


    Getting the above error while using unmanaged dll in the managed windows service. In the Dependency walker, DLL is clear without any dependency issues except a warning (Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.). But when i googled and learnt that it can be ignored as i'm not using any delayed dll.


    I'm placing the required unmanged dll in the "c\windows\system32" as part of the installation. installation is through and i dont find any permission issues also as I can copy few crt files in the system 32 directory.  infact getting the same error if i place the dll in other places also.


    I'm using my XP machine with .net 3.5 SP1 and using windows 2008 server as target machine with same .net 3.5 sp1. 


    I stuck on this for few days and yet to find the solution. Please Help.



    Monday, August 23, 2010 9:44 AM


All replies

  • Please add the complete exception details and the stacktrace
    Monday, August 23, 2010 11:37 AM
  • Please find the exception details here..


    Error Message :Unable to load DLL 'C:\WINDOWS\system32\Streaming_Interface.dll': A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A) Stack Trace :    at Utility2.ManagedInterface.StreamingServiceInit()

       at Streaming_Service.Service1.StartStreamingService()


    Ex.Data: System.Collections.ListDictionaryInternal





    Monday, August 23, 2010 2:04 PM
  • Hi,

    An “initialization routine failed.” problem generally occurs because a) some dll that this dll referenced was not found or b) something in the init method failed.

    The problem is that option B could really mean anything, such as the init routine making calls that require permissions that you don’t have, or for example that it interacts with the desktop which is not permitted from a service etc.

    The most common issue though is that the component was not properly installed, so that some of its dependencies are not available.

    Check out the following blog for possible solutions:


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by sureshthi Friday, August 27, 2010 5:35 AM
    Thursday, August 26, 2010 5:19 AM
  • Hi Binze


    Thank you for your time and response. I could solve this. Problem was missing DLLs. I supposed to register some DLLs required for the application. Acutlally I did that but it seems some of the DLLs were not registered properly.




    Friday, August 27, 2010 5:38 AM