uncaught exception: [Exception…
“‘Sys.WebForms.PageRequestManagerServerErrorException:
Sys.WebForms.PageRequestManagerServerErrorException:
Validation of viewstate MAC failed. If
this application is hosted by a Web
Farm or cluster, ensure that
configuration specifies
the same validationKey and validation
algorithm. AutoGenerate cannot be used
in a cluster.’ when calling method:
[nsIDOMEventListener::handleEvent]”
nsresult: “0x8057001c
(NS_ERROR_XPC_JS_THREW_JS_OBJECT)”
location: “JS frame ::
chrome://firebug/content/spy.js ::
callPageHandler :: line 744” data: no]
Thing is, I don’t even have a machineKey tag. I commented it out and I still get this error.
This is my entire web.config file:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="UrlRewriter">
<section name="PlainRules" type="System.Configuration.NameValueSectionHandler"/>
<section name="RegExRules" type="System.Configuration.NameValueSectionHandler"/>
</sectionGroup>
</configSections>
<UrlRewriter>
<PlainRules configSource="UrlRewriter.plain.config" />
<RegExRules configSource="UrlRewriter.regex.config" />
</UrlRewriter>
<connectionStrings configSource="db.config"/>
<system.net>
<mailSettings>
<smtp configSource="mail.config"/>
</mailSettings>
</system.net>
<system.web>
<!--<machineKey validationKey=""
decryptionKey="" validation="SHA1" />-->
<compilation debug="true" targetFramework="4.0" />
<globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" />
<trace enabled="false"/>
<!--<customErrors defaultRedirect="~/error" mode="RemoteOnly"/>-->
<httpRuntime maxRequestLength="4000" executionTimeout="1000"/>
<authentication mode="Forms">
<forms defaultUrl="~/" loginUrl="~/login" timeout="43200" protection="All" cookieless="UseCookies" />
</authentication>
<membership defaultProvider="AspNetSqlMembershipProvider" hashAlgorithmType="SHA1">
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" applicationName="damnation" connectionStringName="membership"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Hashed"
maxInvalidPasswordAttempts="20" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="5"
/>
</providers>
</membership>
<roleManager defaultProvider="AspNetSqlRoleProvider" enabled="true">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="membership" applicationName="damnation"/>
</providers>
</roleManager>
<profile defaultProvider="AspNetSqlProfileProvider" enabled="true" inherits="Damnation.Website.Shared.Membership.SharedMembershipProfile">
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="membership" applicationName="damnation"/>
</providers>
</profile>
<httpModules>
<add name="UrlRewriter" type="Damnation.Website.Shared.UrlRewriting.UrlRewriterModule"/>
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRewriter" type="Damnation.Website.Shared.UrlRewriting.UrlRewriterModule"/>
</modules>
</system.webServer>
</configuration>
What could be the issue here?
I should also mention that I tried with and without the rewriter (small module I wrote myself), so that’s not the issue either here…
Update: this issue is caught by firebug when I try to login with membership, which causes a postback in an updatepanel.
If you don’t have a machineKey in your config, its using the one from machine.config.
Is this site setup on a web farm? If so you should generate a machineKey and put it in all the web.config file installations for your site.