none
WCF Web service not working due to "Could not load file or assembly" RRS feed

  • Question

  • Hi,

    i created a WCF web service and added reference of 'Sample.DLL'.

    Code build properly with out error.

    I got following error on accessing web service URL:

    Could not load file or assembly 'Sample.DLL' or one of its dependencies. The specified module could not be found. 

      Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 


     Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Sample.DLL' or one of its dependencies. The specified module could not be found.

    Friday, December 29, 2017 8:05 AM

All replies

  • If the WCF Web service was deployed to IIS, then the DLL is not in the Bin folder for the Web service.
    Friday, December 29, 2017 6:43 PM
  • Hi sumith,

    Did you access the service which is launched from VS or IIS?

    Have you configured this dll “Copy Local” as true?

    If you fail to resolve this issue, it would be helpful if you could share us a simple project which could reproduce your issue.

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 1, 2018 2:03 AM
  • please find the error image  attached.
    Wednesday, January 3, 2018 5:45 AM
  • Hi sumith,

    We alread know your error message. Could you clear questions below?

    Did you access the service which is launched from VS or IIS?

    Have you configured this dll “Copy Local” as true?

    It would be helpful if you could share us a simple project which could reproduce your issue.

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, January 3, 2018 5:48 AM
  • Did you access the service which is launched from VS or IIS?

    Ans : both VS or IIS tried.  issue remains.

    Have you configured this dll “Copy Local” as true?

    Ans:  Yes

    I tried to call  as below:

       WCF web service

               |

      C++ cli wrapper library

              |

      C++ library


    Wednesday, January 3, 2018 6:22 AM
  • Did you access the service which is launched from VS or IIS?

    Ans : both VS or IIS tried.  issue remains.

    Have you configured this dll “Copy Local” as true?

    Ans:  Yes

    I tried to call  as below:

       WCF web service

               |

      C++ cli wrapper library

              |

      C++ library



    You are talking C++. Is this a C++ DLL and it is not a .NET managed DLL?
    Wednesday, January 3, 2018 8:10 AM
  • Hi sumith,

    Based on your description, I think your issue is related with using C++ library in C#. To check whether it is specific to WCF, I suggest you create a new console app to reference this library, will it work?

    I suggest you refer link below to debugging assembly loading failures.

    #Debugging Assembly Loading Failures

    https://blogs.msdn.microsoft.com/suzcook/2003/05/29/debugging-assembly-loading-failures/

    You could try link below to check the dependency.

    http://www.dependencywalker.com/  

    Best Regards,

    Tao Zhou

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 4, 2018 1:56 AM
  • In case 'x86', the web service works ( C++\CLI library and web service build with 'x86')

    But  issue still exists in case of 'x64' build

    Is there any problem in using C++\CLI library with WCF webservice.??

    Friday, January 5, 2018 7:49 AM
  • Hi sumith,

    If you build the C++\CLI library under x64, will it work under web service x64?

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, January 5, 2018 7:53 AM
  • No. its not working

    C++\CLI library   -  x64

    WCF web service - x64

    Friday, January 5, 2018 8:01 AM
  • To check whether it is related with WCF, will it work under Console APP with x64?


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, January 5, 2018 8:03 AM
  • yes, its works under the console app.

    In case of Wcf web service,  'C++\CLI library' excluded, Wcf web service will works.


    Friday, January 5, 2018 9:07 AM
  • Hi sumith,

    Which account did you use to run WCF Web Service? Will it work if you run it under the current domain account?

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 8, 2018 7:22 AM