Skip to content

Xamarin Assets文件读取

L edited this page Dec 12, 2019 · 1 revision

在Assets文件夹中添加nlog.config文件,在属性中将Build Action设置为AndroidAsset

var steam = Assets.Open("nlog.config");
var xmlReader = System.Xml.XmlReader.Create(steam);
NLog.LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(xmlReader, null);

NLog在Xamarin Android中的配置

Clone this wiki locally