0

Am I blind or is

public virtual Task CopyToAsync(
    Stream destination,
    int bufferSize,
    CancellationToken cancellationToken
)

really not available in PCLs? My profile is: .NET 4.5, Windows Store, WP8, Xamarin.iOS and Xamarin.Android.

MSDN claims it is available for .NET 4.5 and Windows Store...it's on Android and on iOS but not in a PCL targeting these?

What's a good cancelable workaround for

await result.Content.CopyToAsync(targetStream);
Krumelur
  • 32,180
  • 27
  • 124
  • 263

1 Answers1

0

It is available in the PCL, but it depends on the targets platforms you selected. I use it in a project that targets .NET 4.5, Windows Phone 8 and Windows Store apps. But if you select a target platform that doesn't have this overload (perhaps Silverlight or WP7), then it won't be available for the PCL.

In your case, I assume this method is not supported in Xamarin...

Thomas Levesque
  • 286,951
  • 70
  • 623
  • 758
  • 1
    I have just reviewed the code. Should look close before posting here. I'm not dealing with a Stream but with an HttpContent object which happens to have a CopyToAsync(). I will accept your answer because the explanation is correct wrt profile selection. – Krumelur Jan 03 '14 at 11:11