且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在IIS 6.0上部署WCF服务

更新时间:2022-11-03 15:44:19

您的Web服务扩展锁定策略阻止了ASP.NET 4.0 ISAPI从处理您的请求的扩展。发生在我身上,看看:

  C:\> cscript c:\WINDOWS\system32\ iisext.vbs / ListFile 
Microsoft(R)Windows脚本宿主版本5.6
版权所有(C)Microsoft Corporation 1996-2001。版权所有。

连接到服务器...完成。

状态/扩展路径
------------------------
0 C:\WINDOWS \system32\inetsrv\httpodbc.dll
0 C:\WINDOWS\system32\inetsrv\ssinc.dll
0 C:\WINDOWS\system32\inetsrv\ asp.dll
1 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
0 * .exe
0 C:\WINDOWS\\ \\system32\inetsrv\httpext.dll
0 * .dll
1 C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
1 C:\WINDOWS\system32\MQISE.DLL
0 C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll

像我一样,v4.0 aspnet_isapi.dll旁边有一个0吗?有你的问题您需要启用它:

  C:\> cscript c:\WINDOWS\system32\iisext.vbs / EnFile C:\WINDOWS\Microsoft.NET\Frame 
work64\v4.0.30319\aspnet_isapi.dll
Microsoft(R)Windows脚本宿主版本5.6
版权所有(C) )微软公司1996-2001。版权所有。

连接到服务器...完成。
启用扩展文件完成。

有关iisext.vbs工具的更多信息: http://support.microsoft.com/kb/328419/


I have IIS 6.0 on Windows Server 2003.

I installed .NET 3.5 and 4 beta 2. "Normal" ASP things are working (perfect). But when I try to navigate to my service (/myServer/MyService.svc) I get a 404. Page not found.

To be exact, I got a 404 2 "Web service extension lockdown policy prevents this request."

I used ServiceModelReg.exe /ia to make sure that the extension I known and I checked the configuration using:

admin-Tools, iis, home-tab, configuration, executable-box, and there:

Extension: .svc, path: c:\windows\microsoft.net\framework\v4.0.210..., verbs: all verbs.

So everything seems OK. But I still get a 404-2.

Your "web service extension lockdown policy" is preventing the ASP.NET 4.0 ISAPI extension from processing your request. It happened to me, check it out:

C:\>cscript c:\WINDOWS\system32\iisext.vbs /ListFile
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Connecting to server ...Done.

Status / Extension Path
------------------------
0  C:\WINDOWS\system32\inetsrv\httpodbc.dll
0  C:\WINDOWS\system32\inetsrv\ssinc.dll
0  C:\WINDOWS\system32\inetsrv\asp.dll
1  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
0  *.exe
0  C:\WINDOWS\system32\inetsrv\httpext.dll
0  *.dll
1  C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
1  C:\WINDOWS\system32\MQISE.DLL
0  C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll

Do you have a "0" next to the v4.0 aspnet_isapi.dll like I did? There's your problem. You need to enable it:

C:\>cscript c:\WINDOWS\system32\iisext.vbs /EnFile C:\WINDOWS\Microsoft.NET\Frame
work64\v4.0.30319\aspnet_isapi.dll
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Connecting to server ...Done.
Enabling extension file complete.

For more info on the iisext.vbs tool: http://support.microsoft.com/kb/328419/