RestSharp 104.4.0 with xamarin 5.0

SagarGVSagarGV USMember

hi I am trying to install RestSharp 104.4.0 with Xamarin Studio 5.0. I use the built in nuget pkg manager (add packages). When I try to install RestSharp 104.4.0 I get an error as follows. Any pointers to resolve this issue?

Thanks!

<br /> Adding RestSharp...<br /> Adding 'RestSharp 104.4.0' to sampleproject.ios.<br /> Could not install package 'RestSharp 104.4.0'. You are trying to install this package into a project that targets 'MonoTouch,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.<br />

Posts

  • mattwardmattward GBMember Xamurai

    The RestSharp NuGet package from NuGet.org does not contain any assemblies that are compatible with iOS.

    There is a RestSharp component available from the component store which you could take a look at.

    Other options include using other NuGet components. There are a few discussions on this forum about alternatives.

  • SagarGVSagarGV USMember

    Thanks Matt for the pointer.
    I could install RestSharp 104.4.0 using the earlier nuget pkg manager with xamarin studio 4. And it was working too in ios.

    However no luck with the built in nuget pkg manager in xamstudio 5. I am getting same errors for other components as well:
    <br /> Could not install package 'ServiceStack.Text 4.0.21'.<br /> Could not install package 'Simple.Json 1.0.0.3'.<br />

    Any workaround that I could use to install these components? Are these components not upgraded for the latest version of xamstudio 5? (how was it working with the nuget pkg manager in xamstudio 4?)

    Thanks in advance!

  • mattwardmattward GBMember Xamurai

    The NuGet addin in Xamarin Studio 5.0 uses the same code as the one in Xamarin Studio 4.0. The NuGet addin for Xamarin Studio 4.0 should have failed to install RestSharp 104.4.0 into an iOS project since NuGet considers them to be incompatible.

    An iOS project would have a target framework of MonoTouch. The RestSharp 104.4.0 NuGet package does not have any portable class libraries, nor any MonoTouch assemblies, so it would fail to install into an iOS project. NuGet considers them to be incompatible. The only way to get it to install would be to temporarily change the target framework of the project to the full .NETFramework instead. Doing that is a workaround and you may end up installing NuGet packages that would not work with iOS.

    The other NuGet packages are considered by NuGet to be incompatible with iOS projects.

    ServiceStack.Text only has assemblies that target .NET 4.0.
    Simple.Json only has assemblies that target .NET 4.5.

    So whilst you could add the references either manually by downloading the NuGet package and extracting the assemblies, or by changing the target framework of your project, the referenced assemblies are not guaranteed to work on iOS. They may use part of the .NET API that is not supported on iOS devices.

  • how to upload larger image files in monotouch? i need to upload camera pictures and gallery pictures too. some times its too larger like 10mb. how can i achieve this? any helps or idea for me?

Sign In or Register to comment.