Hi all, I have been reviewing the other posts on EventPipe and C# and wondered if anyone has an example for EventPipe and how to handle the OnNewValue method within VB.Net 2005 or 2008? Thanks, Jimmy
while preparing the Webinar we had some Discussions on VB.NET vs. C# - I take this as a request to try to provide the code in both languages.
Attached is a rough "translation" of the C# Event Pipe example to VB.NET 2008.
Hope this helps,
Thanks for the example. It's much appreciated
I ran the code for a few hours within VB.Net in debug mode and I got a "ContextSwitchDeadlock was detected" warning. The message with the warning was as follows:
"Message: The CLR has been unable to transition from COM context 0x206508 to COM context 0x2067e8 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations."
Do you have any idea how to implement the "CoWaitForMultipleHandles" they talk about or is there something else I can do?
I recommend you take a quick look at this Microsoft KB Article about ContextSwitchDeadlock Managed Debugging Assistant (MDA). As the article says, it is possible that this get falsely activated when certain conditions are met - and you can disable the MDA to avoid interference with the debugging session:Debug > Exceptions > Managed Debug Assistants > Clear the ContextSwitchDeadlock item.
Hope this helps!
Retrieving data ...