WCF .svc files in IIS7 on Vista RC1
My team has been working on a very cool demo scenario for a few months now. We've upgraded it from the June CTP, to the July CTP, and rencently to RC1 of the .NET Framework 3.0. Today I burned about an hour trying to get a demo working on Vista RC1. The problem was that I could not access a WCF service (.svc file) that was hosted in IIS7. I couldn't browse to the .svc file in Internet Explorer.
Apparently there are some known issues with RC1 of the .NET Framework 3.0 when on XP and Server 2003. Wenlong Dong has documented the issues here and he has provided a few work arounds.
However, I was unable to get any of these work arounds to address my problems on Vista and IIS7. Instead, here's the solution that worked for me:
First update the scriptmaps for the .svc extension in IIS7 by running
Open the ApplicationHost.config file with notepad. The file is located at: c:\windows\system32\inetsrv\config\applicationHost.config
Add a Mime type for the .svc extension. Search for <mimeMap> in the config file and add a new entry as follows:
<mimeMap fileExtension=".svc" mimeType="application/octet-stream" />
Navigate to the web site where you want to configure support for .svc files and add the svc handlers. For example, in my situation I navigated to the element <location path="Default Web Site">. Then I added the following handlers within the <handlers> element:
<add name="svc-Integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode" />
<add name="svc-ISAPI-2.0" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
After making these configuration changes I was able to browse to the .svc file within the browser. I can't claim that I've mastered all the concepts in IIS7 or the config file structure yet, but hopefully that will save a few of you an hour.
Comments
Anonymous
January 18, 2007
In this post , I pointed to some problems that may arise when you try to host Windows Communication FoundationAnonymous
April 22, 2008
PingBack from http://dogs-pets.info/dog-breeding/?p=62