system.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
System.IO.Stream inputStream = assembly.GetManifestResourceStream(assembly.GetType().Namespace + "Manager.NLog.config");
using (StreamReader reader = new StreamReader(inputStream))
{
string result = reader.ReadToEnd();
}
作爲輸入流獲得空錯誤?我在項目文件夾下添加了配置文件。無法訪問嵌入式nlog配置文件?
但nlog .config名稱是manager.nlog.config – Nisha 2012-02-27 14:08:59
@judithnisha,好了,然後重新命名它,這很明顯。我會更新我的答案。 – 2012-02-27 14:14:07