Why am I getting an InvalidOperationException when I serialize an ArrayList?