Click here to Skip to main content
Rate this: bad
good
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 22:26pm
saj_211K
Comments
Sudip Saha at 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 at 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 at 31-Oct-13 7:27am
   
Can you say the reason for this error in detail..?
 
What is the need to add a Machine Key..?
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
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 at 7-May-14 2:24am
   
isnt it u are very late. This is 2 yr old question.
rajeeshmenoth at 7-May-14 2:38am
   
i am created code project account few months back thats y i didnt se thiz...
sanket saxena at 7-May-14 2:41am
   
ahh ok no issue i think so thats why i didnt downvoted buddy... happy coding :)
Agustus Jackson at 4-Jun-14 1:13am
   
can we simply copy and paste machinekey elements or does .net framework matters..

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

  Print Answers RSS
0 OriginalGriff 270
1 Sergey Alexandrovich Kryukov 150
2 ChauhanAjay 120
3 BotCar 105
4 Dave Kreskowiak 100
0 Sergey Alexandrovich Kryukov 9,056
1 OriginalGriff 8,041
2 CPallini 2,613
3 Richard MacCutchan 2,221
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 7 May 2014
Copyright © CodeProject, 1999-2014
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