EventSource/EventListener not working on Android with Single Project Uno #16617
Replies: 2 comments 1 reply
-
Thanks for the report. Can you explain a bit more about your EventSource/EventListener reference? Is it the standard .NET EventSource, and if not what brings this particular support in your app? |
Beta Was this translation helpful? Give feedback.
-
Sorry, yes, referring to System.Diagnostics.Tracing.EventSource/EventListener I used these to log events in my apps that go to the VS output window, and to a couple places in the user interface as well. I suppose I could switch to using ILogger and write a logging provider for my UI, but I just haven't gotten to doing it. |
Beta Was this translation helpful? Give feedback.
-
Current behavior
After moving my application to Single Project Uno, the
EventSource
/EventListener
logging system stopped working for Android for me. It still works well with WindowsAppSDK or Desktop (*). On Android, the source and listener appear to register correctly, but the listener does not receive any log event at all (EventWritten
), nor notification that sources have been created (EventSourceCreated
), as it does in WindowsAppSDK and Desktop. All of this is working fine in the version of my app still using the multiple platform head projects.(*) Trying to establish whether it works on WASM as well but blocked there by a build issue for the moment)
Expected behavior
For
EventSource
/EventListener
to work on all platforms, as they did for me before moving to Single Project.How to reproduce it (as minimally and precisely as possible)
I am not quite sure how to investigate this one. I can try to put together a reduced repro if that is helpful, but that will require some time and effort, so I figured I would post this in case the answer is known or obvious.
I noticed that nothing appears to be calling
App.InitializeLogging
on Android so I added a call to it in theApplication
constructor in Main.Android.cs but that did not fix the issue.Workaround
None found so far.
Works on UWP/WinUI
Yes
Environment
No response
NuGet package version(s)
No response
Affected platforms
Android
IDE
Visual Studio 2022
IDE version
17.9.6
Relevant plugins
No response
Anything else we need to know?
No response
Beta Was this translation helpful? Give feedback.
All reactions