cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

.NET Standard support

.NET Standard support

Jan_Zeman
Helpful | Level 6
Go to solution

Hello. I've tried to find an aswer within the already existing answers but without success. Sorry in case I overlooked.

 

I have recently tried to convert my PCL projects to .NET Standard. After the conversion I was supposed to re-add all the NuGet packages. All went fine until I bumped into my dependency on Dropbox.Api library. That one refused to install claiming .NET Standard is not supported. Because of this I had to rollback the whole effort.

 

Is there a plan to add .NET Standard support anytime soon?

 

Thanks in advance for your answer.

 

Best regards

Jan

1 Accepted Solution

Accepted Solutions

Qiming Y.
Dropbox Staff
Go to solution

Hi Jan,

 

The SDK contains a PCL libarary which is compatible with .NET Standard. If you are using project.json you need add portable-net45+win8 to your import section e.g.

 

"frameworks": { 
    "netstandard1.1": { 
        "imports": [ 
            "portable-net45+win8" 
        ] 
     } 
}

If your are using .csproj you need add 

<PackageTargetFallback>portable-net45+win8</PackageTargetFallback>

under your <Project> element.

 

Thanks,

Qiming

 

View solution in original post

6 Replies 6

Greg-DB
Dropbox Staff
Go to solution
Hi Jan, I believe this is supposed to already work. The SDK contains PCL with profile111 which is compatible with .NET Standard 1.1 and above.

Can you share the steps you followed to reproduce this, and the full error/output you're getting? Thanks in advance!

Jan_Zeman
Helpful | Level 6
Go to solution

Hi Greg,

 

Thanks for the fast reaction.

 

1) Start VS 2017 (Windows)

2) Create new project and select "Class library (Portable)" with the following profile: (NET 4.5.1, Xamarin.Android, Xamarin.iOS

3) Open properities of the just created project

4) Click "Target .NET Platform Standard" link (in my case .NETStandard1.2 is preselected so I keep it)

5) Manage NuGet Packages and try to add "Dropbox.Api"

 

Nothing is added and the output says:

 

Package Dropbox.Api 4.3.0 is not compatible with netstandard1.2 (.NETStandard,Version=v1.2). Package Dropbox.Api 4.3.0 supports:
- net45 (.NETFramework,Version=v4.5)
- portable-dnxcore50+net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=net45+wp80+win8+wpa81+dnxcore50)
- portable-net40+sl5+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile328)
One or more packages are incompatible with .NETStandard,Version=v1.2.
Package restore failed. Rolling back package changes for 'ClassLibrary1'.

 

 

 

If I try to switch to .NETStandard1.6 it is the same result:

 

Package Dropbox.Api 4.3.0 is not compatible with netstandard1.6 (.NETStandard,Version=v1.6). Package Dropbox.Api 4.3.0 supports:
- net45 (.NETFramework,Version=v4.5)
- portable-dnxcore50+net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=net45+wp80+win8+wpa81+dnxcore50)
- portable-net40+sl5+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile328)
One or more packages are incompatible with .NETStandard,Version=v1.6.
Package restore failed. Rolling back package changes for 'ClassLibrary1'.

Qiming Y.
Dropbox Staff
Go to solution

Hi Jan,

 

The SDK contains a PCL libarary which is compatible with .NET Standard. If you are using project.json you need add portable-net45+win8 to your import section e.g.

 

"frameworks": { 
    "netstandard1.1": { 
        "imports": [ 
            "portable-net45+win8" 
        ] 
     } 
}

If your are using .csproj you need add 

<PackageTargetFallback>portable-net45+win8</PackageTargetFallback>

under your <Project> element.

 

Thanks,

Qiming

 

Jan_Zeman
Helpful | Level 6
Go to solution

Hi Qiming,

 

Yes, this worked. Thank you! I thought this all should work automatically while adding the NuGet. I do not know that much about this area yet. Is there any documentation Dropbox & .NET Standard around where I can read more and also use it in the future when libs get updated?

 

Best regards

Jan

Qiming Y.
Dropbox Staff
Go to solution

We've added some instructions to the github README. If you need more info about PCL .NET Standard compatibility you can check out 

https://docs.microsoft.com/en-us/nuget/schema/msbuild-targets#packagetargetfallback and https://docs.microsoft.com/en-us/dotnet/articles/standard/library

 

Thanks,

Qiming

Jan_Zeman
Helpful | Level 6
Go to solution

Perfect. Thank you again! Jan

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Jan_Zeman Helpful | Level 6
  • User avatar
    Qiming Y. Dropbox Staff
What do Dropbox user levels mean?