IIS 5.1中的WCF用作纯文本文件 [英] WCF in IIS 5.1 served as plain text file

查看:123
本文介绍了IIS 5.1中的WCF用作纯文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是在我的开发环境中设置了一个简单的WCF服务,到目前为止,端点对于SOAP和JSONP请求都正常工作。

I just set up a simple WCF service on my dev environment, and so far the endpoints are working OK, for both SOAP and JSONP requests.

我已经继续将此解决方案部署到IIS 5.1上托管的登台服务器(旧的,我知道,但请耐心等待), .svc 文件突然不再起作用了。并不是说IIS无法找到它们,而是它们被作为纯文本文件提供。

I've proceeded to deploy this solution to a staging server hosted on IIS 5.1 (old, I know, but bear with me), and the .svc files suddenly aren't working anymore. Not that IIS can't find them, but rather they're getting served as plain text files.

这基本上就是当我弹出一个浏览器时出现在浏览器上的内容 .svc file:

This is basically what shows up on my browser when I pop in an .svc file:

<%@ ServiceHost Language="C#" Debug="true" Service="service.myservice" CodeBehind="myservice.svc.cs" %>

现在我已经尝试了我在SO和其他网站上看到的所有解决方案(包括重新安装ASP.NET使用 aspnet_regiis 在IIS上绑定并使​​用 servicemodelreg.exe 恢复WCF ISAPI句柄,但它们都不是工作。

Now I've tried all the solutions I've seen around SO and other sites (including reinstalling the ASP.NET binds on IIS using aspnet_regiis and reinstating the WCF ISAPI handles using servicemodelreg.exe), but none of them work.

可能值得注意的一个怪癖是IIS 5.1正在服务于端口8000,因为Apache当前正在运行默认的80.这可能是罪魁祸首吗?我已经尝试运行 servicemodelreg -s:myservice 试图直接点击我的应用程序路径,但它告诉我在 IIS上没有这样的应用程序: / localhost / myservice (也许是因为它应该在 IIS:/ localhost:8000 / myservice ?我不确定。)

One quirk that may be of note is that the IIS 5.1 is serving off port 8000, because Apache is currently running on the default 80. Could this be a culprit? I've tried running servicemodelreg -s:myservice to try to hit my app path squarely, but it tells me that there's no such application on IIS:/localhost/myservice (maybe because it's supposed to be on IIS:/localhost:8000/myservice? I'm not sure.)

我已经确认我已经有一个功能强大的.NET 3.5框架, .aspx 文件服务好了。这只是 .svc 文件无法正常送达。

I've verified that I've got a functional .NET 3.5 framework down, the .aspx files are served OK. It's just the .svc files that aren't getting served properly.

有什么想法吗?

推荐答案

如果servicemodelreg没有工作,请检查.svc是否设置了ISAPI映射。

If servicemodelreg hasn't worked, check that the .svc is set up with an ISAPI mapping.

转到网站属性的主目录选项卡,选择配置...

Go to the Home Directory tab on the properties of your web site, select Configuration...

如果列表中没有.svc,使用以下参数进行设置:

If .svc isn't present in the list, set it up with the following parameters:


  • 可执行文件: C:\ WINDOWS \ MicrosoftMosrosoft.NET \ Framework\v2.0.50727\aspnet_isapi.dll

  • 分机: .svc

  • 限制为: GET,HEAD,POST,DEBUG

  • 脚本引擎:已勾选

  • Executable: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
  • Extension: .svc
  • Limit to: GET,HEAD,POST,DEBUG
  • Script engine: Ticked

这篇关于IIS 5.1中的WCF用作纯文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆