C
C#9mo ago
Matvei

❔ EventSource/EventListener not finding each other on iOS?

I've got a cross-platform MAUI net8 app. I want to listen to an EventSource from one of my app's dependent libraries. For this, I have a static EventListener with overridden OnEventSourceCreated/OnEventWritten. This works on all platforms except iOS. If I set some breakpoints, I see that both EventSource and EventListener are constructed, but my listener's OnEventSourceCreated never ever gets called. What could be the reason? Are there any extra steps/configuration needed to make System.Diagnostics.Tracing infrastructure work on iOS?
2 Replies
Matvei
Matvei8mo ago
Solved my own problem. Turns out I need to include <EventSourceSupport>true</EventSourceSupport> in my csproj. Source: https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trimming-options?pivots=dotnet-7-0#trimming-framework-library-features
Trimming options - .NET
Learn how to control trimming of self-contained apps.
Accord
Accord8mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.