Cannot Find Server (404) or plain text return for WCF .svc Files From IIS after installation of .NET Framework 3.0 RC1 release

Craig McLuckie just compiled documentation that details work around instructions for common .NET Framework 3.0 setup issues. You can find the full document on the WCF Forums titled Common WCF RC1 Installation Issues. The following is a WCF specific issue captured as a separate blog post here for ease of search.

Problem: Cannot Find Server (404) or plain text return for WCF .svc Files From IIS after installation of .NET Framework 3.0 RC1 release

Source of Issue:

If you have previously installed .NET Framework 3.0 on your system that has IIS installed, and upgrade to the RC1 version of .NET Framework 3.0 by uninstalling the older version and installing .NET Framework 3.0 RC1 release, you may have difficulty in accessing WCF services that are IIS hosted through .svc files due to a bug in script map registration in the RC1 release.

Symptoms:

On Windows Server 2003 systems accessing a .svc extension from the browser may yield a ‘404: Page Not Found’ error. On Windows XP systems the problem may manifest as the .svc content being displayed as plain text.

Resolution:

Three work arounds exist:

1. Download the unsupported workaround tool: CleanIISScriptMaps.exe

The work around tool “CleanIISScriptMaps.exe” is available at http://wcf.netfx3.com/files/folders/product_team/entry5648.aspx. Running the tool from a command console without any arguments should resolve the problem.

2. Reinstall IIS or re-create web sites

Uninstall IIS and reinstall it so that the IIS Metabase is refreshed. Run the WCF install tool manually to reregister the WCF scriptmaps:

"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" /r /y

If you are running Windows 2003 Server, you may be able to delete the “Default Web Site” and re-create it. The problem will be resolved when you do this.

3. Install .svc manually as a temporary workaround

You can run the following command to install .svc mapping manually. However, this does refresh IIS Metabase for existing sites. You will encounter the same problem if you upgrade to a later version of WCF (e.g. the upcoming RTM version).

"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" /s:W3SVC

Note: This issue only occurs if you have installed an early preview version of the .NET Framework 3.0 on your system before installing the RC1 version.

Mark Gabarra

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm