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.
imagecomAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

<sessionstate... should be <sessionState...   (case sensitive)
adatheladCommented:
Sorry for the echo :)
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

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

):
amit_gCommented:
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.
imagecomAuthor Commented:
The configuration is set to a web site
everything is working except when i use the sessionState in web.config .

amit_gCommented:
Is this all you have in the web.config or there is something more? If you have more, post the complete web.config here.
imagecomAuthor 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.
amit_gCommented:
If you want to put a web.config in the second folder, you have to configure as virtual folder.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
imagecomAuthor Commented:
Toda raba Amit...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.