在ASP.Net,我有时会收到以下错误 - 视图状态验证失败。原因:视图状态提供失败的完整性检查 [英] In ASP.Net, I sometimes get the following error - Viewstate verification failed. Reason: The viewstate supplied failed integrity check
问题描述
背景:我在C#开发的Web应用程序在ASP.Net 3.5。它运行很好,但是现在一些用户报告说他们有时会收到一个错误。我试图重复错误,但它一直努力。有一次,虽然当我让应用坐在我回来后,试图沿着移动它,它出错了。我倒觉得有事情做与超时,但我使用视图状态。
Background: I developed a web app in ASP.Net 3.5 in C#. It runs great but now a few users have reported that they recieve an error sometimes. I have tried to duplicate the error but it has been hard. One time though when I let the app sit I came back later and tried to move it along and it errored out. I would think that has something to do with the timeout but I am using the view state.
任何想法?当我看事件日志我看到下面的错误项。
Any ideas? When I look at the eventLog I do see the following error entry.
感谢您的帮助和想法!
约翰
我的事件日志具有以下错误:
My event log has the following errors:
事件code:4005
Event code: 4005
事件消息:表单验证失败的请求。原因:提供的票证已过期。
Event message: Forms authentication failed for the request. Reason: The ticket supplied has expired.
活动时间:14/03/2008 13时19分26秒。
Event time: 14/03/2008 13:19:26
事件时间(UTC):14/03/2008 13时19分26秒。
Event time (UTC): 14/03/2008 13:19:26
事件ID:d9f0333c2eed46e0b0207da69d2ea70e
Event ID: d9f0333c2eed46e0b0207da69d2ea70e
事件序列:154
事件发生:5
事件详细信息code:50202
Event detail code: 50202
事件code:3005
Event code: 3005
事件消息:发生未处理的异常。
Event message: An unhandled exception has occurred.
活动时间:2009年3月12日上午7点49分59秒。
Event time: 3/12/2009 7:49:59 AM
事件时间(UTC):2009年3月12日上午11时49分59秒。
Event time (UTC): 3/12/2009 11:49:59 AM
事件ID:590ac0f6ad734d988e9e02f0fb7800eb
Event ID: 590ac0f6ad734d988e9e02f0fb7800eb
事件顺序:52
事件发生:1。
事件详细信息code:0
Event detail code: 0
应用程序信息:
Application domain: /LM/W3SVC/32/ROOT-1-128813294498061103
Trust level: Full
Application Virtual Path: /
Application Path: C:\Home\LocalUser\ucpga\Web\
Machine name: 169349-WEB2
进程信息:
Process ID: 6912
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
下面是最新的错误:
Here is the latest error:
事件code:4009
事件消息:视图状态验证失败。原因:提供的视图状态未通过完整性检查。
活动时间:2009/3/15下午10时26分27秒
事件时间(UTC):2009年3月16日上午02时26分27秒
事件ID:3b5be134005e49c3b40400bcaa5cb48d
事件顺序:56
事件发生:1
事件详细信息code:50203
Event code: 4009 Event message: Viewstate verification failed. Reason: The viewstate supplied failed integrity check. Event time: 3/15/2009 10:26:27 PM Event time (UTC): 3/16/2009 2:26:27 AM Event ID: 3b5be134005e49c3b40400bcaa5cb48d Event sequence: 56 Event occurrence: 1 Event detail code: 50203
应用程序信息:
应用领域:/ LM / SVC / 32 / ROOT-1-128816433841748972
信任级别:完整
应用程序虚拟路径:/
应用程序路径:C:\\首页\\ LocalUser上\\ ucpga \\网络\\
计算机名:169349,WEB2
Application information: Application domain: /LM/W3SVC/32/ROOT-1-128816433841748972 Trust level: Full Application Virtual Path: / Application Path: C:\Home\LocalUser\ucpga\Web\ Machine name: 169349-WEB2
进程信息:
进程ID:8892
进程名:w3wp.exe
帐户名:NT AUTHORITY \\ NETWORK SERVICE
Process information: Process ID: 8892 Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE
请求信息:
请求URL: https://hr.ucpga.org:443/application.aspx
请求路径:/application.aspx
用户主机地址:74.160.64.222
用户:结果
通过身份验证:假
身份验证类型:结果
线程帐户名:169349,WEB2 \\ ucpga
Request information:
Request URL: https://hr.ucpga.org:443/application.aspx
Request path: /application.aspx
User host address: 74.160.64.222
User:
Is authenticated: False
Authentication Type:
Thread account name: 169349-WEB2\ucpga
ViewStateException信息:
异常消息:无效的视图状态。
客户端IP:74.160.64.222
端口:1251
用户代理:Mozilla的/ 4.0(兼容; MSIE 7.0; Windows NT的5.1; GTB5; .NET CLR 1.1.4322; InfoPath.1)
ViewStateException information: Exception message: Invalid viewstate. Client IP: 74.160.64.222 Port: 1251 User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB5; .NET CLR 1.1.4322; InfoPath.1)
推荐答案
此问题通常可以通过其自动生成的&LT造成的;将machineKey />
键在服务器的的machine.config
文件。每次应用程序启动重新它会产生新的密钥。这种无效的任何现有加密视图状态或窗体身份验证票证。
This issue can often be caused by having auto-generated <machineKey />
keys in your server's machine.config
file. Each time your application starts afresh it will generate new keys. This invalidates any existing encrypted viewstate or forms authentication tickets.
尝试设置了&LT;的machineKey /&GT;
的validationKey
和 decryptionKey
为固定值。请参阅以下链接了解更多信息:
Try setting the <machineKey />
validationKey
and decryptionKey
to fixed values. See the following link for more information:
如何配置的machineKey在ASP.NET 2.0(MSDN)
这篇关于在ASP.Net,我有时会收到以下错误 - 视图状态验证失败。原因:视图状态提供失败的完整性检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!