例外:
由于 Web 服务器上此资源的访问控制列表 (ACL) 配置或加密设置,您没有查看此目录或页的权限。
我第一次学习WCF,我正在尝试在IIS上托管它。我是一个完全的初学者,所以我可能会犯任何愚蠢的错误。
从Visual Studio运行WCF:
我能够打开WSDL文档并能够在本地运行时浏览。
现在,当我在IIS管理器中将它添加为网站时,我得到了上面提到的异常。
配置文件:
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="mexBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="mexBehavior" name="WSHttpService.WSHttpService">
<endpoint address="WSHttpService" binding="wsHttpBinding" contract="WSHttpService.IWSHttpService" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
微软以显示完全误导的错误而闻名。请有人帮帮我,因为我可能犯了其他愚蠢的错误。
我研究过的解决方法
IUSR和IIS_IUSRS
,并赋予所有权限HTTP 错误 404.3 - 未找到
由于扩展配置,您请求的页面无法提供。如果页面是脚本,请添加处理程序。如果要下载文件,请添加MIME映射。详细的错误信息
解决方案:
转到控制面板-
需要检查的几件事。确保您的 IIS 用户帐户有权查看代码所在的文件夹。
我会将绑定更改为基本http,直到您可以像预期的那样得到IIS响应。
此外,如果您的主机是iis vs . IIS express主机,则“add base address = " http://localhost:8080 " "将对IIS尝试为endpoint提供服务的方式产生影响。