我有一个可移植的库,我用于Windows Phone应用程序.在同一个可移植库中,我有几个内容文件(Build Action = Content).
我DataReader在Portable Library中创建了一个类,它应该向我返回一个流到内容文件.然而,下面的代码我一直取回null的GetManifestResourceStream.我究竟做错了什么?
public class DataReader
{
public static Stream GetStream(string code)
{
string path = string.Format("./data/code-{0}.dat", code);
return Assembly.GetExecutingAssembly().GetManifestResourceStream(path);
}
}
Run Code Online (Sandbox Code Playgroud)