[转载] Cannot Find Server (404) or Get Plain Text for WCF .svc Files From IIS?
2010-01-05 23:20 我不只是糊涂 阅读(452) 评论(0) 收藏 举报转载自: http://blogs.msdn.com/markgabarra/archive/2006/09/20/763932.aspx
另外还有一篇类似的文章 http://blogs.msdn.com/wenlong/archive/2006/09/10/748294.aspx
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.
浙公网安备 33010602011771号