Invalid character in a base-64 string - ViewState?

旧城冷巷雨未停 提交于 2019-12-10 10:01:51

问题


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()

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.


回答1:


it could be one of the reasons below:

  • Application Pool Recycling
  • Server Farms or Server Clusters
  • Proxy servers and Virus Scanners

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



来源:https://stackoverflow.com/questions/8731010/invalid-character-in-a-base-64-string-viewstate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!