This bit of code works for me:

Microsoft.SharePoint.Client.File file = ctx.Web.GetFileByServerRelativeUrl(@"/Shared%20Documents/Email%20Body.html");

var _stream = file.OpenBinaryStream();  

The following line causes an error: StreamReader reader = new StreamReader(_stream);

"The best overloaded method match for 'System.IO.StreamReader.StreamReader((System.IO.Stream)' has some invalid arguments.'

I'm not sure what I'm doing differently from what I've done in the past and what I see in tutorials now.

1 Answer 1


I needed to get the value property (OpenBinaryStream().Value). That's what appears to be storing the actual stream. My memory is a little fuzzy, but I don't remember having to do that before.. Regardless, it works!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.