base-64字符串中的无效字符-ViewState? [英] Invalid character in a base-64 string - ViewState?

查看:90
本文介绍了base-64字符串中的无效字符-ViewState?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Web应用程序每天都会抛出少量这些错误.

Web application is throwing a handful of these errors everyday.

Exception: System.FormatException: Invalid character in a Base-64 string.
   at System.Convert.FromBase64String(String s)
   at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
   at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
   at System.Web.UI.HiddenFieldPageStatePersister.Load()

我认为错误来自解码ViewState,但是我在触发错误时遇到了麻烦.我从来没有能够触发开发人员中的错误,只有产品.即使在生产中,我也无法轻松重现该错误.页面上有多个用于数据视图的过滤器,选择不同的值最终会引发错误,但我无法找出任何模式.有时这是我第一次更换过滤器,有时没有任何组合.

I think the error's coming from decoding the ViewState, but I'm having trouble just triggering the error. I've never been able to trigger the error in dev, only prod. And even in prod, I can't reproduce the error easily. There are several filters for a dataview on the page, and selecting different values will eventually throw the error, but not in any pattern I can figure out. Sometime's it's the very first time I change a filter, sometimes no combination will.

推荐答案

这可能是以下原因之一:

it could be one of the reasons below:

  • 应用程序池回收
  • 服务器场或服务器群集
  • 代理服务器和病毒扫描程序

首先,我将在machine.config中使用特定密钥,以防止在每个进程启动时自动生成密钥

As first thing I would Use a specific key in the machine.config to prevent automatic key generation on each process start

这篇关于base-64字符串中的无效字符-ViewState?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆