2

I have been getting the error message that Viewstate verification failed. Reason: The viewstate supplied failed integrity check. and data is unable to be saved using my website until I recycle IIS. I read that this has something to do with a machine key within a server farm. I am not sure? This is just a stand alone webserver. Any ideas how to correct this?

Event code: 4009  Event message: Viewstate verification failed. Reason: The viewstate supplied failed integrity check.  Event time: 8/26/2013 3:30:58 PM  Event time (UTC): 8/26/2013 7:30:58 PM  Event ID: 6edb892ff6194dc48ef1182cee318e63  Event sequence: 4  Event occurrence: 1  Event detail code: 50203    Application information: 
    Application domain: /LM/W3SVC/2/ROOT-1-130220190575673097 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: C:\inetpub\wwwroot\website\ 
    Machine name:    Process information: 
    Process ID: 3636 
    Process name: w3wp.exe 
    Account name: Domain\account   Request information: 
    Request URL: 
    Request path: /frmFoodAndBeverage.aspx 
    User host address:
    User: 
    Is authenticated: True 
    Authentication Type: Negotiate 
    Thread account name: Domain\account   ViewStateException information: 
    Exception message: Invalid viewstate. 
    Client IP: 
    Port: 
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR
3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E; Tablet PC 2.0) 
    PersistedState: /wEPDwUKLTYzODM0NTY2Mg9kFgJmD2QWAgIDD2QWAgIDDw8WAh4EVGV4dAUPQmVsbCwgRG9uYWxkIEUuZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFIWN0bDAwJENvbnRlbnRQbGFjZUhvbGRlcjEkY21kTmV4dF5K3yklWc0DODJ8SLoJw+dFVUlgm/CktMaD1teAlLBl

    Referer: 
    Path: /frmFoodAndBeverage.aspx    Custom event details:
H H
  • 263,252
  • 30
  • 330
  • 514
user1342164
  • 1,434
  • 13
  • 44
  • 83
  • Have you see this: http://support.microsoft.com/default.aspx?scid=kb;en-us;829743 – Oscar Aug 26 '13 at 19:51
  • Do you think setting enableViewStateMac="false" will fix it? – user1342164 Aug 26 '13 at 20:01
  • I am using alot of session variables in my code could this be why – user1342164 Aug 26 '13 at 20:02
  • Try disabling mac check, and see what happen. However, you should keep your variables at server side in Session instead of in Viewstate, where you are charging your page with a lot of data and making it slow to load.. – Oscar Aug 26 '13 at 20:06
  • I dont know where this machine.config file is? – user1342164 Aug 26 '13 at 20:09
  • 2
    No, don't do it in machine.config! It will change the behavior of all web applications in your machine! Instead change it in web.config, to modify only the current application. Be aware, disabling this check is a really bad practice! – Oscar Aug 26 '13 at 20:12
  • Ok why is this bad practice? What am I opening up? – user1342164 Aug 26 '13 at 20:21
  • Do yo go out and leave the door open? http://www.codinghorror.com/blog/2004/11/web-farms-and-aspnet-viewstate.html – Oscar Aug 26 '13 at 20:23
  • Thanks, I dont understand why I get this error like twice a day and I dont run multiple servers just one??? – user1342164 Aug 26 '13 at 20:29

1 Answers1

-1

You can check if the problem is into the machine authentication code(MAC). Set enableViewStateMac="false". If you no longer get view state errors, the problem is related to the MAC feature. Also you can generate a new machineKey and copy it into the web.config of your app on each server. Here are some links that might help... explanation of machineKey http://msdn2.microsoft.com/en-us/library/w8h3skw9.aspx machineKey generator http://www.codeproject.com/aspnet/machineKey.asp