title: the function LoadLibrary from kernel32.dll returns zero in Asp web application
body: <p>I'am going to use a kernel32 dll in asp.net web application. This is the code:
  //DllGetClassObject function pointer signature
      private delegate int DllGetClassObject(ref Guid ClassId, ref Guid InterfaceId, [Out, MarshalAs(UnmanagedType.Interface)] out object ppunk);</p>
  
  <pre><code>//Some win32 methods to load\unload dlls and get a function pointer
  private class Win32NativeMethods
  {
    [DllImport("kernel32.dll", CharSet=CharSet.Ansi)]
    public static extern IntPtr GetProcAddress(IntPtr hModule, string lpProcName);
  
    [DllImport("kernel32.dll")]
    public static extern bool FreeLibrary(IntPtr hModule);
  
    [DllImport("kernel32.dll")]
    public static extern IntPtr LoadLibrary(string lpFileName);
  }
  public string GetTheDllHandle (dllName)
  {
      IntPtr dllHandle = Win32NativeMethods.LoadLibrary(dllName); // the dllHandle=IntPtr.Zero
      return dllHandle.ToString();
  }
  </code></pre>
  
  <p>The problem that when I call my function  GetTheDllHandle, the dllHandle return zero </p>
  
  <p>Did anybody out there made something similar? Or does anybody have any suggestions?</p>