When running one of my Visual Studio web performance tests, I noticed intermittent exceptions when trying to decode viewstate:
Message: Invalid length for a Base-64 char array.
Call Stack: at System.Convert.FromBase64String(String s) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) at System.Web.UI.HiddenFieldPageStatePersister.Load()
This only happens on one test at a single spot. Doing some research I noticed that the viewstate sent by the client and the viewstate received by the server differed only in that all plus (+
) characters became spaces ( ).
What is causing this?