PDA

View Full Version : سوال: اخطار عجیب Validation of viewstate MAC failed....



VS2010
چهارشنبه 22 دی 1389, 17:59 عصر
سلام
تو یکی از صفحات که برای لاگین ساختم ، اگه بیام تو صفحه مورد نظر و این صفحه تا 20 دقیقه یا بیشتر باز باشه و بخوام بعد این مدت وارد صفحه بشم یه اخطار عجیب میده .
متن اخطار :


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:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

<%@ Page Language="C#" Debug="true" %>


or:

2) Add the following section to the configuration file of your application:

<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>


Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace:

[ViewStateException: Invalid viewstate. Client IP: 72.46.58.22 Port: 9346 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ViewState: /wEPDwULLTE0ODg0OTMxODlkGAEFHl9fQ29udHJvbHNSZXF1aXJ lUG9zdEJhY2tLZXlfXxYCBRpBZG1pbkxvZ2luMSRjaHNhdmVwY XNzd29yZAUUQWRtaW5Mb2dpbjEkQnRuTG9naW7MpQl8uMByL9W Eb64AZuefFIFibQ== Referer: http://MySite.org/ 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(Except ion inner, String persistedState, String errorPageMessage, Boolean macValidationError) +106 System.Web.UI.ViewStateException.ThrowMacValidatio nError(Exception inner, String persistedState) +14 System.Web.UI.ObjectStateFormatter.Deserialize(Str ing inputString) +237 System.Web.UI.ObjectStateFormatter.System.Web.UI.I StateFormatter.Deserialize(String serializedState) +4 System.Web.UI.Util.DeserializeWithAssert(IStateFor matter formatter, String serializedState) +37 System.Web.UI.HiddenFieldPageStatePersister.Load() +207 System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +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(Http Context context) +21 System.Web.UI.Page.ProcessRequest(HttpContext context) +49 ASP.default_aspx.ProcessRequest(HttpContext context) +4 System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +75


Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955