title: Unable to load release DLL specified in AppInit_DLLs on Windows 7
body: <p>We hook a library (say xyz.dll) through HKLM\Software\Microsoft\WindowsNT\CurrentVersion\Windows\AppInit_DLLS path. </p>
  
  <p>I need to debug this library so I created nondebug dll(&amp;pdb) and replaced it with original xyz.dll library in System32 directory. Now when a process tries to load this libary, I get an "bad image" error as following - </p>
  
  <p>"C:\Windows\system32\xyz.dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vender for support." </p>
  
  <p>I noticed that original xyz.dll is code signed so I also signed my compiled nondebug xyz.dll with a temporary certificate using signtool, but it didn't help. As per the [MSDN] (<a href="http://msdn.microsoft.com/en-us/windows/hardware/gg463040.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/windows/hardware/gg463040.aspx</a>) code-sign is recommended but not mandatory.</p>
  
  <p>Later I realized that when I got my nondebug library xyz.dll signed by a valid certificate, it worked.   </p>
  
  <p>My question : is there any way so that Windows 7 can bypass the dll's signature verification ? Getting a valid certificate and signing a library every time it is generated seems very cumbersome for development/debugging purpose.  Is there any easy way out ?</p>