public static IList<string> ReadResourceFileAsLines(string filename)
{
Assembly thisAssembly = Assembly.GetCallingAssembly();
List<string> lines = new List<string>();
using (Stream stream = thisAssembly.GetManifestResourceStream(filename))
using (StreamReader reader = new StreamReader(stream))
{
string line = null;
while ((line = reader.ReadLine()) != null)
{
lines.Add(line);
}
}
return lines;
}