OneDrive / onedrive-sdk-dotnet-msa-auth-adapter

Other
25 stars 22 forks source link

Installing on Xamaring Project #29

Closed Licantrop0 closed 7 years ago

Licantrop0 commented 7 years ago

Hi, I'm trying to install this NuGet package to my Xamarin PCL project, but I receive this error:

Could not install package 'Microsoft.OneDriveSDK.Authentication 1.0.8'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile7', 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.

I could install without any issues Microsoft.Graph.Core 1.3.0 and Microsoft.OneDriveSDK 2.0.6, but not the auth package...

cdmayer commented 7 years ago

The Auth package targets .NET 4.5.1. Are you able to upgrade your project to that version?

Licantrop0 commented 7 years ago

I updated to .Net 4.5.1: image

but I still receive a similar error (I don't know why it calls out .NET 4.6 instead of 4.5.1):

Could not install package 'Microsoft.OneDriveSDK.Authentication 1.0.8'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.6,Profile=Profile44', but the package does not contain any assembly references or content files that are compatible with that framework.

cdmayer commented 7 years ago

Oh, I see the issue. The message actually says it all (.NET Framework was a red herring). You are targeting .NET Portable. The Auth Adapter package is not portable. It is platform-dependent because it requires platform-specific UI components.

At this time, you probably need to either write your own implementation of IAuthenticationProvider (https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/master/src/Microsoft.Graph.Core/Authentication/IAuthenticationProvider.cs), or you could help out/wait for #28 (Xamarin auth implementation) to be completed.