wil
wil

Reputation: 903

how to install Microsoft.Azure.DocumentDB.Core on portable library

I get error installing documentDB nuget package.

Could not install package 'Microsoft.Azure.DocumentDB.Core 1.2.1'. 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.

Any ideas? thanks in advance.

Upvotes: 1

Views: 832

Answers (2)

Matias Quaranta
Matias Quaranta

Reputation: 15603

The Core package actually targets NetStandard 1.6, not .Net Core specifically.

NetStandard is a library that acts as API for different runtimes and it's much more powerfull than PCL because it's platform-agnostic:

NetStandard compatibility chart

This means that the DocumentDb.Core package can run on .Net Core 1.0, .Net Framework, Xamarin and UWP.

If you are creating a PCL, I would recommend you to create a NetStandard library instead.

It will let your library support a much wider universe of platforms and the great thing is that, if a new platform comes along that supports NetStandard 1.6 (for example), your library will work without needing to recompile or republish it.

Upvotes: 3

Jambor - MSFT
Jambor - MSFT

Reputation: 3293

This error message tells us that this assembly Microsoft.Azure.DocumentDB.Core is not supported on portable library. From this assembly nuget site, we know that This client library enables client applications targeting .NET Core to connect to the Azure DocumentDB service. If you want to use Azure DocumentDB library, please try to see if this assembly works Install-Package Microsoft.Azure.DocumentDB

Upvotes: 1

Related Questions