private static XElement GetConfigRoot(string filePath) { try { return XElement.Load(filePath); } catch (Exception ex) { //写日志 Logger.Error("Error occured when loading xml file: " + filePath, ex); return null; } } }