c# - 在 IIS 6 中托管 .net 4.0 REST WCF 服务

标签 c# wcf iis-6 .net-4.0

所以我在 VS2010 上运行 iis 7 和 .net 4.0

我有一个 REST wcf 4.0/.net 4.0 服务,它在本地运行得非常好。在我的本地,它托管在 IIS 上

http://localhost/SOMENAME/

[WebGet(UriTemplate = "Ping")]
    public string CheckAuthenticatedStatus()
    {
        string userName;
        if (!AuthenticateUser(out userName))
        {
            WebOperationContext.Current.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.Unauthorized;
            return "Authenticaltion Failed";
        }
        return "Ping Back - " + userName;


    }

    [WebGet(UriTemplate = "AnonymousPing")]
    public string CheckStatus()
    {

        return "AnonymousPing Back";

    }

但是当我尝试在 QA 环境 (win2k3 .net 4 iis 6) 中部署它时,出现以下错误。

目录列表被拒绝 此虚拟目录不允许列出内容。

我该怎么做?而且我不需要本地的 SVC 文件来运行 Web 服务。 所有在线帮助(由 google 提供)都在谈论 SVC 文件。 请指出正确的方向。

最佳答案

我终于找到了我要找的东西。

步骤 1) VirtualDirectoryName->Properties->Virtual Directory Tab->Configuration Button->

插入新的通配符映射 C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll 取消选中验证文件是否存在

步骤 2)

VirtualDirectoryName->Properties->Directory Security Tab->Authentication and access control->Edit Button->

取消选中集成 Windows 身份验证

第三步)重置IIS

以下两个链接帮助了我!

http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/2ec269e3-c1ff-4d9b-9ff3-d530f1599047

http://forums.asp.net/t/1195663.aspx

关于c# - 在 IIS 6 中托管 .net 4.0 REST WCF 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3367457/

相关文章:

ssl - 在 IIS 6(1024 到 2048 位)中续订通配符 SSL 证书

c# - 收到调用任务启动器完成的通知

c# - 网站使用来自错误目录的代码隐藏文件?

c# - 使用 DotNetZip 从 zip 文件中提取特定文件夹

c# - C# 中的 LAN 进程间通信?

c# - 如何最大化大对象堆中最大的连续内存块

c# - 此 System.Net.Sockets.SocketException 中的 IP 是来自源还是目标?

iis - 在 IIS 6 中托管多个站点,一个需要 SSL

c# - 使用 Moles 覆盖 System.Configuration,而不是作为单元测试

c# - 来自文本文件的数据表?