Wednesday, July 28, 2010

Troubleshooting a Failed Deployment of WCF Services on IIS7

In this blog post I will describe a problem that I recently experienced while developing a new WCF service and deploying it to a local IIS installation on Windows 7. The details of the service itself are unimportant; rather, the specific problems are related to the deployment of the service and with the setup and installation of IIS.

When attempting to browse to the newly deployed service (which was nothing more than a stub at this point), I experienced two problems. First, there was no handler mapping for the .svc extension. After I rectified that, I received the following error:

HTTP Error 500.21 – Internal Server Error
Handler “svc-Integrated” has a bad module “ManagedPipelineHandler” in its module list

According to the error page that was presented, the most likely causes were:

  1. Managed handler is used; however, ASP.NET is not installed or is not installed completely.
  2. There is a typographical error in the configuration for the handler module list.

How I got here:

  1. I installed the Internet Information Services through the Control Panel \ Windows Features dialog.

  2. I then manually created a new Application Pool to host the new services web site.

  3. From there I created a new Web Site to host the service.

  4. Last, I set my publication settings in Visual Studio to push the service and its implementation to the newly created website. Executing the publish from the IDE all things went well.

 

When I browsed to the service in the IIS Manager, I received the dreaded error above.

The root cause of this is mainly a timing issue. Depending on the order in which you install .NET and IIS, then the WCF and ASP.NET handlers and related modules will not be properly configured. Fortunately, resolving the issue is fairly straightforward.

  1. To resolve the problem with a lack of a .svc handler mapping, run the following:
    “%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe –i”

    or if you are running with .NET 4, then the path is:
    “%windir%\Microsoft.NET\Framework\v4.0.30319\ServiceModelReg.exe –i”

    * Note that if you’re running on a 64-bit O/S you will need to change the path to use “Framework64” instead of “Framework”
  2. Lastly, to resolve the error above, you need to re-run the ASP.NET registration using this command:
    “%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe –i”

Once you’ve done that, you should be able to then access your WCF service. Hope this helps resolve this for you if you run into a similar situation.

del.icio.us Tags: ,,,

Thursday, July 15, 2010

Expression Blend 4

I’m not sure where I missed it, but Expression Blend 4 is now out. I recently went back to create a SketchFlow project to model some stories I’m working on for a proof of concept application and found that Expression Blend 3 does *not* integrate with Visual Studio 2010. I posted a #fail message on Twitter and low and behold @mfcollins3 and @unnir were nice enough to point out that Blend 4 was not only out but *did* work with Visual Studio 2010.

Thanks for the info. I’m downloading and installing Blend 4 as I write this and will hopefully be back to sketching and designing again very soon.