Subscribe to
Posts
Comments

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?

One Response to “Deserialising to IList”

  1. on 10 Jan 2008 at 12:14 amMark

    my guess is you got lucky and it turned into an array. Chuck a 1.1 WSDL command at it and look at the proxy class it creates?

Leave a Reply