IIS 7+ Register and Execute ISAPI 32bit/64bit DLL

I resently had to move an old project that I had from an Windows 2003 Server to a brand new Windows 2012 Server R2. The concern that I wad was with some ISAPI dlls that I was using to sync data from an SQL Server to some Windows Mobile devices using SQL Server CE. I was using merge replication to sync the devices and was doing it through the web (using sqlcesa30.dll).

First I tried to simply copy the DLLs but that didn’t work. Then I decided to try to run the setup but that didn’t work either. That is when I started to play around with IIS to find out what is going on since I was getting that frustrating Internal Server Error (500) which gives you no clue as of what is going on!

Here are the steps you need to take in order to register and execute a DLL on IIS 7+.

  1. Create a folder to put the the executable (this is not required but changes might affect other services running).
  2. Make that folder an application and create a new application pool for it.
  3. Open Internet Information Services (IIS) Manager and click on the server on the tree. Then click ISAPI and CGI Restrictions. There you need to add the executable you need to run and click Allowed.
  4. Then find and click the application folder on the tree and then go to Handler Mappings and then Edit Feature Permissions (which is on the right pane). There enable the Execute setting.
  5. Finally go to the application pool, select the application pool you crated and in advanced settings set Enable 32-Bit Applications to true. (this is only required if you are trying to run an x86 DLL but it does not do any harm to enable it either way)

Hope this helps you register and run any DLL so that is at least executed and you don’t get that annoying Internal Server Error 500 that you have no clue as of what is going on.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.