views:

19

answers:

1

I'm trying to read, from XP SP3, .evtx log files which are hosted on a windows 2008 server.

I use EventLogQuery, EventLogInformation which are in Framework 3.5 System.Diagnostics.Eventing.Reader.

However Visual Studio tells me this: "platform not supported exception". I don't get it as I have the Framework 3.5 installed already.

I am missing something here.

If anyone has a clue or another way to do this, please let me know.

A: 

The source code for these classes constains the following line: (In NativeWrapper.cs)

private static bool s_platformNotSupported 
     = (Environment.OSVersion.Version.Major < 6); 

In other words, they cannot be used on XP.

The MSDN docs for the underlying native APIs state that it requires Vista or higher.

SLaks
thanks SLaks.that was pretty clear and obvious on msdn but i didn't came across it before.i'll try to find a workaround as i can't change my OS.still if anyone as a clue on how to do it from XP, i'll apreciate.Wallou
wallou
@wallou: Actually, it's not obvious. The docs for the managed classes incorrectly state that it works on XP SP3.
SLaks