System.ObjectDisposedException: The semaphore has been disposed.
See original GitHub issueHello,
I am using the latest pre release version 2.0.0-beta 4 with aspnet core 3. During the execution of my production code I get a lot off errors from the Sentry client itself.
This is the output of the log.
fail: Sentry.ISentryClient[0]
An error occured when capturing the event System.ObjectDisposedException: The semaphore has been disposed.
at System.Threading.SemaphoreSlim.CheckDispose()
at System.Threading.SemaphoreSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.SemaphoreSlim.Wait(TimeSpan timeout)
at Sentry.Internal.BackgroundWorker.EnqueueEvent(SentryEvent event)
at Sentry.SentryClient.DoSendEvent(SentryEvent event, Scope scope)
at Sentry.SentryClient.CaptureEvent(SentryEvent event, Scope scope).
Has anyone an idea what causes this? Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
c# - What is wrong in this code to throw an ...
It throws the following exception- System.ObjectDisposedException {"The semaphore has been disposed."} I have a class library like -
Read more >Why my code is throwing `The semaphore has been disposed ...
ObjectDisposedException: 'The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
Read more >Best practice for handling async dispose using lock ...
I have run into an issue where I have a async method that disposes of resources asynchronously. This method needs to be multithreaded...
Read more >DxChart for Blazor - "The semaphore has been disposed" ...
In our Blazor Server code we sometimes remove a chart from the markup interactively (we have a conditional that no longer shows the...
Read more >You should be using using in CSharp - Lost in Details
Use using instead of calling Dispose() manually whenever you can to keep instances from escaping their dispose call. Refactor to reduce the need...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve pushed a fix and will release it as 2.0.0-beta5 once
zeus.ci
gets back online. Tomorrow it should be up. Thank y’all for raising this.Same problem
Sentry is injected like this:
In Program.cs
And actual injection:
And called like: