2016-11-07 16 views
2

我收到錯誤「元素'httpCookies'已鎖定在更高級別配置」當我嘗試訪問一個asp .net mvc 3應用程序。當我在我的<system.web>部分中添加下面的行時會發生這種情況。獲取錯誤「元素'httpCookies'已被鎖定在更高級別配置中」

<httpCookies httpOnlyCookies="true" requireSSL="true" lockItem="true" /> 

這發生在Windows Server 2003(IIS 6)上。這個錯誤不會發生在Windows 7上& Windows 2008 R2(IIS 7 &以上)

我檢查了windows 2003 server和我的windows 7開發機器上的machine.config文件,它包含下面兩行機器。

<section name="httpCookies" type="System.Web.Configuration.HttpCookiesSection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> 

回答

0

刪除屬性lockItem="true"解決了這個問題,但我仍然不知道在更高級別的配置被鎖定。

所以我行現在看起來像下面

<httpCookies httpOnlyCookies="true" requireSSL="true" />