2
다음 예외가 발생합니다. 엔터프라이즈 라이브러리 6.0 응용 프로그램 로깅 블록을 사용하고 있습니다.로깅의 구성 섹션을 구성 소스에서 찾을 수 없습니다.
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"
});
}
내가 잘못하고있는 곳을 알려주십시오.