J'utilise log4net pour la journalisation. Ma configuration de journalisation est stockée dans un fichier séparé.exception de configuration log4net
Web.Config: configSections
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
Définition mon fichier config dans AssemblyInfo.cs
[assembly: log4net.Config.XmlConfigurator(ConfigFile="Log4Net.config", Watch = true)]
Et quand j'initialiser mon LogManager, je reçois cette erreur
"System.TypeLoadException"
message: Could not load type 'log4net.Config.Log4NetConfigurationSectionHlandler' from assembly 'Log4net'.
Oui il est dit "Log4NetConfigurationSectionHlandler '", ce n'est pas une faute de frappe
et plus tard, cette erreur
An error occurred creating the configuration section handler for log4net: Could not load type 'log4net.Config.Log4NetConfigurationSectionHlandler' from assembly 'Log4net'.
Edit: J'ai essayé la suggestion de Mauricio Scheffer
a
log4net:ERROR XmlConfigurator: Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the <log4net> and <configSections> elements. The configuration section should look like: <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
double: http://stackoverflow.com/questions/1321261/configuring-log4net-with-xml-file –
Edit: Je viens de découvrir que mon web.config avait un type "Log4NetConfigurationSectionHlandler" venait de web.config. Je travaille toujours sur obtenir ce travail avec un fichier de configuration externe – ram