Hosting WCF service on IIS/XP - browsing to the .SVC gives a plain text view of the contents<p align=left><font face=Tahoma size=2>I am trying to use some of the WCF samples (specifically the one called &quot;<span id=nsrTitle>IIS Hosting Using Inline Code&quot;, but I don't think the problem is specific to that sample).  I am on XP SP2 (so IIS 5.1), with VS 2005 and .NET 3.0 installed.</span></font></p> <p align=left><font face=Tahoma size=2><span></span></font> </p> <p align=left><font face=Tahoma size=2><span>I build the sample, which deploys a .SVC file and a .DLL to a virtual directory in IIS and try to browse the service.   I am expecting to see the usual 'metadata' page telling me what the service is called and what operations a client could use.</span></font></p> <p align=left><font face=Tahoma size=2><span></span></font> </p> <p align=left><font face=Tahoma size=2><span>Instead I see a plain text page showing the raw contents of the .SVC file.   Evidently the ASPNET_ISAPI.DLL is not correctly mapped for .svc urls.</span></font></p> <p align=left><font face=Tahoma size=2><span></span></font> </p> <p align=left><font face=Tahoma size=2><span>I have tried the following, based on several other posts in this forum, but they have not worked for me:</span></font></p> <p align=left><font face=Tahoma size=2><span> </p> <p align=left>1. Run <span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe /i /enable</span></p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">2. Run </p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">&quot;%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe&quot; /r /x /v /y &gt; ServicemodelregOut.txt</span></p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">3. used the IIS Manager to add an application mapping for '.SVC' extensions to use the .NET 2.0  version of aspnet_isapi.dll.   (I worked around the bug where the path in that little  dialog shows '...' until you click on it.)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span> </p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">The output file from ServiceModelReg.exe shows the following:</span></p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span> </p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><font face=Courier>Microsoft(R) Windows Communication Foundation Installation Utility<br>[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.30]<br>Copyright (c) Microsoft Corporation.  All rights reserved.</font></span></p><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><font face=Courier> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><br>The ServiceModelReg tool will take the following actions:<br>Reinstalling configuration section system.serviceModel to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.<br>Reinstalling configuration section system.runtime.serialization to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.<br>Reinstalling configuration section system.serviceModel.activation to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.<br>Adding configuration entry for BuildProvider:<br> System.ServiceModel.Activation.ServiceBuildProvider, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br>Reinstalling compilation assembly node to System.Web section group:<br> System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL<br>Reinstalling compilation assembly node to System.Web section group:<br> System.IdentityModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL<br>Reinstalling compilation assembly node to System.Web section group:<br> System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br>Reinstalling HttpHandlers node to System.Web section group:<br> *.svc<br>Reinstalling HttpModules node to System.Web section group:<br> ServiceModel<br>Removing the Protocol node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> net.tcp<br>Removing the TransportConfiguration node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> net.tcp<br>Removing the Protocol node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> net.pipe<br>Removing the TransportConfiguration node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> net.pipe<br>Removing the Protocol node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> net.msmq<br>Removing the TransportConfiguration node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> net.msmq<br>Removing the Protocol node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> msmq.formatname<br>Removing the TransportConfiguration node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> msmq.formatname<br>Reinstalling Web Host Script Mapping for extension: .svc<br>Reinstalling WMI classes.<br>Reinstalling Windows CardSpace (idsvc).<br>Reinstalling Net.Tcp Port Sharing Service (NetTcpPortSharing).<br>Reinstalling HTTP namespace reservations.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><br>Uninstalling: Machine.config Section Groups and Handlers</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: Machine.config Section Groups and Handlers</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: System.Web Build Provider</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: System.Web Build Provider</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: System.Web Compilation Assemblies</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: System.Web Compilation Assemblies</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: HTTP Handlers</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: HTTP Handlers</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: HTTP Modules</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: HTTP Modules</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: Protocol node for protocol net.tcp</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A Protocol node does not exists in the system.web section for protocol net.tcp in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: TransportConfiguration node for protocol net.tcp</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A TransportConfiguration node does not exists in the system.web section for protocol net.tcp in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: Protocol node for protocol net.pipe</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A Protocol node does not exists in the system.web section for protocol net.pipe in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: TransportConfiguration node for protocol net.pipe</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A TransportConfiguration node does not exists in the system.web section for protocol net.pipe in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: Protocol node for protocol net.msmq</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A Protocol node does not exists in the system.web section for protocol net.msmq in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: TransportConfiguration node for protocol net.msmq</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A TransportConfiguration node does not exists in the system.web section for protocol net.msmq in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: Protocol node for protocol msmq.formatname</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A Protocol node does not exists in the system.web section for protocol msmq.formatname in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: TransportConfiguration node for protocol msmq.formatname</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A TransportConfiguration node does not exists in the system.web section for protocol msmq.formatname in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: Web Host Script Mappings</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left> Removing script mapping from location IIS://localhost/W3SVC.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left> Removing script mapping from location IIS://localhost/W3SVC/1/ROOT/Printers.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: Web Host Script Mappings</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left> Adding script mapping to location IIS://localhost/W3SVC.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Repairing: WMI Classes</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Repairing: Windows CardSpace (idsvc)</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Repairing: Net.Tcp Port Sharing Service (NetTcpPortSharing)</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: HTTP Namespace Reservations</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: HTTP Namespace Reservations</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>The ServiceModelReg tool has completed successfully.<br></font></p> <p><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span></span> </p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">I dropped a test.aspx file into the same virtual directory; the browser renders it correctly.  </span></span></p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span></span> </p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">I dropped a test.svc file into the same virtual directory; the browser renders this as a plain text view of the raw file contents.</span></span></p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span></span> </p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">What else can I try?</span></span></span></span></span></font></p>© 2009 Microsoft Corporation. All rights reserved.Thu, 09 Oct 2008 22:55:23 Zb109a13a-7258-49dd-a90d-66bf257ce63ehttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#b109a13a-7258-49dd-a90d-66bf257ce63ehttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#b109a13a-7258-49dd-a90d-66bf257ce63ewirwinhttp://social.msdn.microsoft.com/Profile/en-US/?user=wirwinHosting WCF service on IIS/XP - browsing to the .SVC gives a plain text view of the contents<p align=left><font face=Tahoma size=2>I am trying to use some of the WCF samples (specifically the one called &quot;<span id=nsrTitle>IIS Hosting Using Inline Code&quot;, but I don't think the problem is specific to that sample).  I am on XP SP2 (so IIS 5.1), with VS 2005 and .NET 3.0 installed.</span></font></p> <p align=left><font face=Tahoma size=2><span></span></font> </p> <p align=left><font face=Tahoma size=2><span>I build the sample, which deploys a .SVC file and a .DLL to a virtual directory in IIS and try to browse the service.   I am expecting to see the usual 'metadata' page telling me what the service is called and what operations a client could use.</span></font></p> <p align=left><font face=Tahoma size=2><span></span></font> </p> <p align=left><font face=Tahoma size=2><span>Instead I see a plain text page showing the raw contents of the .SVC file.   Evidently the ASPNET_ISAPI.DLL is not correctly mapped for .svc urls.</span></font></p> <p align=left><font face=Tahoma size=2><span></span></font> </p> <p align=left><font face=Tahoma size=2><span>I have tried the following, based on several other posts in this forum, but they have not worked for me:</span></font></p> <p align=left><font face=Tahoma size=2><span> </p> <p align=left>1. Run <span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe /i /enable</span></p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">2. Run </p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">&quot;%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe&quot; /r /x /v /y &gt; ServicemodelregOut.txt</span></p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">3. used the IIS Manager to add an application mapping for '.SVC' extensions to use the .NET 2.0  version of aspnet_isapi.dll.   (I worked around the bug where the path in that little  dialog shows '...' until you click on it.)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span> </p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">The output file from ServiceModelReg.exe shows the following:</span></p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span> </p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><font face=Courier>Microsoft(R) Windows Communication Foundation Installation Utility<br>[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.30]<br>Copyright (c) Microsoft Corporation.  All rights reserved.</font></span></p><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><font face=Courier> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><br>The ServiceModelReg tool will take the following actions:<br>Reinstalling configuration section system.serviceModel to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.<br>Reinstalling configuration section system.runtime.serialization to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.<br>Reinstalling configuration section system.serviceModel.activation to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.<br>Adding configuration entry for BuildProvider:<br> System.ServiceModel.Activation.ServiceBuildProvider, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br>Reinstalling compilation assembly node to System.Web section group:<br> System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL<br>Reinstalling compilation assembly node to System.Web section group:<br> System.IdentityModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL<br>Reinstalling compilation assembly node to System.Web section group:<br> System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br>Reinstalling HttpHandlers node to System.Web section group:<br> *.svc<br>Reinstalling HttpModules node to System.Web section group:<br> ServiceModel<br>Removing the Protocol node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> net.tcp<br>Removing the TransportConfiguration node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> net.tcp<br>Removing the Protocol node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> net.pipe<br>Removing the TransportConfiguration node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> net.pipe<br>Removing the Protocol node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> net.msmq<br>Removing the TransportConfiguration node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> net.msmq<br>Removing the Protocol node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> msmq.formatname<br>Removing the TransportConfiguration node from the system.web section in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config for protocol:<br> msmq.formatname<br>Reinstalling Web Host Script Mapping for extension: .svc<br>Reinstalling WMI classes.<br>Reinstalling Windows CardSpace (idsvc).<br>Reinstalling Net.Tcp Port Sharing Service (NetTcpPortSharing).<br>Reinstalling HTTP namespace reservations.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left><br>Uninstalling: Machine.config Section Groups and Handlers</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: Machine.config Section Groups and Handlers</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: System.Web Build Provider</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: System.Web Build Provider</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: System.Web Compilation Assemblies</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: System.Web Compilation Assemblies</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: HTTP Handlers</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: HTTP Handlers</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: HTTP Modules</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: HTTP Modules</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: Protocol node for protocol net.tcp</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A Protocol node does not exists in the system.web section for protocol net.tcp in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: TransportConfiguration node for protocol net.tcp</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A TransportConfiguration node does not exists in the system.web section for protocol net.tcp in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: Protocol node for protocol net.pipe</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A Protocol node does not exists in the system.web section for protocol net.pipe in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: TransportConfiguration node for protocol net.pipe</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A TransportConfiguration node does not exists in the system.web section for protocol net.pipe in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: Protocol node for protocol net.msmq</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A Protocol node does not exists in the system.web section for protocol net.msmq in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: TransportConfiguration node for protocol net.msmq</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A TransportConfiguration node does not exists in the system.web section for protocol net.msmq in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: Protocol node for protocol msmq.formatname</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A Protocol node does not exists in the system.web section for protocol msmq.formatname in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: TransportConfiguration node for protocol msmq.formatname</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>A TransportConfiguration node does not exists in the system.web section for protocol msmq.formatname in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: Web Host Script Mappings</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left> Removing script mapping from location IIS://localhost/W3SVC.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left> Removing script mapping from location IIS://localhost/W3SVC/1/ROOT/Printers.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: Web Host Script Mappings</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left> Adding script mapping to location IIS://localhost/W3SVC.</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Repairing: WMI Classes</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Repairing: Windows CardSpace (idsvc)</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Repairing: Net.Tcp Port Sharing Service (NetTcpPortSharing)</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Uninstalling: HTTP Namespace Reservations</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>Installing: HTTP Namespace Reservations</p> <p class=MsoNormal style="margin:0in 0in 0pt" align=left>The ServiceModelReg tool has completed successfully.<br></font></p> <p><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span></span> </p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">I dropped a test.aspx file into the same virtual directory; the browser renders it correctly.  </span></span></p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span></span> </p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">I dropped a test.svc file into the same virtual directory; the browser renders this as a plain text view of the raw file contents.</span></span></p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span></span> </p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">What else can I try?</span></span></span></span></span></font></p>Fri, 12 Oct 2007 15:36:00 Z2008-04-16T17:35:27Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#78463ba9-919b-40dd-984b-d3fc5316e67bhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#78463ba9-919b-40dd-984b-d3fc5316e67bRichie Weldonhttp://social.msdn.microsoft.com/Profile/en-US/?user=Richie%20WeldonHosting WCF service on IIS/XP - browsing to the .SVC gives a plain text view of the contents<p align=left><font face=Arial size=2></font> </p> <p>Hello,</p> <p align=left> </p> <p align=left>It sounds like you might not have ASP.NET 2.0 installed on the computer where you're trying to host the WCF service.  When you load a simple asp.net page, do you see its contents or does the page load as you expect?</p> <p align=left> </p> <p align=left>If the page does not load as you expect, you will want to install ASP.NET 2.0 on the system by doing the following:</p> <ol> <li> <div align=left>cd to <em>%windir%\Microsoft.NET\Framework\v2.0.50727</em></div> <li> <div align=left>run <em>aspnet_regiis -i -enable</em></div></li></ol> <p align=left>ASP.NET 2.0 should now be installed.  The next step is to reinstall WCF so it hooks into the ASP.NET and HTTP pipelines:</p> <p align=left> </p> <ol> <li>cd to <span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"><em>%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation</em></span> <li> <div align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">run <em>ServiceModelReg.exe -i -x </em></span></div></li></ol> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">The -i switch tells ServiceModelReg.exe to <em>install</em> WCF.  (The -r command you were running before was to <em>reinstall</em> WCF; it sounds like WCF may not have been properly installed previously.)</span></p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span> </p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">The -x switch tells ServiceModelReg.exe to include the necessary custom action scripts.</span></p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span> </p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">You can add the -y and -v switches if you'd prefer to supress confirmation (-y) or see verbose output (-v).</span></p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span> </p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">Your system could have gotten into this state if you installed IIS on the system AFTER WCF was installed.  It could also happen if you had IIS on the system, but never enabled ASP.NET before installing WCF.</span></p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'"></span> </p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">Hope this helps!</span></p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">Richie Weldon</span></p> <p align=left><span style="font-size:10pt;color:black;font-family:'Tahoma','sans-serif'">SDET, WCF</span></p>Fri, 12 Oct 2007 23:35:19 Z2007-10-12T23:35:19Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#0a8041c5-ae50-4ce6-9ddf-8bc735aa0027http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#0a8041c5-ae50-4ce6-9ddf-8bc735aa0027wirwinhttp://social.msdn.microsoft.com/Profile/en-US/?user=wirwinHosting WCF service on IIS/XP - browsing to the .SVC gives a plain text view of the contents<p>Richie,</p> <p align=left> </p> <p align=left>Thanks.  I ran the steps you suggested, but I still have the same symptoms (.svc URL renders as raw text in browser).</p> <p align=left> </p> <p align=left>A simple test.aspx page (containing a few HTML tags) renders as expected.</p> <p align=left> </p> <p align=left>A simple test.svc page just renders as raw text.</p> <p align=left> </p> <p align=left>The output file from this run of ServiceModelReg -i -x -v -y contains this:</p> <p align=left> </p> <p align=left><font face=Courier>Microsoft(R) Windows Communication Foundation Installation Utility<br>[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.30]<br>Copyright (c) Microsoft Corporation.  All rights reserved.</font></p><font face=Courier> <p align=left><br>The ServiceModelReg tool will take the following actions:<br>Adding configuration section system.serviceModel to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.<br>Adding configuration section system.runtime.serialization to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.<br>Adding configuration section system.serviceModel.activation to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.<br>Adding configuration entry for BuildProvider:<br> System.ServiceModel.Activation.ServiceBuildProvider, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br>Adding new compilation assembly node to System.Web section group:<br> System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL<br>Adding new compilation assembly node to System.Web section group:<br> System.IdentityModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL<br>Adding new compilation assembly node to System.Web section group:<br> System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br>Adding HttpHandlers node to System.Web section group:<br> *.svc<br>Adding HttpModules node to System.Web section group:<br> ServiceModel<br>Updating Web Host Script Mapping for extension: .svc<br>Adding WMI classes.<br>Adding Windows CardSpace (idsvc).<br>Adding Net.Tcp Port Sharing Service (NetTcpPortSharing).<br>Adding HTTP namespace reservations.</p> <p align=left><br>Installing: Machine.config Section Groups and Handlers</p> <p align=left>Configuration section system.serviceModel already exists in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.</p> <p align=left>Configuration section system.runtime.serialization already exists in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.</p> <p align=left>Configuration section system.serviceModel.activation already exists in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.</p> <p align=left>Installing: System.Web Build Provider</p> <p align=left>A configuration entry already exists for BuildProvider System.ServiceModel.Activation.ServiceBuildProvider, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.</p> <p align=left>Installing: System.Web Compilation Assemblies</p> <p align=left>All compilation assembly nodes already exist in System.Web section group.</p> <p align=left>Installing: HTTP Handlers</p> <p align=left>HttpHandlers node *.svc already exists in System.Web section group.</p> <p align=left>Installing: HTTP Modules</p> <p align=left>HttpModules node ServiceModel already exists in System.Web section group.</p> <p align=left>Installing: Web Host Script Mappings</p> <p align=left>A Web Host Script Mapping already exists for extension .svc.</p> <p align=left>Installing: WMI Classes</p> <p align=left>WMI classes are already installed.</p> <p align=left>Installing: Windows CardSpace (idsvc)</p> <p align=left>Windows CardSpace (idsvc) is already installed.</p> <p align=left>Installing: Net.Tcp Port Sharing Service (NetTcpPortSharing)</p> <p align=left>Net.Tcp Port Sharing Service (NetTcpPortSharing) is already installed.</p> <p align=left>Installing: HTTP Namespace Reservations</p> <p align=left>HTTP namespace reservations are already installed.</p> <p align=left>The ServiceModelReg tool has completed successfully.<br></font></p> <p align=left><font face=Arial size=2></font> </p>Mon, 15 Oct 2007 17:44:22 Z2007-10-15T17:44:22Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#42db0752-777f-446c-b2da-3a0f2d2789f5http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#42db0752-777f-446c-b2da-3a0f2d2789f5Richie Weldonhttp://social.msdn.microsoft.com/Profile/en-US/?user=Richie%20WeldonHosting WCF service on IIS/XP - browsing to the .SVC gives a plain text view of the contents<p align=left><font face=Arial size=2></font> </p> <p>Hmmm.  This is weird.  I'll try and reproduce this situation on one of my test machines, but first I need to know what operating system you're running this on.  Is it Win XP, Windows Server 2003, or Vista?</p> <p align=left><br>Thanks!</p> <p align=left>Richie</p>Mon, 15 Oct 2007 19:28:22 Z2007-10-15T19:28:22Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#c31bf06c-bf32-4dd3-819c-5c85bd540a7bhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#c31bf06c-bf32-4dd3-819c-5c85bd540a7bwirwinhttp://social.msdn.microsoft.com/Profile/en-US/?user=wirwinHosting WCF service on IIS/XP - browsing to the .SVC gives a plain text view of the contents<p>Windows XP SP2, fully up to date with security patches.  The machine is in a domain.  </p> <p align=left> </p> <p align=left>Other software installed includes Visual Studio 2005 and Visual C++ 2005 Redistributable, Visual Studio Team Explorer, .NET Framework 1.1, 2.0 and 3.0.   IIS is enabled of course.</p> <p align=left> </p> <p align=left>I also have (according to &quot;Add/Remove Programs&quot;):</p> <p align=left>   Visual Studio 2005 extensions for .NET Framework 3.0 (WCF &amp; WPF)</p> <p align=left>   Visual Studio 2005 extensions for Windows Workflow Foundation</p> <p align=left> </p> <p align=left> </p> <p align=left> </p> <p align=left><font face=Arial size=2></font> </p>Tue, 16 Oct 2007 12:41:54 Z2007-10-16T12:41:54Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#ae10f981-a555-402d-953e-d70d4d8c330chttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#ae10f981-a555-402d-953e-d70d4d8c330cKeith G_http://social.msdn.microsoft.com/Profile/en-US/?user=Keith%20G_Hosting WCF service on IIS/XP - browsing to the .SVC gives a plain text view of the contents<p>Hello,</p> <p align=left> </p> <p align=left>You may want to check this article out on blogs.msdn:</p> <p align=left> </p> <p align=left><a title="http://blogs.msdn.com/wenlong/archive/2006/09/10/748294.aspx" href="http://blogs.msdn.com/wenlong/archive/2006/09/10/748294.aspx">http://blogs.msdn.com/wenlong/archive/2006/09/10/748294.aspx</a></p> <p align=left> </p> <p align=left>Hope this helps,</p> <p align=left>Keith</p> <p align=left><font face=Arial size=2></font> </p>Tue, 16 Oct 2007 18:48:18 Z2007-10-16T19:25:54Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#cd28b12b-0632-4c9a-8f17-cdff726efe49http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#cd28b12b-0632-4c9a-8f17-cdff726efe49wirwinhttp://social.msdn.microsoft.com/Profile/en-US/?user=wirwinHosting WCF service on IIS/XP - browsing to the .SVC gives a plain text view of the contents<p align=left>Ahhh; thanks Keith, that was it.  Now I am seeing the .svc page normally (well, I am seeing an error telling me my security settings are wrong, but that passes for normal around here :-)</p> <p align=left> </p> <p align=left>[Summary for other readers: the problem was due to some corruption of the &quot;IIS Metabase&quot; caused by having an earlier pre-release copy of WCF on the machine.  </p> <p align=left> </p> <p align=left>The link provided in the previous post leads to a utility program that cleans this up.  Download that program and run it <em>with administrator rights</em> and everything will be corrected.]</p>Tue, 16 Oct 2007 19:23:17 Z2007-10-16T19:23:17Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#67079c5e-3a9e-4cbc-8aed-f6e73ae727eehttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#67079c5e-3a9e-4cbc-8aed-f6e73ae727eeSynced23http://social.msdn.microsoft.com/Profile/en-US/?user=Synced23Hosting WCF service on IIS/XP - browsing to the .SVC gives a plain text view of the contents<p align=left><font face=Arial size=2>I am having the exact same behaviour except inside visual studio 2008. If I browse to the .svc file I get the plain text. However VS 2k8 is running its internal web browser.</font></p> <p align=left> </p> <p align=left>I don't think the same issue is causing this, is it?</p> <p align=left> </p> <p align=left>I am really baffled for the last 2 days on this issue. I cannot get WCF to run in an ASP.NET application for the life of me. Everything builds but all I get is the raw ASP.NET markup spit out to the browser.</p>Wed, 16 Apr 2008 04:10:11 Z2008-04-16T04:10:11Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#1b9670fe-7de2-450e-9e2f-33cd9c7a153fhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b109a13a-7258-49dd-a90d-66bf257ce63e#1b9670fe-7de2-450e-9e2f-33cd9c7a153fCarlos Figueirahttp://social.msdn.microsoft.com/Profile/en-US/?user=Carlos%20FigueiraHosting WCF service on IIS/XP - browsing to the .SVC gives a plain text view of the contentsCan you try following the instructions at <a title="http://msdn2.microsoft.com/en-us/library/ms752252.aspx" href="http://msdn2.microsoft.com/en-us/library/ms752252.aspx">http://msdn2.microsoft.com/en-us/library/ms752252.aspx</a>? The VS-hosted service shares some settings with IIS, and this may solve the problem.Wed, 16 Apr 2008 04:15:00 Z2008-04-16T17:35:27Z