Can anyone think of a way to force ErrorLog.WriteEntry() to throw an
exception (assuming you don't specify another machine) ?
For what? unitTest?
If you specify a non-existent source , it will automatically create a log
for it , so that won't work.
Did you look at msdn? Exception is raised in case of
- The Source property of the EventLog has not been set.
- The source is already registered for a different event log.
- The message string is longer than 32766 bytes.
- The source name results in a registry key path longer than 254 characters.
- or -
The source name results in a registry key path longer than 254 characters.
--
WBR,
Michael Nemtsev :: blog:
http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche