locked
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

    Question

  • Hello ,

    I am getting this error on my default.aspx page of the website which is created using asp.net 2008. Three URLs are targeting a same page and i am getting this error on two of the three URLs.

    I have a search box at this page and while i search something using that two URLs , it results in this error at the time of postback

     

    Stack trace of the error is :

     

     

    Server Error in '/' Application.

    Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> 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 <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

    Source Error:

     

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [ViewStateException: Invalid viewstate. 
    	Client IP: 110.234.4.237
    	Port: 38008
    	User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:7.0) Gecko/20100101 Firefox/7.0
    	ViewState: /wEPDwUJNTkwMjg0MTAwD2QWAgIBEBYCHgZhY3Rpb24FDS9EZWZhdWx0LmFzcHhkFgRmD2QWBmYPFgQeBGhyZWYFGmh0dHA6Ly93d3cueW91cnRyaWJ1dGUuaW4vHgV0aXRsZQUgUmV0dXJuIHRvIFlvdXIgVHJpYnV0ZSBIb21lIFBhZ2VkAgEPZBYGAgEPFgIfAQUnaHR0cDovL3d3dy55b3VydHJpYnV0ZS5pbi90cmlidXRlcy5hc3B4ZAIDD2QWAmYPDxYCHgRUZXh0BQlJbmJveCAoMClkZAIFDxYCHgdWaXNpYmxlaGQCAg8WAh4JaW5uZXJodG1sBUc8YSBjbGFzcz0nbG9nb3V0TGluaycgaWQ9J2hlYWRlcl9sb2dvdXQnIGhyZWY9J0xvZ291dC5hc3B4Jz5Mb2cgb3V0PC9hPmQCIA9kFgQCAQ8PZBYCHgdvbmNsaWNrBRZyZXR1cm4gVmFsaWRhdGVGb3JtKCk7ZAICDw8WAh8DBQQyMDExZGRk
    	Referer: http://www.yourtribute.in/
    	Path: /Default.aspx]
    
    [HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.]
       System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +106
       System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) +14
       System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +237
       System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
       System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37
       System.Web.UI.HiddenFieldPageStatePersister.Load() +207
       System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +105
       System.Web.UI.Page.LoadAllState() +43
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
       System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
       System.Web.UI.Page.ProcessRequest() +80
       System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
       System.Web.UI.Page.ProcessRequest(HttpContext context) +49
       ASP.default_aspx.ProcessRequest(HttpContext context) +4
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
    



     

    Version Information: Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.3618

     

    Please do help.

     

    Thanks:

    Rupendra


    Tuesday, September 27, 2011 8:25 AM

Answers