Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to set an Activity that is not running #33

Closed
glucaci opened this issue Jul 10, 2024 · 2 comments
Closed

Trying to set an Activity that is not running #33

glucaci opened this issue Jul 10, 2024 · 2 comments

Comments

@glucaci
Copy link

glucaci commented Jul 10, 2024

Hi, could you please release the current master version ?

Thanks!

@glucaci
Copy link
Author

glucaci commented Jul 10, 2024

Hmm... seams that the error that i get is still in master.

System.InvalidOperationException: 'Trying to set an Activity that is not running'

In the Handle methods we always Stop the activity in the delegate from the WithReplacedActivityCurrent and this means that the finally from WithReplacedActivityCurrent will set to the Activity.Current a stopped activity and will throw because => https://github.com/dotnet/runtime/blob/041375910885f3a30ccf0bb8b751566dae7043f4/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs#L1378

If there is no reason to call Stop in the delegate we could put it after WithReplacedActivityCurrent.

Or if there is no reason to use WithReplacedActivityCurrent we could just remove it.

@glucaci glucaci changed the title Release current master version Trying to set an Activity that is not running Jul 10, 2024
@jbogard
Copy link
Owner

jbogard commented Aug 12, 2024

Fixed by #32

@jbogard jbogard closed this as completed Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants