How to deploy WCF service on IIS 6.0

a 夏天 提交于 2019-12-05 08:04:24

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/

Can you show us your server-side web.config (just the <system.serviceModel> section)? Where on your server does your service live?

When hosting in IIS, your service address is defined by:

  • server name (or IP address)
  • name of the virtual directory (plus any subdirectories under that) in which your *.svc file lives
  • the *.svc file itself

So it would be something like:

http://YourServer/YourVirtualDirectory/MyService.svc

You don't seem to use a virtual directory in the path you mention - is your *.svc file really in the root of the web server, or did you forget to add the virtual directory to your path?

The information in this blog post proved invaluable to getting this to work.

http://xamlcoder.com/blog/?p=7

I am not sure about IIS6 but I created a new website in IIS7 (I could not get things to work under a virtual directory but that is probably my lack of IIS knowledge) I put my .svc file in the root directory and in ~/Services/

Everything started working great.

The blog mentioned that IIS should look in ~/Services/ automatically anytime a .svc file is served up but that was not working. That is why I simply copied the .svc file to my website root.

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!