Question

I'm using LogParser COM API to query event logs in my WPF .NET 4.0 app, but now I'm facing a problem that the ExecuteQuery take too long to run. In the sample code which is Winform + .NET 2.0, the ExecuteQuery api of LogQueryClassClass return instantly. My parameters are the same with sample which is like below

var inputFormat = new COMEventLogInputContextClassClass
{
    direction = "FW",
    fullText = true,
    resolveSIDs = false,
    formatMessage = true,
    formatMsg = true,
    msgErrorMode = "MSG",
    fullEventCode = false,
    stringsSep = "|",
    iCheckpoint = string.Empty,
    binaryFormat = "HEX"
};

Now I'm just confused, since it does not make any sense for that API to behavior differently with Winform + .NET 2.0 and WPF + .NET 4.0. Can someone enlighten me here?

BTW, I'm using the same query, same parameter against remote server between the sample app and my app. So theoretically the performance should be the same, but now that usually ExecuteQuery takes about 5 secs in my app but in the sample app it returns immediately. With local machine event query though, the ExecuteQuery both return immediately in both apps.

My dev environment is Windows Server 2008 R2 + VS2010

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top