문제

I have a site where when accessing via site.com/default.aspx everything is fine, however when accessing via site.com/ I get a session error as follows:

"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."

I have confirmed that default.aspx is the highest priority default document and that it is the page being loaded. However why is this session error only occurring when accessing via the default document?

The server is 2008 R2 and IIS 7.5.

도움이 되었습니까?

해결책

Answering my own question here. Another symptom was that Page.User was always null. I found a post on SO about something similar

UrlRewriting.Net Module + IIS7 Equals Page.User == null?

and while we are not using the urlrewriting module, adding the

runAllManagedModulesForAllRequests="true"

to the modules section in the web.config. Hope this can help someone else some day!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top