GeckoEngine and C# load dll drivers problem
<pre><code>Message: Couldn't load library  C:\_ZAGON\TMP\DLL\GeckoEngine\xulRunner\freebl3.dll
There was an error during dll loading :  C:\_ZAGON\TMP\DLL\GeckoEngine\xulRunner\freebl3.dll, error - 18
Stack trace:    at TMP.CrawlerApp.CrawlerApp.LoadWin32Library(String dllFilePath) in CrawlerApp.cs:line 149
</code></pre>

<p>line 149:</p>

<pre><code>throw new Exception(String.Format("Couldn't load library {0}{1}{2}", dllFilePath, Environment.NewLine, exc.Message), exc);
</code></pre>

<p>whole code:</p>

<pre><code>DllImport("wininet")]
        private static extern int InternetGetConnectedState(ref int lpdwFlags, int dwReserved);

        [DllImport("wininet")]
        private static extern int InternetAutodial(int dwFlags, int hwndParent);

        [DllImport("kernel32.dll")]
        private static extern IntPtr LoadLibraryEx(string dllFilePath, IntPtr hFile, uint dwFlags);

        [DllImport("kernel32.dll")]
        public static extern bool FreeLibrary(IntPtr dllPointer);

        private IntPtr LoadWin32Library(string dllFilePath)
        {
            try
            {
                IntPtr moduleHandle = LoadLibraryEx(dllFilePath, IntPtr.Zero, LOAD_WITH_ALTERED_SEARCH_PATH);
                if (moduleHandle == IntPtr.Zero)
                {
                    // I'm gettin last dll error
                    int errorCode = Marshal.GetLastWin32Error();
                    throw new ApplicationException(
                        string.Format("There was an error during dll loading : {0}, error - {1}", dllFilePath, errorCode)
                        );
                }

                return moduleHandle;
            }
            catch (Exception exc)
            {
                throw new Exception(String.Format("Couldn't load library {0}{1}{2}", dllFilePath, Environment.NewLine, exc.Message), exc);
            }
        }

private void LoadDLL()
        {
            string XulRunnerPath = @" C:\_ZAGON\TMP\DLL\GeckoEngine\xulRunner";\NCrawler\GeckoEngine\xulRunner";

            string[] files = Directory.GetFiles(XulRunnerPath, "*.dll");
            foreach (var file in files)
            {
                LoadWin32Library(file);
            }
        }
</code></pre>

<p>what can cause this error. In win 7 works but when i copy to server i get this error. </p>
