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. Web Development
  3. ASP.NET
  4. DLL dependency woes

DLL dependency woes

Scheduled Pinned Locked Moved ASP.NET
helpquestioncsharpc++asp-net
3 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.
  • N Offline
    N Offline
    NoCake
    wrote on last edited by
    #1

    Hi all, I posted earlier about a problem I had with DLL dependencies in ASP.NET. I followed up saying I'd solved the problem, but I was being foolish (I'd forgotten to un-stub some critical functions that forced linking). Basically, I have the following setup: ASP.NET Page --[DllImport]--> C++ Wrapper.DLL -- [static link to] --> C++ Unmanaged.DLL "Wrapper.DLL" is in the web page \bin directory. I always get the error "File or assembly name Wrapper, or one of its dependencies, was not found". This is because it can't find "Unmanaged.DLL". If I remove all references to "Unmanaged.DLL" in "Wrapper.DLL" and stub out all functions, then the web page loads fine (i.e. I know there are no problems finding "Wrapper.DLL" itself - it must be failing to find "Unmanaged.DLL"). If I put "Unmanaged.DLL" in \windows\system32\ then the web page loads fine. If I put "Unmanaged.DLL" anywhere else, I get the "File or assembly... not found" error. What is going on here? There must be a place that I can put my DLLs that isn't the windows system folder... Andy

    A 1 Reply Last reply
    0
    • N NoCake

      Hi all, I posted earlier about a problem I had with DLL dependencies in ASP.NET. I followed up saying I'd solved the problem, but I was being foolish (I'd forgotten to un-stub some critical functions that forced linking). Basically, I have the following setup: ASP.NET Page --[DllImport]--> C++ Wrapper.DLL -- [static link to] --> C++ Unmanaged.DLL "Wrapper.DLL" is in the web page \bin directory. I always get the error "File or assembly name Wrapper, or one of its dependencies, was not found". This is because it can't find "Unmanaged.DLL". If I remove all references to "Unmanaged.DLL" in "Wrapper.DLL" and stub out all functions, then the web page loads fine (i.e. I know there are no problems finding "Wrapper.DLL" itself - it must be failing to find "Unmanaged.DLL"). If I put "Unmanaged.DLL" in \windows\system32\ then the web page loads fine. If I put "Unmanaged.DLL" anywhere else, I get the "File or assembly... not found" error. What is going on here? There must be a place that I can put my DLLs that isn't the windows system folder... Andy

      A Offline
      A Offline
      Aryadip
      wrote on last edited by
      #2

      hi, As far as I know... Whenever you refer to an unmanaged DLL the CLR tries to locate the DLL in "system32"... if it can't find there then it looks for the DLL in all the folders mentioned in the "Path" environment variable... So this emplies that if you need to keep the DLL in some other place other than system32 then `you need to put the path in the environment variable... To set the environment variable please refer to a recent post in .NET Framework message board where a person has explained how to set the environment variable programatically... Hope this solves your problem... please don't mind if I have missed on something... regards, Aryadip. Cheers !! and have a Funky day !!

      N 1 Reply Last reply
      0
      • A Aryadip

        hi, As far as I know... Whenever you refer to an unmanaged DLL the CLR tries to locate the DLL in "system32"... if it can't find there then it looks for the DLL in all the folders mentioned in the "Path" environment variable... So this emplies that if you need to keep the DLL in some other place other than system32 then `you need to put the path in the environment variable... To set the environment variable please refer to a recent post in .NET Framework message board where a person has explained how to set the environment variable programatically... Hope this solves your problem... please don't mind if I have missed on something... regards, Aryadip. Cheers !! and have a Funky day !!

        N Offline
        N Offline
        NoCake
        wrote on last edited by
        #3

        Hi Aryadip, That looks like it worked great. Wierd that there is no other mechanism to do this apart from setting environment variables... Many thanks for the help, Andy P.S. I had a funky day.

        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