Forum Cross Platform with Xamarin

Cannot install AWSSDK nuget package in Xamarin Form PCL: No assembly reference that are compatible

I am trying to install the AWSSDK via Nuget into a Xamarin Forms PCL. I receive this error:

"You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', but the package does not contain any assembly references or content files that are compatible with that framework."

It is strange because I have some other AWSSDK packages (.CognitoIdentity, .DynamoDB, .Lambda, etc.) but I cannot get the standard package. I have seen answers to similar errors but none of them are helping.

Please, if anyone can help, I could really use some suggestions. I have been stuck on this for over a week now!

Best Answer

  • mattwardmattward GB Xamurai
    Accepted Answer

    The problem is not specific to your PCL project. Profile 78 uses a subset of APIs that work across .NET 4.5, Windows 8 and Windows Phone 8. The profile being used by AWSSDK uses a subset of APIs that work across Windows Phone for Applications (not the same as Windows Phone 8) and Windows 8. Since this set of APIs does not include .NET 4.5 it may use an API that is not supported on .NET 4.5 so it is not compatible with a profile that supports .NET 4.5.

Answers

  • mattwardmattward GBMember Xamurai

    The AWSSDK NuGet package contains a portable class library (PCL) assembly that targets:

    portable-wpa+netcore45
    

    Profile 78 targets:

    portable-net45+win+wp80
    

    netcore45 is the same as win which is Windows 8. So your PCL project's profile is not compatible.

    Looking at other PCL profiles I can only see Profile32 which is the closest to what the AWSSDK NuGet package targets. Unfortunately this is not a profile that Xamarin supports. So you are left with contacting the author of the NuGet package to see if they can provide a PCL that is compatible.

  • EdEastwoodEdEastwood USMember ✭✭

    Thanks Matt. I just have a couple questions for follow up.
    To begin, where can I learn about the different profiles? I seem to only be able to find very scarce resources.
    If I wanted to download the AWSSDK, without using NuGet into the project, could I do that? And if so, how does one install an SDK manually for a PCL?
    What is strange to me is the AWSSDK has documentation for Xamarin that says to use NuGet!

  • mattwardmattward GBMember Xamurai

    To see what frameworks particular profiles support I normally use Stephen Cleary's website which lists the profiles with their target frameworks. This will not show you the individual APIs supported in the profile but gives you an idea which profile would be supported by a NuGet package.

    The list of PCL profiles supported by Mono should be listed in the project options for a PCL project.

    You could try directly referencing the AWSSDK assemblies however if that uses an API that is not supported by the platform you are using it (iOS or Android) then your application may well crash.

    You cannot manually install a SDK for a PCL. If Mono does not support that profile you cannot easily add it yourself. There may well be good reasons why a particular profile is not supported.

    There is an AWS component available on the Xamarin Component store although it is a bit old. Also this component does not contain any PCL assemblies and will instead provide assemblies for iOS and Android.

  • EdEastwoodEdEastwood USMember ✭✭

    Thanks for all your help Matt! I am going to give the components a shot.

    It is strange because my project properties say that the PCL project targets Windows 8.
    It is also weird that there is an AWS Mobile SDK package specifically for .NET and Xamarin, but Xamarin doesn't support its profile.

    Is this a problem that is specific to our PCL project? Or would this be universal to all PCL's? I am not confident that I fully understand the issue at hand here.

  • mattwardmattward GBMember Xamurai
    Accepted Answer

    The problem is not specific to your PCL project. Profile 78 uses a subset of APIs that work across .NET 4.5, Windows 8 and Windows Phone 8. The profile being used by AWSSDK uses a subset of APIs that work across Windows Phone for Applications (not the same as Windows Phone 8) and Windows 8. Since this set of APIs does not include .NET 4.5 it may use an API that is not supported on .NET 4.5 so it is not compatible with a profile that supports .NET 4.5.

  • batmacibatmaci DEMember ✭✭✭✭✭

    so what is the solution here? it means we cant use aws with PCL? or we need to use different profile?

Sign In or Register to comment.