2010-12-22 50 views
2

我開發了一個非常簡單的WCF,使用v2.0.50727框架服務返回一個字符串 - 一個典型的HelloWorld()場景。然而,配置是一個絕對的痛苦,我真的不明白我做錯了什麼。請注意我是管理員使用Windows 7使用IIS7和WCF時的問題 - 甚至無法加載.SVC

所以一步一步在我的機器上,這裏是我在做什麼:

  1. 創建一個新的網站指向我的WCF目錄。該目錄包含.SVC,一個Web.config和bin目錄,在它

  2. 嘗試.dll和.PDB並瀏覽到網站:

    Config Error - Cannot read configuration file due to insufficient permissions

    因此,我給IIS_IUSRS帳戶訪問目錄。

  3. 另一個錯誤:

    You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server.

    因此,我保證權限向下傳播用戶 - 他們是。同樣的問題出現了,並再次 - 這樣的時間嘗試不同的東西。

  4. 我看AppPools,他們正在使用4.0新集成模式爲我創建一個。我將其更改爲DefaultAppPool

    You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server.

  5. 我打開ASP.NET模擬 - 通過我的用戶,而不是默認的

    An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

    我改變管道Classic ASP.NET Pool(其中關閉ASP.NET安全)

    You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server.

  6. 轉身ASP.NET模擬

    You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server.

-

請某人能引導我,什麼我要去我錯了嗎? IIS 6只想讓我馬上和我在做配置的顯著量只是加載.SVC

問候,

多米尼克

+0

因爲.NET 3.0使用V2.0.50727 CLR,你必須要麼選用或.NET 4 – 2010-12-22 18:59:59

回答

3

你並不需要添加處理程序。 SVC。當你安裝.NET時會發生這種情況。

問題不在於處理程序;這是安全。 ASPNET模仿看起來像是一條紅色的鯡魚。這是一個WCF服務,對不對?也許你在吠叫錯誤的樹。

你說你確保權利「傳播下來」 - 但檢查。例如,當您將文件從一個目錄移動到另一個目錄時,該文件可以攜帶一個ACL,該ACL不是您希望在原始文件夾中創建文件時所期望的「繼承」ACL。

檢查事項:

  • IIS_IUSRS一定看過+上的物理目錄
  • Bin子目錄需要有IIS_IUSRS適當的權限執行權限。
  • bin子目錄中的DLL需要可讀
  • 您可能希望爲vdir啓用「匿名」訪問。
  • 你需要一個web.config文件,使用適當的燙髮(但你會得到一個不同的錯誤,如果這是問題)
  • .svc文件需要有適當的權限

一讓.svc工作的一步是獲取一個簡單的.htm頁面來加載。那樣有用嗎?一旦你得到了,然後加載一個簡單的.ASPX頁面,從bin目錄中的代碼。一旦你明白了,你應該能夠運行.svc,沒問題。

在這一點上,你只需要做WCF特定的配置。