I have a Portable Library which I am using for a Windows Phone application. In that same Portable Library, I have a couple of content files (Build Action = Content).
I created a class DataReader
in the Portable Library which is supposed to return me a stream to the content file. However, with the code below I am consistently getting back null
from GetManifestResourceStream
. What am I doing wrong?
public class DataReader
{
public static Stream GetStream(string code)
{
string path = string.Format("./data/code-{0}.dat", code);
return Assembly.GetExecutingAssembly().GetManifestResourceStream(path);
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…