Link to home
Start Free TrialLog in
Avatar of imagecom
imagecom

asked on

Sessionstate problem: "Unrecognized configuration section 'sessionstate'"

Hi,
I want to set a timeout to my session within the web.config file.
And when I write down this:

----------------------------------------------------
<configuration>
    <system.web>
        <sessionstate timeout="45"/>
    </system.web>
</configuration
----------------------------------------------------

I get the following error message:
Unrecognized configuration section 'sessionstate'

Can you guys help me with this?
Thanks alot.
Avatar of amit_g
amit_g
Flag of United States of America image

sessionstate should be sessionState. Please note S. web.config is case sensitive.
Hi,

<sessionstate... should be <sessionState...   (case sensitive)
Sorry for the echo :)
Avatar of imagecom
imagecom

ASKER

OK,
now I get :

"Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS."

):
Did you forget to make your application as virtual directory? Open IIS, right click the application folder, click properties, in Application Settings section click on Create button.
The configuration is set to a web site
everything is working except when i use the sessionState in web.config .

Is this all you have in the web.config or there is something more? If you have more, post the complete web.config here.
Hi,
I had 2 web.config files in my site (one in the root and one inside a library)
The problem I wrote about happened in the second one.
Once I moved the sessionState decleration to the web.config that is in the root it started working.

Do you think this was my problem all along?


Here is the original web.config that we used:

-----------------------------------------------------------
<configuration>
    <system.web>
        <sessionState timeout="45"/>
       <customErrors mode="Off"/>
      <globalization
                 fileEncoding="utf-8"
                 requestEncoding="utf-8"
                 responseEncoding="utf-8"
                 culture="en-US"
                 uiCulture="en-US"
            />
    </system.web>
      <!-- Apllication Constants -->
      <appSettings>
            <add key="IsCMS"                      value="x" />
            <add key="SiteEmail"                  value="x" />
            <add key="SmtpServer"                 value="x" />
            <add key="IsOnline"                   value="x" />
      </appSettings>
</configuration>
-----------------------------------------------------------

Thanks again.
ASKER CERTIFIED SOLUTION
Avatar of amit_g
amit_g
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Toda raba Amit...