Running Visual Studio 2005 ATL Server Web Service on IIS 7 Windows Server 2008 R2

I was surprized that the default Visual Studio 2005 ATL Server Web Service project template does not work as-is on IIS 7 – Windows Server 2008 R2 (x64). I needed to correct the following issues before the hello world example could work:

  • The .htm file points to the wrong dll. It is created pointing to <projectname>.dll?Handler=Gen<projectname>WSDL But instead it needs to point to <projectname>Isapi.dll?Handler=Gen<projectname>WSDL

This first error causes initially an HTTP 404.2 error because <projectname>.dll is not in the IIS enable list of ISAPI and CGI Restrictions. Adding that dll would get you beyond the 404.2, but right into a 500.0 0x8007007f “There is a problem with the resource you are looking for, so it cannot be displayed.” because the entry point for Isapi does not exist in the dll. The proper fix is to modify the .htm file to point to the isapi dll.

  • The compiled dlls are 32-bit, but .Net Default Application Pool (DefaultAppPool) expects 64-bit. The proper but difficult fix is to change compilation to 64-bit. The quick fix is to edit the advanced settings for DefaultAppPool and change the “Enable 32-Bit Applications” property from False to True. Note that you may not want to change such setting on a production server as it may impact negatively other applications running on the server.

This article was helpful to see all the settings needed for a succesful run:

However you do not need the virtual directory that this article uses. The IIS Application created by VS 2005 works, given that you adjust the setting and fix the .htm file as indicated above.

This said, now that I have these fixes in place, and see the dll entry point being called, I hit a break point in ATL and ultimately get to a new HTTP 500 in IE. So there is yet one or more issues with the project template I have to figure out.

This entry was posted in Computers and Internet, Microsoft, Ordinateurs et Internet, Travail, work. Bookmark the permalink.

3 Responses to Running Visual Studio 2005 ATL Server Web Service on IIS 7 Windows Server 2008 R2

  1. daviburg says:

    The same dll name error is present in the .disco file.

  2. daviburg says:

    As is where I see a breakpoint hit in ATL, reading tells me I may need to build 64 bit afterall, and the quick workaround of enabling 32 bit to run in the default app pool won’t do. Because I am building a project in VS 2005, which apparently is the last version of VS to support to old type of project, upgrading to the latest ATL release is not an easy option, if an option at all.

    I also noticed that by default VS 2005 does not install the 64 bit compiler, so I have to update my installatin of VS 2005.

  3. daviburg says:

    And now I am doubting myself. Because GenWSDL isn’t in the isapi dll, but the projectname dll. I must be missing something basic, but also I am probably on the wrong track trying to emulate an old service. WCF with basic binding may be a better approach.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s