138.

To write error message in event logfile which namepace is use?

The System.Diagnostics namespace provides classes that allow you to interact with system processes, event logs, and performance counters