I am writing an ETW consumer to listen for ASP.NET events. I have sample code that works well on a Windows 2008 server, where it can see the ASP.NET provider. The problem I am facing is that on my Win7 (64) computer I do not see the ASP.NET provider, so this code shows all events as "unhandled". I made sure that the trace function is installed, and the applicationhost.config file has the corresponding values ββin it.
When I do logman query providers, I donβt see ASP.NET AFF081FE-0247-4275-9C4E-021F3DC1DA35 on the PC, but I see this on the Win2008 server that I am testing on.
How can I do one of the two points below: Add this as a provider to my Win7 computer?
OR
Ask the code to process this message and provide a manifest in my code. When I set "AFF081FE-0247-4275-9C4E-021F3DC1DA35" as a provider, I get events, but they are from an unknown provider. Therefore, I assume that the contents of the manifest are missing.
My sample code below
static void Test3()
{
var sessionName = "ASPNETMonitorSession";
using (var session = new TraceEventSession(sessionName, null))
{
Console.WriteLine("Starting Test1");
session.StopOnDispose = true;
Console.CancelKeyPress += delegate(object sender, ConsoleCancelEventArgs e)
{
session.Dispose();
};
using (var source = new ETWTraceEventSource(sessionName, TraceEventSourceType.Session))
{
Action<TraceEvent> action = delegate(TraceEvent data)
{
Console.WriteLine("GOT EVENT: " + data.ToString());
};
var registeredParser = new RegisteredTraceEventParser(source);
registeredParser.All += action;
source.UnhandledEvents += delegate(TraceEvent data)
{
if ((int)data.ID != 0xFFFE)
Console.WriteLine("GOT UNHANDLED EVENT: " + data.Dump());
};
session.EnableProvider(new Guid("AFF081FE-0247-4275-9C4E-021F3DC1DA35"));
Console.WriteLine("Starting Listening for events");
source.Process();
}
}
Console.WriteLine("Done");
return;
}
source
share