2
Я получаю следующее исключение. Я использую Enterprise Log 6.0 Block Logging Block.Раздел конфигурации для ведения журнала не найден в источнике конфигурации
System.InvalidOperationException was unhandled by user code
HResult=-2146233079
Message=The configuration section for Logging cannot be found in the configuration source.
Source=Microsoft.Practices.EnterpriseLibrary.Logging
StackTrace:
at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterFactory.LogWriterConfigurationBuilder.Create()
at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterFactory.Create()
at Logger..ctor() in \MBSLogger.cs:line 19
at EventLoggingTest.test_log_simple_exception() in c:\Users\Vinay.Joseph\Documents\Visual Studio 2013\EventLoggingTest.cs:line 20
InnerException:
База кода приведена ниже.
IConfigurationSource configurationSource = ConfigurationSourceFactory.Create();
LogWriterFactory logWriterFactory = new LogWriterFactory(configurationSource);
Logger.SetLogWriter(logWriterFactory.Create());
if (!Logger.IsLoggingEnabled())
{
}
else {
Logger.Write(new LogEntry(){
Severity = System.Diagnostics.TraceEventType.Information,
TimeStamp = DateTime.Now,
Message = "Hello World"
});
}
Скажите, пожалуйста, куда я иду.