Page 1 of 1

ServiceStack and Portable Class Libraries  Topic is solved

PostPosted: Mon Jun 19, 2017 4:48 pm
by SBarnes
Hi

If you are going to attempt to use ServiceStack with a Portable Class Library (PCL) which would more than likely be the case with mobile development in Xamarin then these are the steps required:

1. Firstly install ServiceStack.Client into the solution, don't use the PCL version its been deprecated, but should this produce an error about incorrect frameworks then you will need to edit the setting called TargetFrameworkProfile in the project file and change its value to Profile7, after doing this nuget should install the relevant packages into the relevant projects.

2. In the IOS project add the line of code IosPclExportClient.Configure(); to main.cs

3. In the droid project add the line AndroidPclExportClient.Configure(); to MainActivity.cs

failing to do steps 2 and 3 will cause any attempt to instantiate the JsonServiceClient to throw an exception

Hope this is of help to someone