代码之家  ›  专栏  ›  技术社区  ›  George2

禁止浏览WCF svc文件?

  •  3
  • George2  · 技术社区  · 16 年前

    This type of page is not served. 
    Description: The type of page you have requested is not served because it has been explicitly forbidden.  The extension '.svc' may be incorrect.   Please review the URL below and make sure that it is spelled correctly.
    

    这是本书的内容web.config文件我用的文件,对吗?

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <staticContent>
                <remove fileExtension=".svc" />
            </staticContent>
            <handlers>
                <remove name="svc-ISAPI-2.0" />
                <remove name="svc-Integrated" />
                <add name="svc-ISAPI-2.0" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
            </handlers>
        </system.webServer>
    </configuration>
    
    2 回复  |  直到 9 年前
        1
  •  2
  •   Artem Koshelev    16 年前

    您可能需要启动命令 servicemodelreg –ia 在visualstudio命令提示符中。

    更新1: 您的应用程序可能托管在.NET2.0应用程序池下。转到IIS管理器并检查基本设置链接。单击选择按钮,您将看到您正在使用哪个选项。将其更改为使用.NET 4.0

    你的web.config文件文件似乎不完整。我建议您使用 WCF Configuration Editor 工具。启动它(确保您使用的是.NET4版本的工具)并打开web.config文件文件。创建服务配置和服务端点配置,然后保存它。

        2
  •  1
  •   Nate CSS Guy    16 年前

    如果IIS上的mime类型设置不正确,请尝试使用 aspnet_regiis

    推荐文章