We have developed an application in outsystems In which we pass input parameters(Start date and End Date) and collects the data from Database and create a text file for that data and downloading that file at end of that action. It works fine. How ever, Third party vendor is accessing the same application using Weblink and trigger the download button and downloading the file using C# code which is a windows forms app.

In that case, Downloading file is not working and outsystems logs below error

   Cannot decrypt the content

   at OutSystems.RuntimeCommon.Cryptography.SymmCryptHelper.DecryptThenMacWithAESDotNet(Byte[] keyBytes, Byte[] allBytes, Byte[] associatedData)

   at OutSystems.HubEdition.WebWidgets.OSPageViewStateCompressed.DeserializeViewState(String viewState, String& hash)

   at OutSystems.HubEdition.WebWidgets.OSPageViewState.LoadPageStateFromPersistenceMedium()

   at System.Web.UI.Page.LoadAllState()

   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


   Error Deserializing ViewState of page "ASP.mainscreen_aspx", visitorid "6bec9183-7d74-464c-80e1-6d0e5c130dfd", size 256 bytes ("Jyi6f8lxpF...").

   Cannot decrypt the content

Iam able to reproduce the error by disabling the cookies in the browser in the application directly. How ever, How to fix this error in the C# code non browser based application. We tried clearing cookies and cache. Nothing worked.

Any help?


Have you tried exposing this as a webservice that response with binary content? That would be the better way to do this.