title: Mercurial failed to load in IIS 7 on windows 2008
body: <p>Trying to setup Mercurial on windows 2008 using IIS 7. Followed the instruction from the following links,</p>
  
  <p><a href="http://stackingcode.com/blog/2011/02/24/running-a-mercurial-server-on-iis-7-5-windows-server-2008-r2" rel="nofollow">http://stackingcode.com/blog/2011/02/24/running-a-mercurial-server-on-iis-7-5-windows-server-2008-r2</a></p>
  
  <p><a href="http://www.jeremyskinner.co.uk/mercurial-on-iis7/" rel="nofollow">http://www.jeremyskinner.co.uk/mercurial-on-iis7/</a></p>
  
  <p>After the setup, when I try to load the hgweb.cgi page, I keep having the error "DLL failed loading". Bellow shows the full error message.</p>
  
  <p>From the error, it quite hard to know which DLL is missing. I have tried to find the missing DLL, but do not succeed. Has anyone having the same problem before? What's the missing DLL?</p>
  
  <p>I'm using Murcurial 2.0 and python 2.6 with the precompiled installer. Tried both x86 and x64 installer, still has the same problem.</p>
  
  <blockquote>
    <p>HTTP Error 502.2 - Bad Gateway The specified CGI application<br>
    misbehaved by not returning a complete set of HTTP headers. The<br>
    headers it did return are "Traceback (most recent call last): File<br>
    "C:\inetpub\wwwroot\hg\hgweb.cgi", line 24, in  application =<br>
    hgweb(config) File "mercurial\hgweb__init__.pyc", line 26, in hgweb<br>
    File "mercurial\hgweb\hgwebdir_mod.pyc", line 89, in <strong>init</strong> File<br>
    "mercurial\hgweb\hgwebdir_mod.pyc", line 98, in refresh File<br>
    "mercurial\ui.pyc", line 43, in <strong>init</strong> File<br>
    "mercurial\demandimport.pyc", line 86, in <strong>getattribute</strong> File<br>
    "mercurial\demandimport.pyc", line 58, in _load File<br>
    "mercurial\scmutil.pyc", line 164, in  File<br>
    "mercurial\scmutil.pyc", line 180, in opener File<br>
    "mercurial\demandimport.pyc", line 86, in <strong>getattribute</strong> File<br>
    "mercurial\demandimport.pyc", line 58, in _load File<br>
    "mercurial\util.pyc", line 27, in  File<br>
    "mercurial\demandimport.pyc", line 86, in <strong>getattribute</strong> File<br>
    "mercurial\demandimport.pyc", line 58, in _load File<br>
    "mercurial\windows.pyc", line 13, in  File<br>
    "mercurial\demandimport.pyc", line 86, in <strong>getattribute</strong> File<br>
    "mercurial\demandimport.pyc", line 58, in _load File<br>
    "mercurial\win32.pyc", line 11, in  File<br>
    "mercurial\demandimport.pyc", line 86, in <strong>getattribute</strong> File<br>
    "mercurial\demandimport.pyc", line 58, in _load File<br>
    "ctypes__init__.pyc", line 10, in  File<br>
    "mercurial\demandimport.pyc", line 114, in _demandimport File<br>
    "_ctypes.pyc", line 12, in  File "_ctypes.pyc", line 10, in<br>
    __load ImportError: DLL load failed: The specified module could not be found. ".  </p>
  </blockquote>