• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1350
  • Last Modified:

machineKey - system.web machine.config?

I have generated a machineKey and a validationKey for servers in our web farm.  According to a kb article, Microsoft says to open the machine.config OR the web.config and locate the <system.web> section and replace the machineKey section.

I opened up the machine.config, and in the system.web section towards the bottom, there is no machineKey.  There is ONE line in the machine.config referring to machineKey, but it is not in the system.web section.  This is for my .net 2.0 framework.

Am I supposed to just place my machineKey in my web.config?  The web.config is the same on all servers in the farm - will this work?  Below I have shown you the code from my machine.config's system.web section
    <processModel autoConfig="true"/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=hidden" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
        <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=hidden"/>
        <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=hidden"/>
        <add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=, Culture=neutral, PublicKeyToken= hidden"/>

Open in new window

JWeb Admin
JWeb Admin
1 Solution
JWeb AdminAuthor Commented:
I should also paste the code from the machine.config where the machineKey line is found
<section name="machineKey" type="System.Web.Configuration.MachineKeySection, System.Web, Version=, Culture=neutral, PublicKeyToken=hidden" allowDefinition="MachineToApplication"/>

Open in new window

If you modify the machinekey in machine.config it will apply for all the web sites under your web server.

If you want to change in either machine.config or web.config you have to do it under <system.web>. Don't change anything under <section>.


validation="SHA1" decryption="AES" />
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now