I\'m trying to read an embedded text file with System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(resource); but it gives me a Stream
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(resource);
Stream
A StreamReader is a subclass of TextReader, so you will be able to do:
StreamReader
TextReader
using(var stream = System.Reflection.Assembly.GetExecutingAssembly(). GetManifestResourceStream(resource)) using(var reader = new StreamReader(stream)) { // Use reader. }