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.
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:
- 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:
<mimeMap fileExtension=”.svc” mimeType=”application/octet-stream” />
<add name=”svc-Integrated” path=”*.svc” verb=”*” type=”System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=184.108.40.206, 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.