private void OnXmlSchemaValidationErrors(object sender, ValidationEventArgs e) { _logger.Error("XML Schema 验证发生错误."); if (e.Severity == XmlSeverityType.Error) { _logger.Error(e.Message, e.Exception); } if (e.Severity == XmlSeverityType.Warning) { _logger.Warn(e.Message, e.Exception); } }
static IApplicationLaunchable BuildApplicationLaunchable(IApplicationContext context, IExtensionRegistry registry) { IExtension launchableExtension; if (!registry.TryGetExtension(context.ApplicationLaunchableId, out launchableExtension)) { string msg = string.Format(CultureInfo.InvariantCulture, "启动 {0} 时发生异常 (没有找到扩展 {1} ).", context.Name, context.ApplicationLaunchableId); _logger.Error(msg); throw new PlatformConfigurationException(msg); } return(launchableExtension.Build <IApplicationLaunchable>()); }