Ian P
Ian P

Reputation: 129

ASP.NET to Mono - getting a HTTP 500. Error processing request. System.ArgumentNullException: Argument cannot be null

I'm working on my first ASP.NET to Mono port. I built a test site with several functionalities to test. One is just a simple form post. The error I'm getting is this:

Argument cannot be null. Parameter name: inputString

Description: HTTP 500. Error processing request.

Stack Trace:

System.ArgumentNullException: Argument cannot be null. Parameter name: inputString at System.Web.UI.ObjectStateFormatter.Deserialize (System.String inputString) [0x00000] in :0 at System.Web.UI.LosFormatter.Deserialize (System.String input) [0x00000] in :0

I tried to debug by commenting out all the code that dealt with a session variable or form input (Request.Form) but still got the error. I now have even all the code inside the page load commented out but still no dice. This form was/is working fine as ASP.NET on IIS. Maybe there's a configuration I didn't do?

** EDIT ** I was able to pinpoint the problem to a custom Page class that I use to inherit from System.Web.UI.Page where I have overriden some of the base methods. When I switch back to System.Web.UI.Page, the error goes away. I do need my custom Page class. The error occurs when I do a form post/postback; initial load works fine.

Upvotes: 1

Views: 3079

Answers (1)

Ian P
Ian P

Reputation: 129

* Problem solved * It was in the LosFormatter.Deserialize method. I had it checking if the string passed was null then revised it to use string.IsNullOrEmpty instead. Maybe it doesn't like empty strings either.

Upvotes: 1

Related Questions