我正在閱讀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