Click here to Skip to main content
12,079,202 members (48,293 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hello friends,

I have uploaded my web site on my domain it works fine for all features but when i try to register new member it shows the following error.

Server Error in Application.

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.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: 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.

Can anybody guide to solve this error.

Thanks in advance.
Posted 29-Jan-12 23:26pm
saj_211.1K
Comments
Sudip Saha 30-Jan-12 4:44am
   
Can you please host the site in different application pool If your application pool using by many web site then that kind of problem happening
saj_21 30-Jan-12 4:51am
   
I have created a virtual directory on my web server and i have hosted this site in that virtual directory.

I have one doubt :- can single domain have multiple application pools and if yes then how can i host the site in different application pool.???
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

I have solved this.

need to add a machinekey in webconfig
http://www.orcsweb.com/a...es/aspnetmachinekey.aspx

ASP.NET machineKey Generator[^]
  Permalink  
v2
Comments
Maria Norbert 31-Oct-13 7:27am
   
Can you say the reason for this error in detail..?

What is the need to add a Machine Key..?
Member 12320117 3 days ago
   
how to use machinekey on my windows 7 pro sp1
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

adding the below code in the web.config had fixed the issue for me.

<pages enableeventvalidation="false" viewstateencryptionmode="Never"></pages>
  Permalink  
v3
Comments
Damilola Kolawole 21-Nov-14 5:21am
   
The code is case sensitive, the correct version is written below

<pages enableEventValidation="false" viewStateEncryptionMode="Never"></pages>
sasi_B 2-Jul-15 5:42am
   
But I want to know will be there any security issues?
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 5

Put this code in webconfig..

<machinekey validation="SHA1" validationkey="A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1B2C3D4E5" decryption="Auto" decryptionkey="A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1" />
  Permalink  
Comments
sanket saxena 7-May-14 2:24am
   
isnt it u are very late. This is 2 yr old question.
rajeeshmenoth 7-May-14 2:38am
   
i am created code project account few months back thats y i didnt se thiz...
sanket saxena 7-May-14 2:41am
   
ahh ok no issue i think so thats why i didnt downvoted buddy... happy coding :)
Agustus Jackson 4-Jun-14 1:13am
   
can we simply copy and paste machinekey elements or does .net framework matters..
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 7

Paste in web config.


decryptionKey="123456789012345678901234567890123456789012345678"
validation="SHA1" decryption="Auto" />
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web03 | 2.8.160212.1 | Last Updated 18 Dec 2015
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100