I am writing a ConfigManager class using Portable Class Libraries. PCL supports StreamReader
and StreamWriter
classes that I want to use, but the PCL version of those classes do not support passing in a string during construction. PCL also does not support the reader.Close()
and writer.Close()
. Lastly it doesn't support the FileStream
class.
So I am looking for an answer to any one of the following questions:
StreamReader
and StreamWriter
classes working
in a PCL?stream
using PCL? Use Dispose()
instead of Close()
(or just wrap everything in a using statement). We've hidden/removed Close()
in Windows Store apps and newer PCLs, because it does the same thing and people would be confused about which one to call.
Consider using PCL Storage for cross platform file system access.
Here are some blog posts you may want to refer to for how to approach platform-specific functionality in PCLs: