3

I'm using RestSharp. I was using XML as the transport encoding for my data, but then I had problems with that, so I switched to using JSON. Now I'm having problems with that too!

All was well until I tried to pass an object containing a byte array (*). Now I get a de-serialization error complaining about "object has no parameterless constructor". (The JSON returned by the server looks Kosher - it's just not being correctly de-serialized by RestSharp).

I see I'm not the only one having problems. Is there no solution other than the baby-out-with-the-bathwater approach suggested in that post?

(*) I had tested it with a small hand-coded byte array early on in my development, just to check that it worked. It did work then, but doesn't work now. I don't know if that's due to the size of the array, the "characters" in the array, or what. Dammit, this has been such a time-sink!

1
  • 1
    Just curious, what happens if you declare List<byte> instead of byte[] ? Commented Aug 20, 2012 at 13:11

1 Answer 1

3

For anyone else struggling with this, I ended up simply swapping out the JSON formatter in favour of JSON.NET. That works.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.