I am trying to get a bare bones bit of RestSharp into my Windows CE / Compact Framework 3.5 app.
This minimalistic code:
RestClient client = new RestClient("http://192.164.144.42:72921/");
RestRequest request = new RestRequest("api/vendorItems/", Method.GET);
RestResponse response = client.Execute(request) as RestResponse;
string content = response.Content; // raw content as string
...first caused a problem because I had to change this:
RestResponse response = client.Execute(request);
...to this:
RestResponse response = client.Execute(request) as RestResponse;
...but notwithstanding that minor victory, this line still won't compile:
RestRequest request = new RestRequest("api/vendorItems/", Method.GET);
...telling me, "The type 'System.Uri' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.0.0"
I do have System referenced, but it is version 3.5.0.0 (Runtime version == v2.0.50727)
What can I do to get that line to compile without downgrading my System reference (which would doubtless cause the compiler to squawk about other lines of code)?
UPDATE
In VS 2008, I get lots of err msgs emanating from the compiler scratching its head about new language constructs, such as async things; In VS 2013, I get:
...then:
And in VS 2013 RC it says: "(incompatible) [crlf+Tab] This project is incompatible iwth the current edition of Visual Studio"
The latest versions of RestSharp use SimpleJson for serialization and deserialization. SimpleJson doesn't have a CF build, however it does have an FFX 2.0 build so it's pretty close to CF-compliant. There are a few TryParse calls that you have to replace, but all-in-all not bad.
My suggestion is to:
I'll likely do these steps myself in the next month or so (I've got through #7 actually, but I also have other changes and additions as well) but it's probably not best to hang out waiting on me to find time for this. I have to finish an ORM implementation that is using RestSharp to make sure I have all the needed changes before I'll do my pull request.