Bangkok market on trainline


Deserialising to IList

Having upgraded the website I work on to .net 2.0, one of our console apps failed whilst talking to a webservice on the site. We’d not changed anything on either the console app, or the website other than upgrading the website to 2.0.

The error message was “global:System.Collections.IList cannot be deserialized because it does not have a default public constructor”. This makes a lot of sense and it turns out that the class being serialised contains a public IList property. Changing this to a concrete type solved the problem.

So the question is… what was the deserialiser in 1.1 doing? how did it know which concrete type to deserialise to?