public void ChangeToDefaultSerializer() { DefaultSerializer <User> serializer = new DefaultSerializer <User>(); serializer.setBinding(System.Reflection.BindingFlags.NonPublic);//all fields are public so no fields return serializer.Serialize(new User("Toto", "Titi")); }