مرجع تخصصی برنامه نویسان

انجمن تخصصی برنامه نویسان فارسی زبان

کاربر سایت

mprogramer

عضویت از 1395/03/23

دلیل خطای machineKey چیست

  • پنجشنبه 15 تیر 1396
  • 20:56
تشکر میکنم

دلیل رخ در دادن این خطا چیست؟

سایت روی سرور است

پاسخ های این پرسش

تعداد پاسخ ها : 7 پاسخ
کاربر سایت

سهیل علیزاده

عضویت از 1396/04/09

  • پنجشنبه 15 تیر 1396
  • 20:59

لطفا خطای خود را به صورت متن قرار دهید. 

کاربر سایت

mprogramer

عضویت از 1395/03/23

  • پنجشنبه 15 تیر 1396
  • 21:06

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.

See http://go.microsoft.com/fwlink/?LinkID=314055 for more information.
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.

See http://go.microsoft.com/fwlink/?LinkID=314055 for more information.

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: 178.253.51.110
	Port: 29546
	Referer: http://autooriginal.ir/CPanelWebsite/WebsiteSetting
	Path: /CPanelWebsite/WebsiteSetting
	User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
	ViewState: Znc/tgnBFJ7Nbpy45+MsRmL1x81ME6wQQ4Jig6afJl2YZXNOVKCiVfP7Y/vLLFwPjm8rg24J7AZPXd1o2ZwRU0/4fjVK83/C7Q9PED0RdehuPRvzhmZqkVR+QPmvFcLRwdyiCLjS8j/Pskynrsc2IME+Bg9OOBIthpUUfVzbKmrWJV1QIJW7s1OdUSg4n50uSUIFzYk7SwNlTkKPmAColU6CCblPY/SOi7k/dJ+THKngZrujY1VTsJugI/WPA6kDaFBpeTFhQa7IsTcojzAex86JTGGY/DWvHGufiiJFGW6dGfYVUz40VPaNY4bcmouM+xEN6vlHWOU0iOBHX4lt6+D4Y1WXWRp3xNuam+kb2fmYqyFF8i3ckRAgzFFDaxEGEvJo4CwiZUNUgy54mCABuU0fELxUPLqTFvG9Is33EAZoXEpm3npziTsGSr0SUmzEUuvVHAoyJ8xYRhxOaGmECERSe+KbWGKXOzblOV5sg1cq66Qt7BL4+T12t7lu9ECmr3GlqtLwvPvTY9ctdenujfh2lhDUZRDRt5zILIe52H/GN6L9E3NmkY+fMyKtKmyHkrvxghk4v9oeyYT+ENdjBP+d+45D1yE3R+/zR+rRJGtw+9GqWoK0bd4YmxOFq/Y89cH/ygWdWhzw++CSjKT1aIb5gbsnWYFvf1YXvgKYJne7HPUzguUQZk7tqoMbEM8yOP6/2+kM8gHJ4anmOh4wxDBvFFlgwdyvrGp00IMuS6F/aLmowinnl2G0w40r7cNEb7C4MzTv...]

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

See http://go.microsoft.com/fwlink/?LinkID=314055 for more information.]
   System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +116
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString, Purpose purpose) +425
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter2.Deserialize(String serializedState, Purpose purpose) +13
   System.Web.UI.Util.DeserializeWithAssert(IStateFormatter2 formatter, String serializedState, Purpose purpose) +40
   System.Web.UI.HiddenFieldPageStatePersister.Load() +247
   System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +251
   System.Web.UI.Page.LoadAllState() +41
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6211
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +245
   System.Web.UI.Page.ProcessRequest() +72
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +22
   System.Web.UI.Page.ProcessRequest(HttpContext context) +58
   ASP.cpanelwebsite_websitesetting_aspx.ProcessRequest(HttpContext context) +4
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +188
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1087.0 

کاربر سایت

سهیل علیزاده

عضویت از 1396/04/09

  • پنجشنبه 15 تیر 1396
  • 21:06

به Web.Config مراجعه کنید و کد زیر را میان تگ <system.web> قرار دهید. 

<machineKey validationKey="JFDSGOIEURTJKTREKOIRUWTKLRJTKUROIUFLKSIOSUGOIFDS..." decryptionKey="KAJDFOIAUOILKER534095U43098435H43OI5098479854" validation="SHA1" />

چگونه میتوانیم یک سوال خوب بپرسیم ؟

کاربر سایت

سهیل علیزاده

عضویت از 1396/04/09

  • پنجشنبه 15 تیر 1396
  • 21:10
کاربر سایت

mprogramer

عضویت از 1395/03/23

  • پنجشنبه 15 تیر 1396
  • 21:14

این کد رو قرار دادم خطا داد


Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Decryption key specified has invalid hex characters.

Source Error:


An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.


Source File: D:\vhosts\autooriginal.ir\httpdocs\web.config    Line: 21

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1087.0 

کاربر سایت

سهیل علیزاده

عضویت از 1396/04/09

  • پنجشنبه 15 تیر 1396
  • 21:27

کد زیر را جایگزین کنید:

<machineKey 
  validationKey="C22B4A396C8FF218E3357DCF17FCAD10D5FF9FB251286AC4B1410F1E58485F0E88800583955B8F7AD18649D04205ACC745ADBD63FFA4BD48D0BDCA0F9EF5D2FF"
  decryptionKey="3576EDB62B79264BFC929F0A220D948A46AA0BF303D6BFE8A2C907A714E869BA"
  validation="SHA1" decryption="AES"

/>

کاربر سایت

rezaya2938

عضویت از 1392/09/23

  • پنجشنبه 22 تیر 1396
  • 08:40

میتونید از این سایت Machine Key دریافت کنید:

http://www.developerfusion.com/tools/generatemachinekey

کاربرانی که از این پست تشکر کرده اند

هیچ کاربری تا کنون از این پست تشکر نکرده است

اگر نیاز به یک مشاور در زمینه طراحی سایت ، برنامه نویسی و بازاریابی الکترونیکی دارید

با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)