tags:

views:

342

answers:

1

Hi Guys,

I'm getting the following error on a webpage. We recently migrate a website from IIS6 to IIS7, its my first exposure to IIS7. We have'nt closed the other domain yet, and the site is running all fine (so we can compare until migration is fully completed.)

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.

A: 

The solution is very curious. Though IIS7 in error description says to add SessionStateModule to system.web section, it should be added to system.webServer section.

<system.webServer>
    <modules>
        <remove name="Session" />
        <add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </modules>
</system.webServer>
flashnik