Sessionstate problem: "Unrecognized configuration section 'sessionstate'"

imagecom
imagecom used Ask the Experts™
on
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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2006

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

<sessionstate... should be <sessionState...   (case sensitive)
Sorry for the echo :)
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Author

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

):
Top Expert 2006

Commented:
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.

Author

Commented:
The configuration is set to a web site
everything is working except when i use the sessionState in web.config .

Top Expert 2006

Commented:
Is this all you have in the web.config or there is something more? If you have more, post the complete web.config here.

Author

Commented:
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.
Top Expert 2006
Commented:
If you want to put a web.config in the second folder, you have to configure as virtual folder.

Author

Commented:
Toda raba Amit...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial