2009-11-13 43 views
1

我試圖使用APPCMD來設置debug=falseweb.config,根據documentation如何使用appcmd在IIS7中設置debug = false

我使用的特定語法是:

APPCMD SET CONFIG "SITE/VDIR" section:compilation /debug:False /commit:APP

輸出

INFO (section:compilation, timetaken:219, hresult:00000000, objects:1) Applied configuration changes to section "system.web/compilation" for "MACHINE/W EBROOT/APPHOST/SITE/VDIR" at configuration commit path "MACHINE/WE BROOT/APPHOST/SITE/VDIR"

之後,debug仍設置爲true

我已排除只讀的文件;我使用進程監視器來查看appcmd實際寫入web.config的正確位置。我的環境是Windows 2008 x64,SP2。

我知道有很多不同的方法來解決問題;不同的配置文件,在xpath,nant等中自己完成,但我特別感興趣的是爲什麼APPCMD似乎沒有工作,並幫助其他人也可能正在努力工具。謝謝你的幫助!

+0

約翰 - 這已被證實是由MS員工的問題,他寫了一個解決辦法,其可能不是理想的。 – Kev 2009-11-20 20:03:24

回答

2

我認爲這是一個錯誤或'按設計'。經過調查,我發現可以添加和修改<compilation />部分的其他屬性(我還沒有全部嘗試過)。

例如,下面的工作就好了:

APPCMD SET CONFIG "SITE/VDIR" section:compilation /batch:False /commit:APP
APPCMD SET CONFIG "SITE/VDIR" section:compilation /defaultLanguage:"c#" /commit:APP

但是當你觀察它只是無法改變debug屬性。這可能是值得提出這個作爲對MS Connect網站中的錯誤,如果你有這種能力:

Microsoft Connect

我也突然出現在IIS論壇一個問題:

Possible bug: Unable to set the "debug" attribute in the "compilation" section in web.config (IIS.NET)

更新:

這已被證實是由微軟員工的問題:

Reply to Possible bug: Unable to set the "debug" attribute in the "compilation" section in web.config (IIS.NET)

相關問題