Open Camios opened 1 month ago
Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti See info in area-owners.md if you want to be subscribed.
Looks like a typo to me too, as the one after is 52.
Tagging subscribers to this area: @roji, @ajcvickers See info in area-owners.md if you want to be subscribed.
https://github.com/dotnet/runtime/pull/109138 Never done a pull request to this repo before.
Description
I am unable to enable the EventSource with the Name "System.Transactions.TransactionsEventSource" (defined TransactionsEtwProvider) because it incorrectly defines two event Ids with the same value (11).
This means no events get sent to any listener.
Reproduction Steps
NET 8.0.403 System.Transactions file version 8.0.1024.46610
Repro
Minimal code for repro follows. Put a break point on the call to EnableEvents in TransactionScopeEventListener and step into the System.Diagnostics.Tracing.EventSource code and put a breakpoint on DoCommand method and note it throws.
Event Listener
Program
Expected behavior
A MethodEntered event is logged and exists in the listener's Events collection.
Actual behavior
A MethodEntered event isn't logged because the EventSource isn't enabled.
The EventSource wasn't enabled because of an error when trying to enable the "System.Transactions.TransactionsEventSource" defined by the TransactionsEtwProvider class.
The ArgumentException message is "Event MethodEnterTraceLtm has ID 11 which is already in use."
Am I doing something wrong or is it a blatant mistake for TransactionsEtwProvider to have two event Ids the same (looks like the second one should have been 51 if it was following the sequence)? Specifically: private const int METHOD_ENTER_LTM_EVENTID = 11; private const int TRANSACTION_CREATED_OLETX_EVENTID = 11;
https://source.dot.net/#System.Transactions.Local/System/Transactions/TransactionsEtwProvider.cs,09968f86241d7c4d
Exception details
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response