I have a Portable Class Library project which currently targets the following platforms:
I'd like to add support for .NET 4.0, but I currently use some .NET features, which are only available in .NET 4.0 through inclusion of the "Microsoft BCL Portability Pack"; features like the CallerMemberName attribute, the IProgress interface, and the updated Task class.
Is there a way to add some 'conditional' support for a platform, in a PCL project? I.e. "allow .NET 4.0, as long as dependency XXXXX is included?"
As mentioned in the comments, target .NET 4 in the PCL and reference the Microsoft.Bcl and probably Microsoft.Bcl.Async packages.
You can consider packaging up your PCL as a NuGet package with those packages listed as a dependency. That way when your NuGet package is installed in a project the required Microsoft.Bcl packages will also be installed.