Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure t

Discussion in 'ASP .Net' started by Dhruba Bandopadhyay, May 24, 2006.

  1. 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.

    The above message is what I get in my ASP.NET 2.0 page. I have debugging
    turned on and for those who want to see the stack trace, see below.

    In my old web site I had a frame set with a ASP page in left frame and
    ASP.NET 2.0 page in right frame. It was working perfectly.

    Then I changed the frame set into IFRAMEs (well actually using
    floating/draggable/resizable IFRAMEs from http://blogus.xilinus.com/ ). Now
    I get the above error message when I try to load up my ASP.NET 2.0 page
    within a IFRAME created by http://blogus.xilinus.com/. ASP pages are fine.




    Stack Trace:
    [CryptographicException: Length of the data to decrypt is invalid.]
    System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[]
    inputBuffer, Int32 inputOffset, Int32 inputCount) +1493410
    System.Security.Cryptography.CryptoStream.FlushFinalBlock() +30
    System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean
    fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean
    useValidationSymAlgo) +154
    System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf,
    Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +119
    System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +214

    [ViewStateException: Invalid viewstate.
    Client IP: 127.0.0.1
    Port: 4945
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
    CLR 1.1.4322; .NET CLR 2.0.50727)
    ViewState: /wEPDwULLTEyMTQ2MDU5NjVkZLmM+Cz37HbivYCM/Wp5kXC0U+qx
    Referer: http://localhost/main.aspx
    Path: /Record/Optimiser/ASP/OptimiserOpen.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) +116
    System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +251
    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() +220
    System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +83
    System.Web.UI.Page.LoadAllState() +35
    System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953
    System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
    Boolean includeStagesAfterAsyncPoint) +154
    System.Web.UI.Page.ProcessRequest() +86
    System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
    System.Web.UI.Page.ProcessRequest(HttpContext context) +49
    ASP.record_optimiser_asp_optimiseropen_aspx.ProcessRequest(HttpContext
    context) +29
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    +154
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    completedSynchronously) +64
     
    Dhruba Bandopadhyay, May 24, 2006
    #1
    1. Advertising

  2. Dhruba Bandopadhyay

    Alvin Bruney Guest

    See if this document helps. though i suspect you need to take this issue up
    with the third party frames provider you listed.
    http://support.microsoft.com/default.aspx?scid=kb;en-us;555353

    --

    ________________________
    Warm regards,
    Alvin Bruney [MVP ASP.NET]

    [Shameless Author plug]
    Professional VSTO.NET - Wrox/Wiley
    The O.W.C. Black Book with .NET
    www.lulu.com/owc, Amazon
    Blog: http://www.msmvps.com/blogs/alvin
    -------------------------------------------------------

    "Dhruba Bandopadhyay" <> wrote in message
    news:%...
    > 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.
    >
    > The above message is what I get in my ASP.NET 2.0 page. I have debugging
    > turned on and for those who want to see the stack trace, see below.
    >
    > In my old web site I had a frame set with a ASP page in left frame and
    > ASP.NET 2.0 page in right frame. It was working perfectly.
    >
    > Then I changed the frame set into IFRAMEs (well actually using
    > floating/draggable/resizable IFRAMEs from http://blogus.xilinus.com/ ).
    > Now I get the above error message when I try to load up my ASP.NET 2.0
    > page within a IFRAME created by http://blogus.xilinus.com/. ASP pages are
    > fine.
    >
    >
    >
    >
    > Stack Trace:
    > [CryptographicException: Length of the data to decrypt is invalid.]
    >
    > System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[]
    > inputBuffer, Int32 inputOffset, Int32 inputCount) +1493410
    > System.Security.Cryptography.CryptoStream.FlushFinalBlock() +30
    > System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean
    > fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean
    > useValidationSymAlgo) +154
    > System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf,
    > Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +119
    > System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +214
    >
    > [ViewStateException: Invalid viewstate.
    > Client IP: 127.0.0.1
    > Port: 4945
    > User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
    > CLR 1.1.4322; .NET CLR 2.0.50727)
    > ViewState: /wEPDwULLTEyMTQ2MDU5NjVkZLmM+Cz37HbivYCM/Wp5kXC0U+qx
    > Referer: http://localhost/main.aspx
    > Path: /Record/Optimiser/ASP/OptimiserOpen.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) +116
    > System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +251
    >
    > 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() +220
    > System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +83
    > System.Web.UI.Page.LoadAllState() +35
    > System.Web.UI.Page.ProcessRequestMain(Boolean
    > includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953
    > System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
    > Boolean includeStagesAfterAsyncPoint) +154
    > System.Web.UI.Page.ProcessRequest() +86
    > System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
    > System.Web.UI.Page.ProcessRequest(HttpContext context) +49
    > ASP.record_optimiser_asp_optimiseropen_aspx.ProcessRequest(HttpContext
    > context) +29
    >
    > System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    > +154
    > System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    > completedSynchronously) +64
    >
    >
     
    Alvin Bruney, May 25, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ray Stevens

    Validation of viewstate MAC failed

    Ray Stevens, Aug 4, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    816
    Brock Allen
    Aug 9, 2005
  2. Not Me

    Validation of viewstate MAC failed

    Not Me, Dec 8, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    476
    Not Me
    Dec 8, 2005
  3. Sergej Grickov

    Error: Validation of viewstate MAC failed

    Sergej Grickov, Jan 27, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    11,680
    Teemu Keiski
    Feb 4, 2006
  4. sck10
    Replies:
    6
    Views:
    917
    sck10
    Sep 1, 2006
  5. Mark B
    Replies:
    2
    Views:
    2,719
    shyam sunder kumar
    Sep 11, 2009
Loading...

Share This Page