我正在阅读WCF 4.0多层服务开发一书,并试图用WCF使用IIS实现一个简单的Hello World。WCF IIS错误403
我有一个HelloWorldService项目和一个HostDevServer项目(启动项目)。我看到一个目录的两个文件,听,而是我得到一个错误信息:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
最可能的原因:
A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
我做了什么:
- 支持目录浏览在IIS管理器中
- 检查是否有默认文档,它们是否存在。
- 运行命令:appcmd设置配置/section:system.webServer/directoryBrowse /启用:真
在屏幕左右在IIS它说7.5版本和它说浏览器的“IIS 8.0详细错误.. “。我不知道这是否与问题有关。
我使用Visual Studio 2013进行开发。下面的Web.config:
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
有谁知道如何解决这个问题?
你可以发布web.config吗? – ShellNinja
使用web.config更新了文章。 – ronaldm
我通常的怀疑是你的服务所在的文件夹的权限。确保IUSR和/或(我永远不会记得哪个)IIS_IUSRS拥有读取硬盘驱动器上Web服务文件夹的权限。或者,如果您的appPool运行在不同的凭据集上,则与此用户帐户相同。 – Snorre