locked
Unable to load DLL 'IsLicense40.dll': The specified module could not be found. RRS feed

  • Question

  • Hi there,

    I have a 3rd party library I'm using called QlmLicenseLib.dll in my .net web project.  This dll references a native dll called IsLicense40.dll.  IsLicense40.dll must be present in the same folder with QlmLicenseLib.dll in order to work.  Running the web project in Visual Studio is fine, however, when I upload my web project to a shared server in the bin folder, I get the error message "Unable to load DLL 'IsLicense40.dll': The specified module could not be found." even when IsLicense40.dll is present in the web bin folder. 

    I read somewhere that since the dll is native, the CLR would not copy it into a temporary folder under which IIS runs my project.  The CLR only copies away managed dll (not the native ones).  They suggested to add IsLicense40.dll to the class PATH environment variable, however, I do not have access to this with the shared server.

    Can anyone provide any suggestions or if my understandings are incorrect?

    Thanks,

    Luke

    • Moved by nobugz Wednesday, August 19, 2009 7:44 AM forums.asp.net (From:Common Language Runtime)
    Tuesday, August 18, 2009 11:30 PM

Answers

  • Thanks Geert for the reply.

    On my local dev machine, I do have the post-build step to copy the dll to the bin directory.  It was just when I uploaded the dll to the bin folder on the shared server, it could not load it.

    I tried these lines in my code after putting the dll in the qlm folder and it worked finally:

    string newPath = System.Web.Hosting.HostingEnvironment.MapPath("~/qlm/");     
    string currentPath = System.Environment.GetEnvironmentVariable("path");
    System.Environment.SetEnvironmentVariable("path", currentPath + ";" + newPath); 
    Cheers,

    Luke
    • Marked as answer by Luke Hutton Wednesday, August 19, 2009 8:06 PM
    Wednesday, August 19, 2009 8:06 PM

All replies

  • Did you add a reference to it? If so, make sure to set the "Copy to output directory" to true. Otherwise, copy it manually or use the Post-build step option to copy the file to the bin directory from your lib directory (for example, I sign files that way, or compress executables using UPX, etc).


    Geert van Horrik - CatenaLogic
    Visit my blog: http://blog.catenalogic.com

    Looking for a way to deploy your updates to all your clients? Try Updater!
    Wednesday, August 19, 2009 7:20 AM
  • Thanks Geert for the reply.

    On my local dev machine, I do have the post-build step to copy the dll to the bin directory.  It was just when I uploaded the dll to the bin folder on the shared server, it could not load it.

    I tried these lines in my code after putting the dll in the qlm folder and it worked finally:

    string newPath = System.Web.Hosting.HostingEnvironment.MapPath("~/qlm/");     
    string currentPath = System.Environment.GetEnvironmentVariable("path");
    System.Environment.SetEnvironmentVariable("path", currentPath + ";" + newPath); 
    Cheers,

    Luke
    • Marked as answer by Luke Hutton Wednesday, August 19, 2009 8:06 PM
    Wednesday, August 19, 2009 8:06 PM