`PortableClient` constructor failing after moving project

427 views Asked by At

I have a portable class library project that I have just moved out of a totally portable solution into one where only certain projects are portable. The PCL project uses the PortableRest library for communicating with some web services. As soon as I moved the PCL project into my bigger project, I started getting an exception on the line:

var client = new RestClient();

If I place the same code into a new, non-portable class library, that same line of code works fine. This code also works fine in the PCL code, but only in its original solution, not the new one, so besides PortableRest.RestClient being fully intended to run in a portable project, it does in its home project, just not the new one.

The exception I get on that ctor line is:

MissingMethodException: "Method not found: 'Void System.Net.Http.HttpClientHandler.set_AutomaticDecompression(System.Net.DecompressionMethods)'."

Maybe worth emphasising: I have not changed any code at all. Only moved the project that uses PortableClient from one solution to another.

0

There are 0 answers