Windows 이벤트 로그에 이벤트를 쓰는 중 문제가 발생합니다. 게시물을 살펴본 결과 올바르게보고 있지만 이벤트 뷰어에서 다음과 같은 오류가 발생합니다.응용 프로그램 이벤트 로그에 메시지 쓰기
메시지 리소스가 있지만 메시지가 문자열/메시지 테이블에 없습니다.
내가 누락 된 항목에 대한 아이디어가있는 사람이 있습니까? 여기
<Fragment>
<PropertyRef Id="NETFRAMEWORK35"/>
<PropertyRef Id="NETFRAMEWORK20"/>
<PropertyRef Id="NETFRAMEWORK20INSTALLROOTDIR"/>
<PropertyRef Id="NETFRAMEWORK20INSTALLROOTDIR64" />
<Component Id='EventSource'
Directory='INSTALLDIR'
Guid='F382AAC5-F7C5-46A4-95CF-EA7724DXXXXX' >
<Condition>ALLUSERS</Condition>
<?if $(var.Platform) = x64 ?>
<util:EventSource Log='Application'
Name='MySource'
EventMessageFile='[NETFRAMEWORK20INSTALLROOTDIR64]EventLogMessages.dll'
KeyPath='yes' />
<?else ?>
<util:EventSource Log='Application'
Name='MySource'
EventMessageFile='[NETFRAMEWORK20INSTALLROOTDIR]EventLogMessages.dll'
KeyPath='yes' />
<?endif ?>
</Component>
</Fragment>
내가 이벤트 로그에 기록 내 C# 코드입니다 :
나는 윅스 설치 프로그램에서 만든 이벤트 소스를 데
public class Log
{
private const string EventSource = "MySource";
private const string EventLog = "Application";
private static EventLog _logger = null;
private static void InitLogger()
{
if (!System.Diagnostics.EventLog.SourceExists(EventSource))
{
System.Diagnostics.EventLog.CreateEventSource(EventSource, EventLog);
}
_logger = new EventLog() { Source = EventSource, Log = EventLog };
}
public static void Write(EventLogEntryType entryType, string format, params object[] args)
{
string entry = _Format(format, args);
try
{
if (_logger == null)
InitLogger();
_logger.WriteEntry(entry, entryType, 1);
}
catch (Exception ex)
{
Tracer.Misc.Error("Could not write to event log: {0}", entry);
}
}
private static string _Format(string format, object[] args)
{
if ((args == null) || (args.Length == 0))
return format;
try
{
return String.Format(format, args);
}
catch (Exception e)
{
return format + " [Format Exception:" + e.Message + "]";
}
}
}
이 트레이서 무엇
메시지 자원이 존재하지만 메시지가 문자열/메시지 테이블에서 찾을 수없는 로그 메시지의 예입니다
다음 정보는 이벤트에 포함 된 .Misc.Error? 전체 소스 샘플? – Kiquenet