Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Unable to load (unmanaged) DLL: not found

Unable to load (unmanaged) DLL: not found

Scheduled Pinned Locked Moved C#
visual-studiocomdebugginghelpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HosamAly
    wrote on last edited by
    #1

    I am getting an error loading a function from an unmanaged DLL, but I'm getting this error:

    System.DllNotFoundException: Unable to load DLL 'MyLibrary.dll': The specified module could not be found.
    (Exception from HRESULT: 0x8007007E)

    I have the DLL file in the project next to the source code files, and its properties are set to "copy if newer". Even "copy always" did not work. The file is there, but the application can't find it (at least in VS Debugger)! :wtf: I tried checking File.Exists("MyLibrary.dll"), and it returns true! Any idea what's happening? :confused:

    My LinkedIn Profile

    S 1 Reply Last reply
    0
    • H HosamAly

      I am getting an error loading a function from an unmanaged DLL, but I'm getting this error:

      System.DllNotFoundException: Unable to load DLL 'MyLibrary.dll': The specified module could not be found.
      (Exception from HRESULT: 0x8007007E)

      I have the DLL file in the project next to the source code files, and its properties are set to "copy if newer". Even "copy always" did not work. The file is there, but the application can't find it (at least in VS Debugger)! :wtf: I tried checking File.Exists("MyLibrary.dll"), and it returns true! Any idea what's happening? :confused:

      My LinkedIn Profile

      S Offline
      S Offline
      Simon P Stevens
      wrote on last edited by
      #2

      Post the code you are using to load the dll.

      Simon

      H 1 Reply Last reply
      0
      • S Simon P Stevens

        Post the code you are using to load the dll.

        Simon

        H Offline
        H Offline
        HosamAly
        wrote on last edited by
        #3

        [DllImport("MyLibrary.dll")]void myFunction();

        I think I found the error: MyLibrary.dll depends on another DLL, and that other was not found. The error message is misleading. Thanks.

        My LinkedIn Profile

        S 1 Reply Last reply
        0
        • H HosamAly

          [DllImport("MyLibrary.dll")]void myFunction();

          I think I found the error: MyLibrary.dll depends on another DLL, and that other was not found. The error message is misleading. Thanks.

          My LinkedIn Profile

          S Offline
          S Offline
          Simon P Stevens
          wrote on last edited by
          #4

          Cool. At least you figured it out.

          Simon

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups