none
EventLogReader.ReadEvent() returns “The data area passed to a system call is too small” exception RRS feed

  • Question

  • Hi team,

    I am trying to read windows eventlog via c# application.When i run my application sometimes i am getting above stated exception.I don't know when this exception occurs please assist further.

    try{

    EventLogReader reader = new EventLogReader(query);

    query.ReverseDirection = readDirection;

    reader.BatchSize = 500;

    long startTimeMillis = (long)timeSpan.TotalMilliseconds;

    for (EventRecord eventInstance = reader.ReadEvent(); null != eventInstance; eventInstance = reader.ReadEvent())

    {

    }

    }

     catch (Exception ex)
                {

    Console.WriteLine("Exception"+ex);

    }



    Friday, April 26, 2019 10:43 AM

Answers

All replies