2015-04-26 13 views
1

我已經在Google中研究過有關此錯誤的內容,但無法成功並最終在此處發佈。無法解析在所有DNN頁面中,EnableSessionState設置爲true錯誤

我已經下載了我的生活網站,數據庫並將其集成到我的本地環境中。我只能看到主頁,但無法看到其他頁面。我在所有其他頁面中都遇到了錯誤。

我認爲default.aspx是DNN的主頁,所以它工作正常,但沒有其他從DNN表動態呈現的頁面。

錯誤異常:

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \\ section in the application configuration.

事件日誌表中留言:

DotNetNuke.Services.Exceptions.PageLoadException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration. ---> System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration. at System.Web.UI.Page.get_Session() at DotNetNuke.Framework.CachePageStatePersister.Save() at System.Web.UI.Page.SavePageStateToPersistenceMedium(Object state) at System.Web.UI.Page.SaveAllState() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

我不得不採取在我的網絡配置文件從this link參考,並更新像下面,但我錯過了所有我的網站頁面也無法看到主頁。 EventLog表格顯示了我在我的問題中發佈的同樣的錯誤消息。

更新web配置象下面這樣:

<modules runAllManagedModulesForAllRequests="true"> 
    <remove name="Session" /> 
    <add name="Session" type="System.Web.SessionState.SessionStateModule"/>  

...

<httpModules> 
    <add name="Session" type="System.Web.SessionState.SessionStateModule" /> 

...

<pages validateRequest="false" enableViewStateMac="true" enableEventValidation="false" viewStateEncryptionMode="Always" enableSessionState="true" > 

回答

1

錯誤之前:

我已將我的DNN網站添加爲本地IIS服務器中的子目錄,因此我的訪問URL已變爲http://localhost/WebsiteName/。對於DNN核心庫中的某些原因,它不適用於子目錄,並且在我的本地計算機中遇到了錯誤enableSessionState is set to true, either in a configuration file or in the Page directive,但在實時,它在IIS服務器上安裝爲Default Web Site

錯誤解決:

只需更換我的網站從子目錄Default Web Site在IIS服務器和它的作品。我沒有得到任何錯誤。所以,現在訪問URL變成http://localhost/

我檢查了設置在同一個應用程序池中的兩個網站以及相同的dotnet框架版本,但子目錄網站不起作用,當我將它設置爲默認IIS網站時它工作。

對於這個帖子的用戶:

如果不能夠解決這個錯誤,你可以用卡瑟爾Connoly(A DNN MVP)的回答去。請參閱此link瞭解更多信息。

看來,如果您更改頁面狀態持久性,這將解決它(http://www.dnnsoftware.com/Content/Dn..。),或者在您的Web中啓用set enableSessionState爲true。config